Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Why Automatically Reloading Index Page?

Status
Not open for further replies.

cptk

Technical User
Mar 18, 2003
305
US
My index file is pointing to a cgi script which builds the html page and sends it back to the client, which contains javascript functions.

The intial loading and display of the page is working fine.

However, when I execute any javascript functions on the page (e.g. - clicking a test button to hide a DIV section using style.display="none"), it automatically reloads the index file!!!

I see the DIV section briefly disappear, but then the entire page reloads, thus effectively canceling any previous javascript function induced effects.

It (reloading of page automatically) even happens when I execute a simple function like 'alert ("hithere")'.

What am I forgetting/missing here?
 
after the html page loads, copy and paste the source code into a static html document. Upload it to your server (if necessary) and see what happens when you try similar things (like hiding the div).

 
Hi

Are you sure that test button is really a button, not a submit ? And how is that [tt]alert()[/tt] called ? By the way, what browser ?

I think this is a client side problem, but would be better to show some source too.

Feherke.
 
My mistake ... I was calling the function incorrectly (crappy), using the following:

<td onclick=Functname()><a href="">

The href="" (i.e. - blank) was reloading my page!

Instead, I switched to ...
<td><a href="javascript:Functname()">



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top