window.location does not work on Firefox

I had a scenario wherein a user clicks a button and a client side javascript function executes and redirects user to another page.

I used window.location.href for redirection, but this did not work in firefox. Having looked up at other sites, the suggestion was to use window.location but this did not work still.

I then realised that the problem was the way the javascript function was called in the onclick event of the button and it required a return false; to get it working.

Below is the code sample, the button has a return false, which prevents the form from submitting to itself and enable re-direction.

<script language="javascript" type="text/javascript">
function GoToRegistration() {
var url = "http://www.lotussoftwaremall.com/"
window.location=url;
}
</script>

<input name="submit" type="image" src="submitbutton.png" onclick="GoToRegistration();return false;" width="80" height="29" />

Comments

Reshma said…
Secrets Escorts Manchester provides the wild sex services in Greater Manchester. In fact, we’ve been providing a fuck service with no comparison to discerning gentlemen for over 25 years. We always welcome applications for representation from sex worker. “Our wild sex girls are ready to hit the clubs and just keep going all night long. Secrets Escorts is source of xxx porn videos that hd quality xxx sex videos. Call 0161 798 6769 to watch live sex videos. Featured Best Porn Sex Collection - Watch high quality Wild Porn clips,Hardcore Anal Fuck Videos ,Animal Sex Videos . Unlimited Sex Videos Gallery, Free HD Sex Movies, XXX SEX videos, TEEN PORN Videos, 69 Fuck Videos, Mature Sex Collections available at most popular adult agency.

Popular posts from this blog

Drupal - How to display webform node in a block?

Error when Installing SQL Server 2008 R2 Management Studio

Technical Team Lead Interview Questions