Note that there are some explanatory texts on larger screens.

plurals
  1. POJavascript widget inside JQuery
    text
    copied!<p>We are using the Ning platform, and in order to add a new container DIV underneath the blog content (but before the comment section), we added the following before the body tag:</p> <pre><code>&lt;script type="text/javascript"&gt; if (typeof(x$) != 'undefined') { x$("DIV.xg_module.xg_blog.xg_blog_detail.xg_blog_mypage.xg_module_with_dialog").after('&lt;div&gt;CONTENT GOES HERE &lt;/div&gt;'); } else{ } &lt;/script&gt; </code></pre> <p>However, then the content we need to load is javascript from an affiliate program, who sent us this code to add into that div:</p> <pre><code>&lt;div style="width:750px;"&gt; &lt;div style="border-bottom:1px solid #FFFFFF;color:#FFFFFF;font-family:Arial,Helvetica,sans-serif;font-size:22px;font-weight:bolder;margin-bottom:10px;padding-bottom:2px;text-transform:uppercase;"&gt;From Around the Web&lt;/div&gt; &lt;script type='text/javascript'&gt; var _CI = _CI || {}; (function() { var script = document.createElement('script'); ref = document.getElementsByTagName('script')[0]; _CI.counter = (_CI.counter) ? _CI.counter + 1 : 1; document.write('&lt;div id="_CI_widget_'); document.write(_CI.counter+'"&gt;&lt;/div&gt;'); script.type = 'text/javascript'; script.src = 'http://widget.crowdignite.com/widgets/29949?_ci_wid=_CI_widget_'+_CI.counter; script.async = true; ref.parentNode.insertBefore(script, ref); })(); &lt;/script&gt; &lt;/div&gt; </code></pre> <p>And obviously, that does not work.</p> <p>THE QUESTION: is there a better way to do this? Is it just a matter of all the conflicting 's and "s? Is there an easier way to format this or output it? Is it failing because it's simply not loading the javascript after the JQuery has already run post-page load? I have been trying different things and none seem to work and my eyes are ready to pop out of their sockets because I know there's something stupid I'm missing, so I thought I'd get some more eyes on it. </p> <p>Thanks for any help/ideas/suggestions.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload