Pages

Sunday 14 July 2013

jQuery load() not working in IE - Internet Explorer

JQUERY load() IS NOT working in Internet Explorer IE ?


 May be you are spending a lot of time to working behind this, Your jQuery load() is working fine in all browsers except Internet Explorer, It is your problem ?

The major issue is Internet Explorer will not load the web papges that have broken HTML code called invalid markups.

$('#mycontent').html('<div class="loader">
<img src="loader.jpg"><BR/><BR/>Please Wait for loading
. .
.

</div>').load('home.html #content');  

Suppose you have jquery script  as above, which loads the layer #content from home.html into the #mycontent, some times you may get nothing inside the #mycontent layer, while checking in browser IE. It is because any of the following issues.


1) Check the HTML Markup of loading webpage
Internet Explorer will not load the webpages that have broken links or having invalid markups. Suppose in our above case if home.html is not loading in layer #mycontent, it is because the webpage home.html have invalid markups, Examples of invalid markups are , Opening a tag, but not closing it OR closing a tag which is not opened. You can check the invalid markups of your webpage using

W3C Markup Validation Service

-->



2) Flush the cache of browser

Internet Explorer normally keep the copy of previously loaded content,To empty the cache memory
Tools -> Internet options -> on general tab -> Delete (Delete temporary internet files, history and cookies)


Correcting the markup of  your website will solve the issue in IE and this solution  can only be applied if the page is loading in all other browsers including Mozilla and Chrome But not in Internet Explorer, if the content is not loading in any browsers, you need check the errors in your coding. but you need to correct the markup for loading the content in some versions of Internet Explorer.

No comments:

Post a Comment