开发者

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

开发者 https://www.devze.com 2023-03-24 09:58 出处:网络
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 h

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()

0

精彩评论

暂无评论...
验证码 换一张
取 消