Wednesday, November 21, 2012

$(window).height() error

in this sample ,i was get the $(document).height() = $(window).height() error.

(function(){
var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");
document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3Fe5a3ac2e85961f8d26fe5b21c76bd7d4' type='text/javascript'%3E%3C/script%3E"));

$(window).scroll(function(){

if($(window).scrollTop() == $(document).height() - $(window).height())
{
loadmore();
}
});

check_loadmore();
})();




fixed:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>


add <doctype.. before <html>.

1 comment:

Gidget said...

I see you share interesting things here, you can earn some extra cash, your blog has huge potential, for the monetizing method, just search in google - K2 advices how to
monetize a website