Last modified: 2006-08-13 22:16:32 UTC
When the wiki page contains an IFRAME the body.onload event will be triggered twice once for the main frame, once for the iframe. When the IFRAME loads first this will cause sjax_onload to mess up the whole page. To reproduce put the following into localSettings.php: $wgSiteNotice = '<IFRAME src="/" />';
What's a sajax onload and what does it have to do with MediaWiki?
(In reply to comment #1) > What's a sajax onload and what does it have to do with MediaWiki? Function sajax_onload() is defined in /skins/common/ajax.js
When would you ever have an iframe and how does it interact? I'm really pretty lost here, there's no examples given and it doesn't appear to be related to anything that actually ever happens.
(In reply to comment #3) > When would you ever have an iframe and how does it interact? The example to reproduce the error is given above: Put $wgSiteNotice = '<IFRAME src="/" />'; into localSettings.php. Why have I been investigating IFRAMEs? Wikis typically show only content hosted inside the Wiki. Showing content generated on software outside the Wiki could have amongst others the following applications: * Inline rendering of live demos inside a page discussing programming technologies. * Inclusion of existing software for making the wiki more interactive. The requirement put forward in http://meta.wikimedia.org/w/index.php?title=Extension_Requests&oldid=407347#Ajax_Vote could be solved this way. IFRAMEs are ONE possibility of making content not orginating inside the wiki visible on a wiki page. The major advantage over other technologies like creating extra DIVs is that the content in an IFRAME is almost independent of the parent page.
I'm going to INVALID this since there's no explanation of what's wrong, what's not working, what's contained in the iframe, etc.
Created attachment 2221 [details] Broken output due to described bug The screenshot shows the output of the wiki if $wgSiteNotice = '<IFRAME src="" />'
Above screenshots shows the output for an empty IFRAME inserted into the sitemessage DIV. If $wgSiteNotice = '<IFRAME src="" />'; is removed form localsettings a normal wiki page is shown. The test environment was as follows: * Windows 2000 prof * MediaWiki 1.8 alpha rev. 15483 * Apache 2.0.49 * PHP Version 5.1.1 * MySQL - 5.0.23-community-nt
To clarify: are you trying to use the AjaxSearch feature? Are you trying to show a page generated by MediaWiki in the iframe? The same wiki, or another? And what browser are you using (this is a javacsript issue, ergo client side). If a wiki page is loaded in an iframe, the onload hooks are executed, which is intended behaviour. I don't know though how iframes interact with javascript/dom in different browsers, but i would have thought that the "inner" js code wouldn't "leak" into the souronding page... I'd consider that a browser bug, unless sajax is doing something very strange with teh DOM. Can you provide a URL for seeing this bug live? Thinking about it - wikibits.js uses window.addEventListener to register to hook. Is this maybe (in some browsers) triggered also when iframes in the window are loaded, as opposed to document.onload?
It seems to boil down to spurious treatment of the <iframe> tag in browsers: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de" dir="ltr"> <head></head> <body> <iframe src=""></iframe> <h1 class="firstHeading">This is rendered</h1> </body></html> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de" dir="ltr"> <head></head> <body> <iframe src="" /> <h1 class="firstHeading">This is not rendered</h1> </body></html> In the context of XML it seems strange that the first example renders the <H1> heading, the second does not. (Tested both in IExplore 6.0 and Mozilla 1.7.11) But this is browser issue not a mediaWiki problem.