SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Sep 2005
    Posts
    23
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Function to load text from separate file and insert it into page?

    Hi all,

    I have a text file that contains a whole bunch of data points neatly formatted (it's basically a CSV file). I need to create a quick JS function that would load the CSV file (from a URL) and display it with in a page. No parsing is needed! I just need to suck down the file and insert/display it within two div tags.

    How do I do that?

    Thanks!

    Mel

    PS: Yes, I know that this can also be done through PHP but I'd like it to be client side.

  2. #2
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,837
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    It will have to be done server side. There is nothing that runs client side that can access the file to read it.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">


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
  •