简体   繁体   中英

older javascript compatibility with Internet Explorer 8

I am making a current product compatible with Internet Explorer 8. This product uses Javascript and I am trying to figure out why it does not work with IE8. I believe it is to do with the following code:

<div id="atag">

 $("#atag").dialog({
          .ghrd: gr,
          .hfdhf: hrg,
          .hfd: gdf
   });

Can anyone tell me how to update this to work with IE8?

A couple of potential problems here. Firstly, you shouldn't have a dot in front of your property names (so instead of .ghrd: gr use ghrd: gr ). Also, if it's working in IE9 but not IE8 then you may have a property name that IE8 is picking up as a reserved word, in which case you need to quote it (eg "class": gr rather than class: gr ).

I second MarkXA's answer, but there could potentially be more problems:

  • Are gr, hrg and gdf variables defined in the scope you're trying to use them?
  • Are you sure the .dialog component itself is compatible with IE8?
  • Is it only broken in IE8, or also other browsers such as Firefox or Chrome?

Finally, we will be able to better help you if you post the JS error you get from IE.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM