Mark One
10-09-2005, 01:21 AM
Guys,
Would really appreciate some help here from anyone in the know.
I am hosting an online bible. Problem is, the chapter & verse entries are added using a document.write script that is fine in Firefox but is crashing IE.
The script is simple but I can't for the life of me work out what's going wrong (I'm a humble coder with little knowledge of JS).
Can anyone give me a clue as to what's going wrong or even better post a fix? The alternative is to go through thousands of lines of code updating them manually & much as I am happy to host the Bible for a friend, life is too short.
Many, many thanks to anyone who can help me out here.
Here's the offending script -
HTML page code:
In the header a link to external JS file:
----------------------------------------
<script src="web.js" type="text/javascript"></script>
----------------------------------------
In the page body the script that writes the appropriate chapter & verse:
----------------------------------------
<script type="text/javascript">cb(1,1);</script>In the beginning God
created the heaven and the earth. <script
type="text/javascript">cb(1,2);</script>And the earth was without form etc. etc.
----------------------------------------
In the external file web.js:
----------------------------------------
function cb(chapter, verse)
{ /* Write a chapter-verse marker */
document.write("</span> <a name=\"C"+chapter+"V"+verse+"\" class=\"cv\">"+chapter+":"+verse+"</a> <span class=\"b\">");
}
----------------------------------------
Would really appreciate some help here from anyone in the know.
I am hosting an online bible. Problem is, the chapter & verse entries are added using a document.write script that is fine in Firefox but is crashing IE.
The script is simple but I can't for the life of me work out what's going wrong (I'm a humble coder with little knowledge of JS).
Can anyone give me a clue as to what's going wrong or even better post a fix? The alternative is to go through thousands of lines of code updating them manually & much as I am happy to host the Bible for a friend, life is too short.
Many, many thanks to anyone who can help me out here.
Here's the offending script -
HTML page code:
In the header a link to external JS file:
----------------------------------------
<script src="web.js" type="text/javascript"></script>
----------------------------------------
In the page body the script that writes the appropriate chapter & verse:
----------------------------------------
<script type="text/javascript">cb(1,1);</script>In the beginning God
created the heaven and the earth. <script
type="text/javascript">cb(1,2);</script>And the earth was without form etc. etc.
----------------------------------------
In the external file web.js:
----------------------------------------
function cb(chapter, verse)
{ /* Write a chapter-verse marker */
document.write("</span> <a name=\"C"+chapter+"V"+verse+"\" class=\"cv\">"+chapter+":"+verse+"</a> <span class=\"b\">");
}
----------------------------------------