Refresh problem

S

Steven

Hi.
I'm have 2 iframes on my page (frame1 and frame 2)

In frame1 I have a page pg1.htm
<script type="text/javascript" src="items.js"></script>
......
<script type="text/javascript"
alert(ITEMS);
</script>

where items.js is as follows
var ITEMS = ['Abc'];

So when the page loads it displays Abc in an alert box as you would
expect.

In frame2 I have pg2.htm which contains a text box where you enter say
123 and click an update button.
This loads pg3.htm into frame1. The purpose of pg3 is to re-write the
items.js file to the following
var ITEMS = ['123']; //or what ever was entered in

pg3 loads pg1 back into frame1.

The problem is the alert still says "Abc", (note the re-write does
actually hapen), its not using the new value . The only way I can get
the new value is to add a button as follows

<input name="reload" type="button" value="Reload"
onClick="document.location.reload()" />

How do I get the code to do this without a reload button
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,996
Messages
2,570,238
Members
46,826
Latest member
robinsontor

Latest Threads

Top