NameSilo

Window.location not working

SpaceshipSpaceship
Watch
Impact
0
Can anyone suss this out for me?...

its a confirm box used on an asp created page: -

// to call the funtion
<a href="&"javascript:void(null)"&" onClick="&"confirm_delete("& newsId &"); return false"&">Delete</a>

// the function
<script language="javascript">
function confirm_delete (newsId)
{
var message = "Are you sure you want to delete?";
var return_value = confirm(message);

if ( return_value == true )
{
window.location.href="http://www.google.com";
}
}
</script>

the window.location just doesn't work, I hear the clicking sound but nothing happens, if I change to window.open it works fine, but I obviously dont want it in a new window. I have tried messing around with various syntax but not really sure what to do.

Any ideas very much appreciated

dan
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
Unstoppable Domains โ€” AI StorefrontUnstoppable Domains โ€” AI Storefront
OK I got it to open google just using
window.location = 'http://www.google.co.uk'

BUT

I noow want to just link to a relative file E.g.
window.location = 'samplepage.hmtl'

and this isn't working either, 2 steps forward....

cheers
dan

*thats a typo by the way HMTL = HTML

still doens't work ;)
 
Last edited:
0
•••
UPDATE: its totally weird

window.open="filename.htm"; is fine
window.location="http://www.domain.com; is fine
but
window.location="filename.htm" doesn't work
window.location="http://www.domain.com/filename.htm" doesn't work either

????????????????????????
 
0
•••
Dynadot โ€” .com TransferDynadot โ€” .com Transfer
CatchedCatched
Escrow.com
Spaceship
Rexus Domain
CryptoExchange.com
Domain Recover
CatchDoms
DomDB
NameFit
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back