/    Sign up×
Community /Pin to ProfileBookmark

script works in IE, but not in Firefox

I got the following script but I discovered that it doesn’t work in Firefox.

Why?

Thanks in advance.

[CODE]<html>
<head>
<title>URL Switcher</title>

<script language=”JavaScript”>
var i = 0;
var url_array = new Array();
url_array[0] = “http://fr.youtube.com/watch?v=IBj1aJBvjYE&feature=related”;
url_array[1] = “http://fr.youtube.com/watch?v=qjSOz5w1GHI”;
url_array[2] = “http://fr.youtube.com/watch?v=IifX6TbZuuQ”;
url_array[3] = “http://www.friends-dating.co.uk/action_home+page.htm”;
url_array[4] = “http://fr.youtube.com/watch?v=T4jdhGKekCo”;
url_array[5] = “http://fr.youtube.com/watch?v=J7EY7wYhxow”;

function changeURL(ms) {
document.frames[‘my_frame’].location.replace(url_array[i]);
i = (i+1)%url_array.length;
setTimeout(“changeURL(“+ms+”)”, ms);
}
</script>

</head>
<body style=”margin:0px; overflow-y:hidden” onLoad=”changeURL(5000);”>
<iframe name=”my_frame” width=”100%” height=”100%” border=”0″ frameborder=”0″></iframe>
</body>
</html>[/CODE]

to post a comment
JavaScript

12 Comments(s)

Copy linkTweet thisAlerts:
@FangDec 21.2007 — [COLOR="Green"]window[/COLOR].frames['my_frame'].location.replace(url_array[i]);
Copy linkTweet thisAlerts:
@zoffmannauthorDec 21.2007 — I think that this one didn't work, but I will try one more time.

but I wrote like this

[CODE]window.frames['my_frame'].location = url_array[i] ;[/CODE]

and it seems working

Please if I have wrong correct me. ?


I have two more questions:

  • 1. is there any good specification of javascript objects and functions on the Internet


  • 2. and if it exists some good free (or cheap) editor ?
  • Copy linkTweet thisAlerts:
    @zoffmannauthorDec 21.2007 — Thanks, it seem that htmlkit is stuff which I need
    Copy linkTweet thisAlerts:
    @zoffmannauthorDec 21.2007 — but here is a issue which I noticed before with frames.

    if I have address of some page and want to open into the frame area then the whole page takes whole the browser window and the frame dissapears, and even my script stops working.

    Is some work around to prevent this behaviour?
    Copy linkTweet thisAlerts:
    @FangDec 21.2007 — Use the target name to open the document in the required frame.
    Copy linkTweet thisAlerts:
    @zoffmannauthorDec 21.2007 — how do I put target option in my javascript piece of code:

    [CODE]window.frames['my_frame'].location = url_array[i] ;[/CODE]
    Copy linkTweet thisAlerts:
    @FangDec 21.2007 — With [I]frames['my_frame'][/I]
    Copy linkTweet thisAlerts:
    @zoffmannauthorDec 21.2007 — this is chicken and egg situation ?

    and as I understood[I] frames['my_frame'][/I] has the same function as the[I] target[/I]

    but when I use my piece of code window.frames['my_frame'].location = url_array[i] ; to open webpages some pages "doesn't listen" the script:

    They don't open in the frame - they take the whole browser window and script stops working
    Copy linkTweet thisAlerts:
    @FangDec 21.2007 — If the pages you are opening in your frames are not yours then these documents are using 'frame busters' to break out of your frames.

    There is nothing you can do to prevent this.
    Copy linkTweet thisAlerts:
    @zoffmannauthorDec 21.2007 — That's what I suspected. ?

    Is there some technology (programming language )which can cope with frame busters?
    Copy linkTweet thisAlerts:
    @FangDec 21.2007 — That's what I suspected. ?

    Is there some technology (programming language )which can cope with frame busters?[/QUOTE]
    No
    ×

    Success!

    Help @zoffmann spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 5.18,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @AriseFacilitySolutions09,
    tipped: article
    amount: 1000 SATS,

    tipper: @Yussuf4331,
    tipped: article
    amount: 1000 SATS,

    tipper: @darkwebsites540,
    tipped: article
    amount: 10 SATS,
    )...