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 John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open page in same window

Status
Not open for further replies.

Lambro

Programmer
Aug 22, 2001
258
US
Here is my script:

<script LANGUAGE="javascript">
function DoDeleteHead(){
var submitOK = confirm("Are you sure you want to clear the text file?")
if (submitOK == true){

open("clear_db.asp");
}
}
</script>




Here is the link that I click on to call this script:

<a href="javascript:DoDeleteHead('');">Clear Text File</a>




When I click on the link I get the message box, when I click OK it opens a new window. I have a response.redirect in the clear_db.asp page that brings me back to the page I clicked the link on.


How do I keep it from opening a new page and stay on the same page.
 
Try this:

Window.Location="clear_db.asp";

instead of

open("clear_db.asp");

-VJ
 
I usually write "document.location", but if window.location will work, it will probably be with lower-case 'w' and lower-case 'l'.

--Dave
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top