Trapped on IE Data Island

B

Bishfish

I have an XML document containing 400+ quotations, in the format:

quotes
qtnum
title
author
comment
quotes
...400+ more
XML file size 156Kb
The tag <xml id="quotes" src="qtsxml_br.xml"></xml> is on the htm page.
The "quotenum" is obtained from a form on the html page.

The code snippet:
var numOfQuotes = 402; // needs to be changed manually as quotes are added
//numQuotes needs to be global for both functions
function FindQuote()
{

var qutNum = parseInt(quotenum.value);

while (!quotes.recordset.eof)
{
//script is working to this point - it is the next line that is problem
var findNum = quotes.recordset("qtnum");// always bombs out!!
if (findNum.indexof(qtNum) >= 0)
{
ResultHTML +=" ...

I have a "random quote" script that bombs out at the same line.

The page is at http://www.bishfish.co.nz/quotes/fishquotes2.htm if it helps.

Any help would be appreciated, so would pionting me to a cross-browser
script to
get me out of IE's Data Island clutches.
 
R

RobG

Bishfish said:
I have an XML document containing 400+ quotations, in the format:

quotes
qtnum
title
author
comment
quotes
...400+ more
XML file size 156Kb
The tag <xml id="quotes" src="qtsxml_br.xml"></xml> is on the htm page.
The "quotenum" is obtained from a form on the html page.

The code snippet:
var numOfQuotes = 402; // needs to be changed manually as quotes are added
//numQuotes needs to be global for both functions
function FindQuote()
{

var qutNum = parseInt(quotenum.value);

parseInt() should always be used with a radix (I'll presume you want
base 10):

var qutNum = parseInt(quotenum.value, 10);

Some reading:
<URL:http://developer-test.mozilla.org/docs/Core_JavaScript_1.5_Reference:Functions:parseInt>

An alternative is:

var qutNum = +quotenum.value;
while (!quotes.recordset.eof)
{
//script is working to this point - it is the next line that is problem
var findNum = quotes.recordset("qtnum");// always bombs out!!

var findNum = quotes.recordset["qtnum"];

Complete guess as I can't access your site - classified entertainment
for internet monitoring [i.e. blocking!!] purposes.

It is probably more efficient to not initialise findNum on each
iteration:

var findNum;
var qutNum = parseInt(quotenum.value);
while (!quotes.recordset.eof)
findNum = quotes.recordset["qtnum"];
Any help would be appreciated, so would pionting me to a cross-browser
script to
get me out of IE's Data Island clutches.

<URL:http://www.xml.com/pub/a/2005/02/23/sarissa.html>
 
B

Bishfish

Thanks Rob,

will make the changes and do some reading.

Can't understand why you cannot access the site, works this end, maybe try
going in via the home page www.bishfish.co.nz.

Thanks again
 
R

RobG

Bishfish said:
Thanks Rob,

Please quote what you are replying to (there's been a bit of discussion
on that recently ...)

Since you seem to be using a reasonable UA, that should not be
difficult.
will make the changes and do some reading.

Can't understand why you cannot access the site, works this end, maybe try
going in via the home page www.bishfish.co.nz.

from my post:
I can't access your site - classified entertainment for internet
monitoring [i.e. blocking!!] purposes.

In other words, my employer blocks anyone on the network from accessing
sites with certain classifications - your site is classified as
"entertainment", so I can't get access to it.

Presumably I don't need entertainment at work.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top