I know I can load in html in to a div with:
$(\"#my_div\").load(\"http://www.mypage.com\");
but I want to do is load html into a variable l
You could also create an element in memory and use load() on it:
var $div = $(''); $div.load('index.php #somediv', function(){ // now $(this) contains #somediv }); The advantage is that you can specify which part of index.php you want to load by using a selector ( #somediv ) 0 讨论(0) 查看其它4个回答 发布评论: 提交评论 加载中... 验证码 看不清? 提交回复
The advantage is that you can specify which part of index.php you want to load by using a selector ( #somediv )