开发者

Can someone explain this JS code and error to me? Why does it fail?

I am trying to access a public-facing site (not one that I developed but is being used as a reference site) and it does not load in IE8 (which is our corporate standard browser). It loads fine in Chrome (not all users have it). The error I receive is "res://ieframe.dll/acr_error.htm...". Do I have to configure IE8 in some way to render this? Any and all assistance to better troubleshoot this would be greatly appreciated.

I looked at the source via "View source开发者_StackOverflow中文版" and I see the following towards the top:

<!DOCTYPE html> 
<html> 
   <head> 
   <meta charset="utf-8"> 
   <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> 

    <link rel="stylesheet" type="text/css" href="http://code.jquery.com/mobile/1.0a2/jquery.mobile-1.0a2.min.css" /> 
    <link rel="stylesheet" type="text/css" href="/css/mobile.css" /> 
    <link rel="stylesheet" type="text/css" href="/css/main.css" /> 

    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script> 
    <script type="text/javascript" src="/js/plugins/jquery.scroll.js"></script> 
        <script type="text/javascript" charset="utf-8"> 
        $(document).bind("mobileinit", function(){
          $.extend(  $.mobile , {
            ajaxFormsEnabled : false,
                ajaxLinksEnabled : false
          });
        });
        </script> 


    <script type="text/javascript" src="http://code.jquery.com/mobile/1.0a2/jquery.mobile-1.0a2.min.js"></script> 

Does the above code snippet suffice to assist with some advice or is the whole HTML document needed?


I think you need to start by wrapping that in a

$(document).ready(function{

});

segment, otherwise you may run into all sorts of trouble.


unfortunately your question is too vague to get you a reliable answer, however a quick google search landed me on this:

http://answers.microsoft.com/en-us/ie/forum/ie8-windows_other/resieframedll-error-in-ie-8/7f657540-474f-4587-b661-c3ffbb1aed06

So I am suspecting it's a problem with your installation of ie8. If not please supply more info :)


I doubt jQuery Mobile has much support for IE8. It's built with mobile browsers in mind so the main rendering engines would be Webkit(Chrome) and Gecko(Fx). It's that simple.


JQuery mobile is supported by IE 8 if it is the correct version, but this line here may be the error:

<script type="text/javascript" charset="utf-8"> 
        $(document).bind("mobileinit", function(){
          $.extend(  $.mobile , {
            ajaxFormsEnabled : false,
                ajaxLinksEnabled : false
          });
        });
        </script> 

<script type="text/javascript" src="http://code.jquery.com/mobile/1.0a2/jquery.mobile-1.0a2.min.js"></script> 

You are calling something with mobile before your mobile script is imported. You need to first import your mobile script, then do a document.ready() call a Javascript function at the VERY END of you html page that will run all init functions.

This is one of the few calls you want to run before loading JQuery Mobile

//run this script after jQuery loads, but before jQuery Mobile loads, and may help solve your issue

//customize jQuery Mobile to let IE7+ in (Mobile IE)
$(document).bind("mobileinit", function(){
  $.extend( $.mobile , {

  //extend gradeA qualifier to include IE7+
    gradeA: function(){
     //IE version check by James Padolsey, modified by jdalton - from http://gist.github.com/527683
var ie = (function() {
var v = 3, div = document.createElement('div'), a = div.all || [];
while (div.innerHTML = '<!--[if gt IE '+(++v)+']><br><![endif]-->', a[0]);
return v > 4 ? v : !v;
}());

     //must either support media queries or be IE7+
     return $.support.mediaquery || (ie && ie >= 7);
    }
  });
});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜