Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-04-2005, 06:23 AM   PM User | #1
kevmeister
New to the CF scene

 
Join Date: Jul 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
kevmeister is an unknown quantity at this point
Javascript Problem |Wanna make a javascript amateur praise you for your smarts?|

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?
kevmeister is offline   Reply With Quote
Old 07-04-2005, 06:46 AM   PM User | #2
Harry Armadillo
Regular Coder

 
Join Date: Feb 2005
Posts: 400
Thanks: 0
Thanked 0 Times in 0 Posts
Harry Armadillo is on a distinguished road
First, read section 2, of this page.

Second, no. Security consideration prohibit reading the href (or any other properties) of a frame/window that isn't from the same domain.
Harry Armadillo is offline   Reply With Quote
Old 07-04-2005, 08:16 AM   PM User | #3
jscheuer1
Regular Coder

 
Join Date: Mar 2005
Location: SE PA USA
Posts: 373
Thanks: 0
Thanked 0 Times in 0 Posts
jscheuer1 is an unknown quantity at this point
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?
jscheuer1 is offline   Reply With Quote
Old 07-06-2005, 11:19 AM   PM User | #4
kevmeister
New to the CF scene

 
Join Date: Jul 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
kevmeister is an unknown quantity at this point
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.
kevmeister is offline   Reply With Quote
Old 07-06-2005, 11:55 AM   PM User | #5
Harry Armadillo
Regular Coder

 
Join Date: Feb 2005
Posts: 400
Thanks: 0
Thanked 0 Times in 0 Posts
Harry Armadillo is on a distinguished road
Quote:
Originally Posted by kevmeister
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.

Last edited by Harry Armadillo; 07-06-2005 at 12:02 PM..
Harry Armadillo is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:44 PM.


Advertisement
Log in to turn off these ads.