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 t开发者_如何学运维his 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 (e.g. "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.
精彩评论