SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Enthusiast
    Join Date
    Oct 2004
    Location
    Mexico
    Posts
    58
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Importing external data

    I want to know if Javascript has some kind of include so I can get .txt / csv or XML data from a remote location.

    For example I need to import data from a LAMP site, this LAMPP can use php fwrite to generate a file within that server

    on a different server I want Javascript to load (and reload) the file.
    Alexandro Colorado

  2. #2
    SitePoint Enthusiast
    Join Date
    Oct 2004
    Location
    Mexico
    Posts
    58
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I remember that using actionscript this was possible using the load parameter:
    myxml=new XML()
    myxml.load("textfile.txt")
    myxml.onLoad=parse
    function parse(){
    mytext=myxml.toString()
    }
    actionscript is very similar to javascript however I am not sure if this method is also available here.
    I also google a bit and got a syntax LoadElementbyId() I also found an onload() function
    onload="include('http://www.ourdomain.com/path/filename.txt');"
    Alexandro Colorado


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •