Hello
I wondered if someone could help. In the past I have used this small script:
<SCRIPT LANGUAGE=”JavaScript”>
<!– if (top.location.href.indexOf(“mypage.html”) == -1)
top.location.href = “mypage.html?pageURL&frameNum”;
// –>
</SCRIPT>
to reload a HTML page in a frame’s html I specify. It has worked very well for me.
I now want to use the same little script in a cgi file that will load a frame page on creation so the cgi page is displayed in the correct frame work.
However, the script above, once placed in the cgi file, causes the page to refresh over and over in a continuos loop.
How do I modify the script to stop the reload once the page has been loaded into the framework?
Hope someone can help
cheers Jordy ?
[code=php]
<html>
<head>
<script>
function redir(){
if(parent.frames.length==0){
window.location="index.html";
}
}
</script>
</head>
<body onload="redir()">
</body>
</html>
[/code]
[i]Originally posted by Charles [/i]
[B]Hey Kor, please use valid HTML in your posts. You're only confusing the newbies.[/B][/QUOTE]
[i]Originally posted by Willy Duitt [/i]There's nothing on that page about marking the contents of the SCRIPT element as CDATA. In fact, there's nothing there at all what the elements contain. It's just a list of the elements and their attributes and at that it's incorrect and incomplete. Any idiot can, and often does, upload some document that reflects what they feel HTML is.
[B]No I'm not.[url=http://www.thozie.de/english/mobileweb/markup/structure.htm]Here is a quick reference link[/url] . Scroll down to where it outlines [b]Script[/b]....
.....Willy [/B][/QUOTE]
[i]Originally posted by Willy Duitt [/i]You are quite right that you don't have the time to find an authority depricating comment tags in favor of indicating CDATA sections. There isn't enough time in the world; it doesn't exist.
[B]Comment tags are still recommended. However, the comment tags as you know them have long ago been deprecated in favor of CDATA much the same as language was long ago deprecated in favor of type. But I'm not inclined to get in a pissing contest with you nor do I have the time to search for any additional links, however I do concede that the link I provided was less than desirable to support my position....
.....Willy [/B][/QUOTE]
[b]Use external style sheets if your style sheet uses < or & or ]]> or --. Use external scripts if your script uses < or & or ]]> or --. Note that XML parsers are permitted to silently remove the contents of comments. Therefore, the historical practice of "hiding" scripts and style sheets within "comments" to make the documents backward compatible is likely to not work as expected in XML-based user agents.[/b]Note: that applies to XHTML™; it doesn't apply to HTML and HTML hasn't been depricated. And note, the CDATA section is not a comment, nor is it required for every script or style sheet. (See
[i]http://www.w3.org/TR/xhtml1/#guidelines [/i][/quote]
[i]Originally posted by Kor [/i]In the same way that you need to watch you language in front of small children, you need to watch your mark up language in front of beginners.
[B]Tx Willy, u were right... I intended just to show Jordy that the script should be fired onload, without care (sorry Charles) about the coding strictness (which is subject to be changed in a minute, anyway, if you opened that small quarell)
? [/B][/QUOTE]
in front of beginners.
[/quote]
If you don't know what a valid HTML document looks like, please at least use the required "type" attribute with your SCRIPT elements.
[/quote]
[i]Originally posted by Kor [/i]Jordy isn't the only potential beginner reading this thread.
[B]There is no track for I or you can presume Jordy is a begginer. I always let the others to use whichever mark up they want. I am not here to be pedantic but to give quick solutions to a certain problems, according to my knowledge.
With all my respect, I must let you know that, untill the moment you will be the moderator of this section, I will keep my liberty of follow or to ignore your pathetic and pedantic messages ? . As you are not my teacher, I reckon you missed the class.?
With the same respect, I still guess that you might use your energy for solving problems rather that to criticize the strictless coding of others (strictness which is anyway not so absolute as you appear to be so convinced of). [/B][/QUOTE]
0.1.9 — BETA 5.20