Solved Javascript in to innerhtml w/out interfering

August 7, 2011 at 06:41:15
Specs: N/A, N/A
Javascript in to innerhtml w/out interfering with it's script tag please look
<script type="text/javascript">
function we()
document.getElementById("stuff").innerHTML="<a href="" title="Show My Weather Forecast" onclick=";return(false);"><script type="text/javascript" src="¤t=1&forecast=1&background_color=ffffff&color=000000&width=175&padding=10&border_width=1&border_color=000000&font_size=11&font_family=Arial&showicons=1&measure=F&d=2011-08-06"></script></div>";


The </script> in the inner HTML makes it think I'm ending the function and whole script instead I obviously want to enter that paragraph "stuff". Our there any ways to work around this???

See More: Javascript in to innerhtml w/out interfering

Report •

August 14, 2011 at 13:52:44
✔ Best Answer
I've always had to fight tooth and nail to get anywhere with something like that; As a result, I tend to try something like:

var js = document.createElement("SCRIPT");
var at = document.createElement("A");

at.href = "some link";
at.title = "some title";
at.onClick = some event;
at.innerHTML = "some link text";

js.src = "some source";



Report •
Related Solutions

Ask Question