Trapped on IE Data Island

Discussion in 'Javascript' started by Bishfish, May 26, 2005.

  1. Bishfish

    Bishfish Guest

    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.

    --
    Tony Bishop
    www.bishfish.co.nz
    New Zealand
     
    Bishfish, May 26, 2005
    #1
    1. Advertising

  2. Bishfish

    RobG Guest

    Bishfish wrote:
    > 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>


    --
    Rob
     
    RobG, May 26, 2005
    #2
    1. Advertising

  3. Bishfish

    Bishfish Guest

    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
     
    Bishfish, May 26, 2005
    #3
  4. Bishfish

    RobG Guest

    Bishfish wrote:
    > 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.



    --
    Rob
     
    RobG, May 26, 2005
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Pat Alessi

    Persist data in XML data island

    Pat Alessi, May 25, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    709
    Rick Spiewak
    May 26, 2004
  2. Greg B
    Replies:
    3
    Views:
    875
  3. Replies:
    1
    Views:
    427
    Steve Holden
    Sep 5, 2005
  4. Replies:
    3
    Views:
    416
    Claudio Grondi
    Sep 6, 2005
  5. RichardOnRails

    Undefined local var hash not trapped

    RichardOnRails, Jan 2, 2011, in forum: Ruby
    Replies:
    3
    Views:
    111
    Dhruva Sagar
    Jan 2, 2011
Loading...

Share This Page