sman591
sman591

Reputation: 560

Javascript executing "else" only when location.reload is present?

I'm trying to have the page refresh if and only if there is no html (errors) returned by the $.post() function. The code works just fine when I don't have location.reload(true); present. When I do have it present, the page speed seems to have load speed decide if it's going to validate or not...

I tested this, and found that the code worked 80% of the time when run on a remote server, but it only worked 50% of the time when run locally using MAMP. Why, and is there a way to fix this?

Code & everything: http://jsfiddle.net/sman591/ZHays/

Upvotes: 1

Views: 209

Answers (1)

Jayantha Lal Sirisena
Jayantha Lal Sirisena

Reputation: 21376

why you are having

var messagehtml = $('.window #message').html(); 

intead of var messagehtml =$('.window #message').html()

Upvotes: 1

Related Questions