firefly-david
07-03-2007, 12:55 PM
Hello,
I have a weird problem that can't seem to find a simple solution. I need to create a js file that output our global navigation bar which will be included on our 3rd party websites - cause everytime we update out nav we have to email our partners the new nav. So I would like to have the nav on our servers and the partner sites will just have the script tag on their pages.
So I created a js file that document.write the html for the bar. Within this html there is a script src that does a document.write for our advertisement tag. The problem is the nested doc.write gets outputted after the nav bar. This only happens in IE it works fine in FF and Safari.
Example:
test.html:
<script src="1.js" type="text/javascript" charset="utf-8"></script>
1.js:
document.write('start <script src="2.js" type="text/javascript" charset="utf-8"></script> end');
2.js:
document.write("middle")
In FF and Safari it outputs
"start middle end"
In IE it outputs:\
start endmiddle
I must be missing something but I can't figure it out.
Thanks
I have a weird problem that can't seem to find a simple solution. I need to create a js file that output our global navigation bar which will be included on our 3rd party websites - cause everytime we update out nav we have to email our partners the new nav. So I would like to have the nav on our servers and the partner sites will just have the script tag on their pages.
So I created a js file that document.write the html for the bar. Within this html there is a script src that does a document.write for our advertisement tag. The problem is the nested doc.write gets outputted after the nav bar. This only happens in IE it works fine in FF and Safari.
Example:
test.html:
<script src="1.js" type="text/javascript" charset="utf-8"></script>
1.js:
document.write('start <script src="2.js" type="text/javascript" charset="utf-8"></script> end');
2.js:
document.write("middle")
In FF and Safari it outputs
"start middle end"
In IE it outputs:\
start endmiddle
I must be missing something but I can't figure it out.
Thanks