Jquery .load and inner jquery .append
Posted
by speekeazy
on Stack Overflow
See other posts from Stack Overflow
or by speekeazy
Published on 2010-06-08T15:43:40Z
Indexed on
2010/06/08
15:52 UTC
Read the original article
Hit count: 153
jQuery
Hello, Ive just started using jquery for the .load ajax functionality. When i load an external page to a specific div it loads fine. inside the external page there is an .append that .appends javascript to the head. This works on the initial load but when i use .load to load it this portion is not showing.
//This is the .load for the div
function loadContent(elementSelector, sourceUrl) {
url = ""+sourceUrl+"";
$(""+elementSelector+"").load(url);
alert(url);
}
//This is the append in the other page that is embedded in a js
var cUrl = "http://intensedebate.com/js/genericCommentWrapper2.php?acct="+idcomments_acct+"&postid="+idcomments_post_id+"&title="+idcomments_post_title+"&url="+idcomments_post_url;
alert(cUrl);
commentScript.type = "text/javascript";
commentScript.src = cUrl;
$('head').append(commentScript);
© Stack Overflow or respective owner