Topic: jQuery prepend external javascript.

I have a very wierd problem. I need to prepend external javascripts in to my DOM and i am getting redirected but if i refresh than it works find.

I want to add the game Super Mario ( smile ) into the DOM.

<script type="text/javascript" src=""></script>
<script type="text/javascript" charset="utf-8">
  if (WIDGETBOX) WIDGETBOX.renderWidget('e1ed0284-eeeb-4b95-905f-2924e23bddbd');

If i add this to my website without Ajax than it works perfect. But if i try to do WIDGETBOX.renderWidget i get redirected to

this is my jQuery code:

$(selecter).prepend('<script type="text/javascript" src=""></script><script type="text/javascript" charset="utf-8">if (WIDGETBOX) WIDGETBOX.renderWidget("e1ed0284-eeeb-4b95-905f-2924e23bddbd");</script>')

I am not surprised that it isnt working.... because i call javascript when i think the javascript file isnt loaded. But i am clueless how to solve this problem.

If somebody wants to have a look thanks a lot!


Re: jQuery prepend external javascript.

If somebody wants to know a solution.

If you want to inject exteded javascript you can do it in the head of an iframe.