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

  • Home
  • SEARCH
  • 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 7752251
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T11:45:06+00:00 2026-06-01T11:45:06+00:00

EDIT: It does work (sorry). Something in this script is causing it to stop

  • 0

EDIT: It does work (sorry). Something in this script is causing it to stop in google chrome:

function checkLocation() {
  var loc = top.location.href;
  var suffix = "subpage.html";
  if (loc.indexOf(suffix, loc.length - suffix.length) !== -1) {
      top.location.href = "index.html";
  }
}

Original post:

I have IE 9, FF 3.6.3, Chrome (18.0.1025.151) and Safari 5.1.5 all installed.

This works in all of the browsers except google chrome.

I have a HTML layout which contains a named iframe. The iframe src changes to display the different pages. On one of the pages I have a script which is loaded onLoad in the body tag. This script doesn’t load when the page is loaded in the iframe in google chrome only – it works fine in other browsers. Also, if I load the page directly into google chrome (not via an iframe) it works just fine.

How do I fix this?

Here is an example code:

index.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html> <head> <title> Example Page </title> </head>
       <body> <a href="subpage.html" target="targetFrame">View subpage</a><BR/>
              <iframe name="targetFrame"> </iframe>
       </body>
</html>

subpage.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html> <head> <title> Subpage </title>
              <script type="text/javascript" src="subpage.js"> </script>
       </head>
       <body onLoad="initialise()"> Hello </body>
</html>

subpage.js
function initialise() {
    alert("Script loaded.");
}

Thanks for looking.

  • 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-01T11:45:07+00:00Added an answer on June 1, 2026 at 11:45 am

    Turns out its just a security exception

    Unsafe JavaScript attempt to access frame
    with URL file:///C:/Users/.../website/index.html
    from frame
    with URL file:///C:/Users/.../website/subfolder/subpage.html.
    Domains, protocols and ports must match.
    

    Once its online it should be fine.

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

Sidebar

Related Questions

EDIT I isolated a real minimal example which does not work (it is a
Ryan Bates' nifty_scaffolding, for example, does this edit.html.erb <%= render :partial => 'form' %>
I found the following code in SO. Does this really work? String xml =
I'd like to write a shell script that does something like the following while
Sorry if I missed something and this is a silly question...but can I enter
Edit #2: Does anyone have a good method of testing the middle of a
Does anybody know how to edit a syntax file for VIM so that keywords
does anyone know how you edit/maintain regions in magento - specifically adding ones for
EDIT I'm looking for the actual one or two liner that does what the
Does anyone know how can I edit a subitem on a listView? I've tried

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.