Window.location not working

SpaceshipSpaceship
SpaceshipSpaceship
Namecheap AuctionsNamecheap Auctions
Watch

Danny__T

New Member
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
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
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
Close
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
Close
CatchedCatched

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Search: choose where to search from the All tab
Open the search at the top of any page. On the All tab, the list next to the search box lets you choose where to search: everything, all...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back