For example:
<html>
<div id="media">123</div>
<a href="javascript:void(0)" onClick="return fun()">Click</a>
<script type="text/javascript">
function fun() {
document.getElementById("media").innerHTML = '<script type="text/javascript">alert("working");</script>';
}
</script>
</html>
After you click the alert does not show.
alert("working")
; is just an example. I want it to finish one job other javascript
. I have a job to be processed through ajax should have used innerHTML
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…