Fixed Major problem with IE8 and jquery in overlay

Luciano

Member
Hi,
I'm having a stupid issue but maybe there is a simple solution.
I want to call an overlay, similar to the language chooser or quick navigation.

I create the template and the css, that works fine.. the overlay is there and works as expected in all browsers as soon as I click the link. it closes with the cancel button.
me => happy

when I add a javascript to the template.. (simple example, just a teeny script to check if jquery is there)
HTML:
<script type="text/javascript">
    if(typeof(jQuery) === undefined){
        alert("jQuery not loaded")
    }
    else{
        alert("Everything OK")
    }
</script>
It works fine in FireFox or in Chrome (answers ok), but has a strange behavior in IE8
in IE, it tries to do something - the working symbol appears top right - but then it jumps as if javascript was disabled to the overlay template as full page - and then only prompts ok.

in the script console of IE (hitting F12) i get following messages:
LOG: Emulating placeholder behaviour for [object Object]
XenForo.init() 88ms. jQuery 1.4.4, 1.2.5

then after clicking the link i get about 20 times:

OverlayLoader for index.php?qgmisc/overlaytest
Attempted to call XenForo_OverlayLoader.show() for index.php?qgmisc/overlaytest before overlay is created

OverlayLoader for index.php?qgmisc/overlaytest
Attempted to call XenForo_OverlayLoader.show() for index.php?qgmisc/overlaytest before overlay is created

and so on..
(oops, instead of smileys it should be XenForo . OverlayLoader.show() (without the spaces)

thats it, and the page opens not as overlay, but on a new page. There i get the Everything OK alert.
But I want it to stay on the same page like it does in FireFox or in Chrome.

Any help would be very appreciated.
Luc

[EDIT]Just seen this has been moved to open bugs... but could it be that its just me doing something wrong? thats why i had posted it in devel. discussion
Luc
[/EDIT]
 
Update....
It is not really a bug.. (it seems to be a jquery bug that has been "worked around" by xenforo.
if you open the xenforo.js on line: 1327
there is a comment:

// jQuery and IE <= 8 falls over on append() when the HTML to be appended contains <script>

so the behaviour is "working as designed"
:-(

But, after doing some reading on jquery, I found that it will also fall over on other tags, like <embed>

Luc
 
While trying to resolve issues with the permalink popup, I ran into this same issue -- so I changed the overlay handler to strip out scripts, create the overlay, and then run the scripts.

Given that we didn't really support scripts in overlays before, hopefully this method will work.
 
Top Bottom