javascript - Empty return from JQuery .contents() -


i'm trying html using:

$(document).ready(function () {     var html = $("html").contents(); }); 

when type "html" in chrome console "[]" think html variable not loaded.

doing same thing in other web site, when type "html" in chrome console get

[<head>​…​</head>​ ,#text,<body class=​"page_color default_font ext-webkit ext-chrome" id=​"ext-gen3" style>​…​</body>​]

so, why there difference? in both application have jquery.

you have define globally

var html; $(document).ready(function () {     html = $("html").contents(); }); 

Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

IIS->Tomcat Redirect: multiple worker with default -