Hi folks,
I am a new bee in Java Script and I have been facing many problems with different browsers. Most of the times it's with IE. The code I write works fine with Chrome and Firefox where as throws errors with IE. Anyways, coming to the actual problem, I have the requirement of creating a dynamic script element something like
<script type="text/javascript" src="myUrl"> function1( args1)</script>
I used DOM to do this and my code looks
var hip = document.create Element('script ')
hip.type = 'text/javascript';
hip.src = "jscript file location";
hip.innerHTML = sjcap( defectSet );
Here defectSet is a fieldSet define prior to this new script element's definition and sjcap is a function in my class where I write the above piece of code.
Now the problem is, this works perfect with chrome and throws error "Unknown runtime error" in IE. I use IE 8. I have seen similar problem in this forum. but, I couldn't see any useful solution from it.
Few people said, IE doesn't support innerHTML for few elements like td, tr , tbody and few other says, take out "/" character in the strings.
Could some one suggest me on how to solve this problem please.
I am a new bee in Java Script and I have been facing many problems with different browsers. Most of the times it's with IE. The code I write works fine with Chrome and Firefox where as throws errors with IE. Anyways, coming to the actual problem, I have the requirement of creating a dynamic script element something like
<script type="text/javascript" src="myUrl"> function1( args1)</script>
I used DOM to do this and my code looks
var hip = document.create Element('script ')
hip.type = 'text/javascript';
hip.src = "jscript file location";
hip.innerHTML = sjcap( defectSet );
Here defectSet is a fieldSet define prior to this new script element's definition and sjcap is a function in my class where I write the above piece of code.
Now the problem is, this works perfect with chrome and throws error "Unknown runtime error" in IE. I use IE 8. I have seen similar problem in this forum. but, I couldn't see any useful solution from it.
Few people said, IE doesn't support innerHTML for few elements like td, tr , tbody and few other says, take out "/" character in the strings.
Could some one suggest me on how to solve this problem please.
Comment