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 8620519
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T06:36:02+00:00 2026-06-12T06:36:02+00:00

On Internet Explorer my code works perfectly well, but I am using Safari on

  • 0

On Internet Explorer my code works perfectly well, but I am using Safari on a Mac and it gives me that error. This is my code:

<!DOCTYPE html>
<html>
<head>
<title>The Me Project</title>
<link href="me.css" rel="stylesheet" type="text/css" href="me.css" />
<script type="text/javascript">
function page(setter)
{
    if (setter=="home") 
    {
        window.frames["content"].document.location.href = "home.html";
    }
    else if (setter=="birth")
    {
        window.frames["content"].document.location.href = "birth.html";
    }
    else if (setter=="cool")
    {
        window.frames["content"].document.location.href = "cool.html";
    }
    else if (setter=="family")
    {
        window.frames["content"].document.location.href = "family.html";
    }
    else
    {
        window.frames["content"].document.location.href = "home.html";
    }
}
</script>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> 
</head>
<body>
<div id="header">
    <div id="nav">
    <h1>Parth's Me Project</h1>
    <ul>
    <li><a onclick="page('home')">Home</a></li>
    <li><a onclick="page('birth')">Birth Year</a></li>
    <li><a onclick="page('cool')">Cool Things</a></li>
    <li><a onclick="page('family')">My Family</a></li>
    </ul>
    </div>
</div>
<div id="main">
<iframe src="home.html" name="content" id="content" seamless height="1000" frameborder="0"/>
</div>
<frame>
</body>
</html>

If you need the other pages, just tell me.I am trying to keep the same header and nav bar, so I am using an iframe in the bottom section.

  • 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-12T06:36:04+00:00Added an answer on June 12, 2026 at 6:36 am

    That error is telling you that window.frames["content"].document resolves to undefined so the browser can’t access the location property.

    Accessing the document in an iFrame is different in different browsers, see below. Also, chaining references like that is not a good idea (as you’ve discovered) as it makes debugging harder.

    function setIframeHref(iFrameID, href) {
        var frame, cont, doc;
    
        // Firstly, get the iframe
        frame = window.frames[iFrameID];
    
        // In some versions of IE, frame.document is the document the iFrame 
        // is in, not the document in the iFrame. Also, some browsers
        // use contentWindow and others contentDocument.
        // In some browsers, contentDocument points to the iFrame window,
        // in others to the document, so...
        if (frame) {
            cont = frame.contentWindow || frame.contentDocument;
    
            // cont might be the iFrame window or the document
            if (cont) {
                doc = cont.document || cont;
    
            // For current browsers that don't have the above
            } else {
                doc = frame.document
            }   
        }
    
        // If have a document, set the vaue of location.href
        if (doc && doc.location) { 
            doc.location.href = href;
        }
    }
    

    Note that you may still have issues if the HREF isn’t from the same domain or sub–domain. Some sites don’t let their pages be displayed in iFrames so some browsers will refuse to display them while others will open them in new tabs or windows.

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

Sidebar

Related Questions

The following code works in Firefox but in Internet Explorer it returns error Object
This code works nicely in for example Chrome, but not in Internet Explorer 8/9.
The following code works in Firefox 3.6, but not in Internet Explorer 8: <html>
document.location() function given in the logn.js code works fine in Internet Explorer but does
My code works in Firefox but I am having trouble with Internet Explorer. When
I have a simple Ajax script that works perfectly fine in Chrome, Internet Explorer
Basically my issue can be seen by going here using internet explorer. works perfectly
This code works great for all browsers except Internet Explorer. Basically when the redirect
I have a code block that leads to a Internet Explorer cannot display the
This works perfectly in chrome and firefox, and it SHOULD work perfectly in internet

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.