I am in need of inserting the following into the footer using jQuery. It generates a small ad banner.
<script src="http://14489-001.pod1.us01.hst.inclickadserver.com/ads/ads.php?t=MTAwMjsxO2hvcml6b250YWwubGVhZGVyYm9hcmQ=&index=1"></script>
I tried the following to no avail:
var s = document.createElement("script");
s.src = "http://14489-001.pod1.us01.hst.inclickadserver.com/ads/ads.php?t=MTAwMjsxO2hvcml6b250YWwubGVhZGVyYm9hcmQ=&index=1";
$(".copyright-container").prepend(s);
as well as things like:
$("<script src='http://14489-001.pod1.us01.hst.inclickadserver.com/ads/ads.php?t=MTAwMjsxO2hvcml6b250YWwubGVhZGVyYm9hcmQ=&index=1'></scr" + "ipt>").insertBefore('.copyright-container');
I'm getting no errors in Chrome's console, but nothing appears. The ad appears if I just paste the script tag into the body of any page on the site.
Depending on how you load the js, it might not evaluate. Jquery has a
getScript
function, although using it for cross site js files might be difficult. Here is some sample code.