...

View Full Version : Javascript Problem |Wanna make a javascript amateur praise you for your smarts?|



kevmeister
07-04-2005, 06:23 AM
Alright basically what i want to do is write a code which detects a href location in a certain frame, then if this href is detected send the frame to a new location.
I've tried countless variations of this script, but i just cant get it to work.

So far...
var quirksMode2 = "http://www.google.com.au/";
var quirksmode = (frames['framea'].location.href);

function count()
{
var quirksmode = (frames['framea'].location.href)
if (quirksmode == quirksMode2)
{frames['framea'].location.href = "http://www.hello.com.au"}
else {frames['framea'].location.href = "http://www.ninemsn.com.au"};
document.write('Hello')
setTimeout("count()",1000)
}
Then i'd launch 'count()'.
-------------------------------------------------------------------------
Any ideas on fixing it up?

Harry Armadillo
07-04-2005, 06:46 AM
First, read section 2, of this page (http://www.codingforums.com/postguide.htm).

Second, no. Security consideration prohibit reading the href (or any other properties) of a frame/window that isn't from the same domain.

jscheuer1
07-04-2005, 08:16 AM
Third: You keep doing that document.write every 1 second and your frameset should get overwritten in the user's browser if this script is in the head on the frameset page. Other odd effects will obtain if it is on some other page in the frameset, depending upon where in that page.

Fourth: Why not just make framea's src be http://www.ninemsn.com.au to begin with?

kevmeister
07-06-2005, 11:19 AM
no.1: soz bout the name
no.2: thats incorrect, you actually can i know because its another part of my script which does work
no.3: the hello was just to c if it was working, for got to take it out :)
no.4: i can't use the src because a php script is what sends the person to a page that would be a security risk and which i wish to redirect from
no.5: and ofcourse I still can't get this thing to work anyone got any bright ideas?
p.s. I might repost with a descriptive name.

Harry Armadillo
07-06-2005, 11:55 AM
no.2: thats incorrect, you actually can i know because its another part of my script which does work
I would like to see that working part. If you do post it, please use code-tags (http://www.codingforums.com/misc.php?do=bbcode#code).



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum