473,320 Members | 1,946 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

iFrame with js src loads the first time, but throws error on reload...

Me
Hello,

The code below runs well on IE 6 and 7.

On Firefox it loads the first time but throws the following error on
reloads.
Error: top is not defined
Source File: top.myIFrameBody();
Line: 1

On Mozilla it never works due to permissions not allowing access to
myIFramBody.

On Netscape 7.2 it loads the first time, but throws security errors
on reloads.

On Safari it throws this error:
TypeError - Value undefined (result of expression top.myIFrameBody) is
not object. about:blank

At first I thought it was a caching problem per
http://developer.mozilla.org/en/docs...ox_1.5_caching

So I added:
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-STORE">
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
but it made no difference.

Any ideas?

Thank you.

<html>
<head>
<script type="text/javascript">
myIFrameBody = function() {
var data = [
'<html><head>',
'</head><body>',
'Hello World: ',
Math.random(),
'</body></html>'
].join('\r\n');
return data;
}
</script>
</head>

<body>

<iframe src="javascript:top.myIFrameBody();" width="400"
height="50"></iframe>
<br>

</body>
</html>
Jan 10 '07 #1
1 2086
Me
I forgot to mention that it successfully loads and reloads on Opera 9,
but fails to load or reload on Opera 7 and 8.

Jan 10 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Terry | last post by:
Hello, http://free.hostdepartment.com/j/javashop/this_works.htm http://free.hostdepartment.com/j/javashop/this_doesnot.htm Please take a look of the above two links. The two pages are...
2
by: Jim | last post by:
I want to pass a value from the parent to the iframe when I click a button, the parent will reload and the iframe should show the data I need... when the iframe loads I want it to run something...
0
by: Leslie McGann | last post by:
Hi, I need to open a different pdf file in an iframe each time the user clicks a button. I also need to open the pdf to a specific page each time. The pdfs in question are located on a web...
26
by: shlomi.schwartz | last post by:
using this example: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Test Page</title> </head>
6
by: Bob | last post by:
Hi All, Is the following possible, and if so could someone show me some example code please :o) I have a web page with several iframes, and I want to be able to refresh them only not the...
3
by: PCgeek | last post by:
sorry moved this over to javascript forum, didn't mean to post 2x! Hi guys, I'm trying to put the finishing touches on my website and could really use some help on this particular issue. My page...
2
by: ericisjusteric | last post by:
I have a page with multiple iframes and need to have the user (ie6) be able to click a button to refresh any one of the iframes - but also to click another button at the top of the page to refresh...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.