Fetch html page content into a var

Posted by Cipher on Stack Overflow See other posts from Stack Overflow or by Cipher
Published on 2013-06-29T04:15:51Z Indexed on 2013/06/29 4:21 UTC
Read the original article Hit count: 95

Filed under:
|
|
|
|

Just a small question here, that how do we get fetch the html content via ajax into a variable that I could use later.
Right now, I have a button on the click of which, I fetch another html page simply through load method as follows:
$('#container').load('http://127.0.0.1/someUrl')

I want to get the content into a var instead that I could at a later time use to append to the dom
$('#someContainer').append(someVar)

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery