PDA

View Full Version : newbie Navigation question


moleculezz
02-04-2008, 06:47 PM
Hello all,

I have been searching the internet to find a way to just go to a specific page using javascript but I can't seem to find the right way. The code I have below (window.open) opens a new window which is not what I want.

Does anyone know a way to do this?

<script language="javascript">
function del( newsid ){
if(window.confirm("Do you really want to remove this article?")){
var url = "news_del.php?id=";
window.open(url+newsid);
}
}
</script>


<a href="javascript:del('3')">

A1ien51
02-04-2008, 08:58 PM
This has nothing to do with DOM and JSON, should have been in the regular JS section.

window.location.href = "newPage.html";

Eric

moleculezz
02-04-2008, 10:03 PM
Thanks... it worked!

binaryWeapon
02-05-2008, 03:57 AM
another way is document.location. It has the same effect, just makes a call to the document location, not the window location.