Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8764511
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T16:03:09+00:00 2026-06-13T16:03:09+00:00

I have a main page that loads a default link in an iframe http://mypage.com/myurl

  • 0

I have a main page that loads a default link in an iframe http://mypage.com/myurl. Having it in a blog, I want to dynamically change that default link inside the iframe, for every post page. I load the default link like that:

<iframe width='1000' height='500' name='iframename' frameborder='0'
        src='http:/mypage.com/myurl'></iframe>

(works on all browsers) and i change dynamically the link inside the iframe by putting this code in every post page:

<script type="text/javascript">
    document.iframename.location = "http://mypage.com/mynewurl"; 
</script>

It works fine on chrome and ie, but it does not work on firefox!!

Any ideas or work around?

Here a simplified example http://www.tinyurl.com/9l7zt2n see the difference with firefox it loads the default link in the iframe. ie and chrome can change with the added javascript.

If it helps to test it on the blog http://www.tinyurl.com/9axhquh u can see it working on chrome and ie, if u click on any post title or “read more” to load the post’s page, the iframe on top changes accordingly

Any ideas or work around?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T16:03:11+00:00Added an answer on June 13, 2026 at 4:03 pm

    document.iframename.location is probably not supported crossbrowser.

    try:

    <iframe width='1000' height='500' id='iframeid' frameborder='0' src='http:/mypage.com/myurl'></iframe>
    
    <script type="text/javascript">
        document.getElementById('iframeid').src = "http://mypage.com/mynewurl";
    </script>
    

    this means:

    1. accessing an element by name through a document.elementName syntax is not supported.
    2. an iframe element has no property called location. location is a property of window. You can access the window of an iframe by using using contentWindow.

    I’ve written a short test here http://jsfiddle.net/FyNW9/. Run it in different browsers.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The Idea I have a main PHP page that loads content in DIV's from
I have a index.php page that is the main page. All pages are included
I have 2 master pages that are nested.this is main master page code for
I have a page (main.php) which loads content from an external PHP file (rpc.php).
I have a product page that loads fine when I type in the www
I have a main page from where I am making a call to load
I am using jQuery for a simple website and have a main page 'index.html'
I have in the main page with two principal parts : in the left
On my main page I have this jquery code which does an ajax call
I have an PHP/HTML main page, in which I include different other PHP files

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.