PDA

View Full Version : Tabbed Document Viewer does not work with Wikipedia



newbee2
08-21-2006, 03:53 PM
1) Script Title: FF1+ IE5+ Opr7+ Tabbed Document Viewer

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex3/tabdocviewer.htm

3) Describe problem: The script does not work with Wikipedia.com. Not sure, why? Can anyone help, please?

jscheuer1
08-22-2006, 09:36 AM
Not a bug. Most likely Wikipedia has code on their pages to 'break out of frames'. Either that or, you made an error implementing the script.

newbee2
08-22-2006, 11:54 AM
Most likely Wikipedia has code on their pages to 'break out of frames'. Either that or, you made an error implementing the script.

How do I check if they have code to 'break out of frames'? I have not changed the script, so I could not have made any errors implementing it.

jscheuer1
08-22-2006, 06:44 PM
No need, I did. They do.

Generally (in javascript) this is done by code like this (there are many variations and this could also possibly be done server side):


if (location!=top.location)
top.location.href='nameOfThePage.htm';

So, you can search for this code and its many variations on the page and all the scripts linked to the page. Or just put the page in an iframe. If it breaks out, it has code to break out of frames on it.

Twey
08-22-2006, 07:28 PM
It does. http://en.wikipedia.org/skins-1.5/common/wikibits.js?1 says:
// Un-trap us from framesets
if (window.top != window)
window.top.location = window.location;

jscheuer1
08-23-2006, 04:24 AM
Well then, it's official. If a page breaks out of an iframe, there is no other reason than it having code to do so. To test a page in this manner just make up a fresh page with nothing on it but:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

</head>
<body>
<iframe src="pages's address here" width="200" height="200" scrolling="auto" frameborder="1"></iframe>
</body>
</html>

Launch it in your browser. If the page breaks out, it has the code to do so.

spam_banjo
12-08-2006, 05:18 PM
It does. http://en.wikipedia.org/skins-1.5/common/wikibits.js?1 says:
// Un-trap us from framesets
if (window.top != window)
window.top.location = window.location;



Worked sweeeeet for me. Thanks Dude. ;)

Twey
12-08-2006, 05:36 PM
I wasn't suggesting you emulate them :)
this could also possibly be done server sideHow?

jscheuer1
12-08-2006, 05:57 PM
Originally Posted by jscheuer1
this could also possibly be done server sideI wasn't suggesting you emulate them :)How?

If by no other means, then an include. There might be others. But, I did say 'possibly', meaning in this case, "I'm not sure but, maybe." Sorry for any confusion my imprecise wording may have caused anyone.

Twey
12-08-2006, 06:33 PM
To break out of frames?

I don't believe it's possible, although there may be some obscure HTTP status code about which I haven't heard.

jscheuer1
12-08-2006, 06:39 PM
To break out of frames?

I don't believe it's possible, although there may be some obscure HTTP status code about which I haven't heard.

More or less what I was saying, yes.

shachi
12-16-2006, 10:10 AM
It does. http://en.wikipedia.org/skins-1.5/common/wikibits.js?1 says:


Twey: What does the ?1 do?

jscheuer1
12-16-2006, 06:16 PM
What does the ?1 do?

Looks like it instructs some type of server side language to tailor that script file to that page in some manner. However, the generated code appears to be identical in this case to wikibits.js without the query and to wikibits.js?2.

Since .js is generally not a server side extension, it could have some other purpose, like causing the file to be read from the server again instead of from the user's cache if called again as -say, wikibits.js?2.