jQuery - Object Expected on IE and $(document).ready(function() {});

廉价感情. 提交于 2019-12-01 11:49:36

Here's one problem that can cause IE to choke where other browsers may not:

$('#' + resultDivName).animate({
  height: '300px', // <=== TRAILING COMMA
}, 500, function() {
  // Animation complete.
});  

Then, in your qtip call, you have:

target: 'popPart_WM300BP'

I believe target takes a jQuery DOM object, not a string. DebugBar points to this line as the cause of "object expected".

Finally, it looks like this version of jQuery Tools includes jQuery 1.4.2. Perhaps 1.4.3 or 1.4.4 would be worth a try.

Could be the url you're using for jquery.tools. It is missing the http: part.

//cdn.jquerytools.org/1.2.5/jquery.tools.min.js

should be

http://cdn.jquerytools.org/1.2.5/jquery.tools.min.js

If you are testing over a HTTPS connection, check if you are choosing view only the content that was delivered securely. If you choose YES maybe the scripts will not be loaded.

Your $(document).ready and $(function(){..} methods are just fine - in fact when I fired up the Visual Studio debugger and attached to the page, those methods were firing as expected. The problem is that they are trying to call a function named initializePageMain() that doesn't exist for some reason. As to why that function doesn't seem to exist... I am not sure.

I would also try "fixing" the script tag that contains this code (sidenote: why isn't doToolTips defined in your index.js file?) to read like the rest of your script tags (get rid of the language element:

<script type="text/javascript"> ... </script>

This is another gem that causes this error in IE

Math..random();

Those two dots (..) will ruin you.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!