Javascript widget inside JQuery -


After

We are using the Ning platform, and to add a new container DIV below the content of the blog (but the comment section Before the order), we added the following to the body tag:

  & lt; Script type = "text / javascript" & gt; If after {x $ ("DIV.xg_module.xg_blog.xg_blog_detail.xg_blog.xg_blog_detail.xg_blog_mypage.xg_module_with_dialog") (typeof (x $) = 'undefined'!). ('& Lt; div & gt; Content goes here & lt; / div & gt;'); } And {}  / Script & gt;   

However, the content we need to load is Javascript from an affiliate program, which sent us this code to add to that div:

  & lt; Div style = "width: 750px;" & Gt; & Lt; Div style = "border-bottom: 1px solid #fffff; color: #FFFFFF; font-family: Arial, Helvetica, sans-serif; font-size: 22px; font-weight: bold; margin-bottom: 10px; padding- Bottom: 2px; Text-transform: uppercase; "& gt; From 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 .cript ([& lt; div id = "_CI_widget_ '); document.write (_Ci.counter +'"> ;); 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, referee);}) (); & Lt; / script & gt; & lt; / div & gt;   

And of course, it does not work

Question: There is a way to do this Is there a better way? Is this just a matter of all disputed and "S"? Is this format or out Is there an easy way to hack? Is it unsuccessful because it is not loading javascript, since Janet is already running a post page load? Trying various things and no one was working and My eyes are ready to get out of my chairs because I know that I'm missing something stupid, so I thought I would get some more eyes on it. > Thanks for any help / ideas / suggestions.

Try adding your new script element to the head element in your page. Most dynamic script loaders do this.

For example see.

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -