Problem using jQuery in Internet Explorer 7
in Using jQuery
•
7 years ago
Well, while you position jquery as a cross-browser framework, I experience severe problems using this framework in Internet Explorer.
To be more specific, let's say I have this function:
function clear_block_contents()
{
$('#pTitle').empty();
$('#pageText').empty();
}
It works perfectly in all browsers, even in IE8. Except for IE7 which reports that there is no such element, although I do have an element with the ID 'pTitle' and 'pageText'.
The other problem. Look at this function:
function load_page(page)
{
if (is_block_visible())
{
clear_block_contents();
}
$.post("test.php?mode=" + page, {},
function(data){
if (!is_block_visible())
{
show_block();
}
$('#pTitle').html(data.page_h1_title);
$('#pageText').html(data.page_content);
$(document).attr({
title: data.page_title
});
}, "json");
}
Pretty simple, isn't it? It does load content into the required container in all browsers. When using IE7 it loads nothing and reports no error, although I pass correct page_id to this function.
I'm quite disappointed using your framework and am going to migrate to mootools if there will be no solution to my problem.
Lastly, this function:
$(document).ready(function()
{
load_page(19);
});
also does nothing in IE7, although it supposed to load an appropriate content taken from the database, as soon as the DOM structure is ready.
I have to use jQuery 1.2.6 now as I'm getting tons of errors when using latest version of jQuery. I'm getting these errors when using only Internet Explorer, it works fine with a=other browsers (tested in Google Chrome, Mozilla Firefox 3.6.13, Opera 11.01).
1