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

Stop Window From Opening

Status
Not open for further replies.

Lambro

Programmer
Aug 22, 2001
258
US
I have a script that calls a page which then redirects back to the original page. The problem is that when the script is called it opens a new page. Here's the code:

<script LANGUAGE="javascript">
function DoDeleteHead(){
var submitOK = confirm("Are you sure you want to delete this record?")
if (submitOK == true){
open(window.location="clear_db.asp");
}
}
</script>




<a href="javascript:DoDeleteHead();">X</a>


I don't want a new page opened, I want everthing to take place it the same browser window.
 
instead of open(window.location="...") use document.location.href="clear_db.asp"

--------------------------
"two wrongs don't make a right, but three lefts do" - the unknown sage
 

At a guess, try removing the "open" call by replacing this:

Code:
open(window.location="clear_db.asp");

with this:

Code:
window.location="clear_db.asp";

Hope this helps,
Dan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top