0
我想从ajax get调用中通过id选择一个脚本节点。jquery select script node get get
<script id="jqgrid_js" type="text/javascript">
...
</script>
get调用:
$.get(url, function(results){
console.debug(results); //the jqgrid_js is included in the result
console.debug($('#jqgrid_js')); //this returns the node from the actual page
console.debug($('#jqgrid_js', results)); // in the result I can not select it
var jqgrid_js = $('#jqgrid_js', results);
//do the update
$('#jqgrid_js').html(jqgrid_js);
}, "html");
我想知道为什么同样的SELECT语句不返回节点,而节点肯定是包含在“结果”变种。
的'context'不能是一个HTML字符串:http://api.jquery.com/jQuery/ – 2011-03-06 12:19:43
ok了,我有什么更改? – 2011-03-06 12:25:22