reloading windows

S

Sam

I am constructing a company intranet.
On the intranet I made an overview-page which displays the availability of
equipment.
The information comes out of a database, and is retrieved by php-script.
The users of the database should be able to change the status of the
equipment.
On the overview-page, I placed a button next to each piece of equipment.
On pressing the button, a new window is opened, in which the user can input
the changes.
On this new window, a "submit"-button and a "cancel"-button can be pressed.
On pressing the submit-button, a php-script is called to make the changes in
the database, on "cancel", the new window is closed.
After pressing the submit-button, I want the initial overview-page to be
reloaded (refreshed) with the new information.

Can anyone help me?

I already tried this, but nothing happens:

The overview-page contains the following script:

<script language="JavaScript" type="text/JavaScript">
window.name = "materieeloverzicht"
</script>

The php page contains the following script:

<script language="JavaScript" type="text/JavaScript">
materieeloverzicht.location.reload()
</script>
 
G

Greg

Sam said:
I am constructing a company intranet.
On the intranet I made an overview-page which displays the availability of
equipment.
The information comes out of a database, and is retrieved by php-script.
The users of the database should be able to change the status of the
equipment.
On the overview-page, I placed a button next to each piece of equipment.
On pressing the button, a new window is opened, in which the user can input
the changes.
On this new window, a "submit"-button and a "cancel"-button can be pressed.
On pressing the submit-button, a php-script is called to make the changes in
the database, on "cancel", the new window is closed.
After pressing the submit-button, I want the initial overview-page to be
reloaded (refreshed) with the new information.

Can anyone help me?

I already tried this, but nothing happens:

The overview-page contains the following script:

<script language="JavaScript" type="text/JavaScript">
window.name = "materieeloverzicht"
</script>

The php page contains the following script:

<script language="JavaScript" type="text/JavaScript">
materieeloverzicht.location.reload()
</script>

materieeloverzicht looks to be a string not a window reference. You
have a perfectly good reference to the parent window in the child
window opener property, but it seems that you can use the window name
if you call window.open() with the name argument

// a.htm (parent)
<script type='text/javascript'>
window.name = 'bill';
function openB(){
window.open('b.htm');
}
window.onload = function (){
window.status = new Date(); // load indicator
window.setTimeout('window.status = window.defaultStatus', 2000);
}
</script>
<a href='#a1' name='a1' id='a1' onclick='openB(); return false;'>Open
b.htm</a>


// b.htm (child)
<script type='text/javascript'>
function reloadA(){
window.open('a.htm', 'bill',);
}
</script>
<a href='#a1' name='a1' id='a1' onclick='reloadA(); return
false;'>Reload a.htm</a>

Not an expert. FWIW.
 
D

DU

Sam said:
I am constructing a company intranet.
On the intranet I made an overview-page which displays the availability of
equipment.
The information comes out of a database, and is retrieved by php-script.
The users of the database should be able to change the status of the
equipment.
On the overview-page, I placed a button next to each piece of equipment.
On pressing the button, a new window is opened, in which the user can input
the changes.
On this new window, a "submit"-button and a "cancel"-button can be pressed.
On pressing the submit-button, a php-script is called to make the changes in
the database, on "cancel", the new window is closed.
After pressing the submit-button, I want the initial overview-page to be
reloaded (refreshed) with the new information.

Can anyone help me?

I already tried this, but nothing happens:

The overview-page contains the following script:

<script language="JavaScript" type="text/JavaScript">
window.name = "materieeloverzicht"
</script>

The window.name is just a string for the target. The window name does
not do much really except in js disabled contexts.
The php page contains the following script:

<script language="JavaScript" type="text/JavaScript">
materieeloverzicht.location.reload()
</script>

You need here a window object reference (not a window name) and you need
to set the reload to true so that a refresh (unconditional get) at the
server is mandatory.

Let's say you did:

<script type="text/css">
var WindowObjectReference = null; // must be global scope
function OpenWindowEquipmentAvailability()
{
if(WindowObjectReference == null || WindowObjectReference.closed)
{
WindowObjectReference = window.open(strUrl, strWindowName,
strWindowFeaturesList);
};
}
</script>

then later you can reload that window with changes thanks to

<script type="text/javascript">
WindowObjectReference.location.reload(true);
</script>
You could even combine both script content into 1 single one.

To close after a click of the cancel button, you would call in this order:
WindowObjectReference.close();
WindowObjectReference = null;

DU
--
Javascript and Browser bugs:
http://www10.brinkster.com/doctorunclear/
- Resources, help and tips for Netscape 7.x users and Composer
- Interactive demos on Popup windows, music (audio/midi) in Netscape 7.x
http://www10.brinkster.com/doctorunclear/Netscape7/Netscape7Section.html
 

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
474,263
Messages
2,571,064
Members
48,769
Latest member
Clifft

Latest Threads

Top