WEB xmlhttprequest problem

Discussion in 'OT Technology' started by Krakerjak, Apr 2, 2009.

  1. Krakerjak

    Krakerjak Active Member

    Joined:
    Jul 7, 2003
    Messages:
    8,288
    Likes Received:
    0
    Location:
    Edmonton eh
    So ive been trying to understand the basics of xmlhttprequests by working on a simple yahoo stock quote retrieval form.
    As it is, it works perfectly in IE displaying an alert with the stock price
    ...yet in firefox nothing happens.

    As far as i have been able to research, it seems it boils down to firefox not supporting cross-domain xmlhttprequests for security reasons or something like that.
    Apparently there is a workaround but i can't find it....

    anyone know?



    link to test
    http://forums.mzonics.com/private/uploads/test/ajax1.html

    php file
    Code:
    <?php
    
    //this is the url for retrieving .csv file stock quotes from yahoo
    //explanation of url parameter here: http://www.gummy-stuff.org/Yahoo-data.htm
    
      $fp = @fopen ("http://finance.yahoo.com/d/quotes.csv?s={$_GET['symbol']}&f=nsl1d1hgve1&e=.csv","r");
    
    //this uses the fgetcsv function to store the quote info in the array $data
    //also uses error checking
    
      if ($fp !== FALSE)
      {
          $data = fgetcsv($fp, 1000);
          if ($data !== FALSE && $data[7] == "N/A")
            print($data[2]);
      }
    
    //close the filehandle $fp
      
      fclose ($fp);
    
    ?>
     
  2. Krakerjak

    Krakerjak Active Member

    Joined:
    Jul 7, 2003
    Messages:
    8,288
    Likes Received:
    0
    Location:
    Edmonton eh
    ahh. Gotcha


    so I started looking at the xhtml and realized I had not set an ID, just a NAME to the input field. and of course getElementByID() would not work for ff
    solved
    :o :o :o
    :mad:
     
  3. Ricky

    Ricky █▄ █▄█ █▄ ▀█▄

    Joined:
    Jun 17, 2005
    Messages:
    38,767
    Likes Received:
    6
    you silly billy
     

Share This Page