A
artz
hi there.. i will try to describe the problem...
Here is thing. I have a document loaded in a browser that has some
javascript functions and it has also a iframe that opens another doc.
In this doc I have a button or link that runs a command for a function
that is located in the first doc.
I've got it work just fine in FireFox but in the crappy Internet
Explorer it didnt work.
Any solutions? Thanks!
To ilustrate:
doc1.html
doc2.html
Here is thing. I have a document loaded in a browser that has some
javascript functions and it has also a iframe that opens another doc.
In this doc I have a button or link that runs a command for a function
that is located in the first doc.
I've got it work just fine in FireFox but in the crappy Internet
Explorer it didnt work.
Any solutions? Thanks!
To ilustrate:
doc1.html
Code:
<head>
<SCRIPT LANGUAGE="JavaScript"><!--
function myfunc() {
alert('Yes!');
}
//--></SCRIPT>
</head>
<body>
<iframe src=doc2.html></iframe>
</body>
doc2.html
Code:
<head>
<SCRIPT LANGUAGE="JavaScript"><!--
var ie5=(w3c && document.all)? true : false;
function comMain (inner) {
var msgWindow=open('','_top','');
var html_doc =
msgWindow.document.getElementsByTagName('head').item(0);
var js = document.createElement('script');
js.setAttribute('language', 'javascript');
js.setAttribute('type', 'text/javascript');
if (!ie5)
js.innerHTML = inner;
else js.text = inner;
html_doc.appendChild(js); //The error!!!!
}
//--></SCRIPT>
</head>
<body>
<a href=# onclick='comMain("myFunc()")'>click me</a>
</body>