简体   繁体   中英

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/

why you are having

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM