[jQuery] Not working in IE
Hi! I have a small but pain-in-the-ass problem.
Here is my code:
var ExternalLinks_InNewWindow = '1';
function initSpoilers(context)
{
var context = context || 'body';
$('div.spoiler-head', $(context)).click(function(){
var code = $(this).next('div.spoiler-body').find('textarea').text();
if(code) $(this).next('div.spoiler-body').html(code);
$(this).find('div.spoiler-head').toggleClass('unfolded');
$(this).next('div.spoiler-body').slideToggle('fast');
});
}
function initExternalLinks(context)
{
var context = context || 'body';
if (ExternalLinks_InNewWindow) {
$("a.postLink:not([@href*='"+ window.location.hostname +"/'])", $
(context))
.bind("click", function(){ return !window.open(this.href); })
;
}
}
$(document).ready(function(){
initSpoilers('body');
initExternalLinks();
});
The problem is that this code working PERFECTLY in firefox but not in
IE: on reload of page spoiler aren't acting at all.
On load page via link the spoilers are working fine :(
What could be wrong?