homepage Welcome to WebmasterWorld Guest from 107.21.163.227
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
Grabbing data from another site
Schoolbag




msg:1476744
 10:37 pm on Dec 29, 2003 (gmt 0)

Im currently using the following code to grab data from a plain text file on another website:

<script src="http://www.blah.com/files/header.txt"></script>

The header.txt file has the following data:

document.writeln('blah blah');

It works correctly BUT, if I have carriage returns in the data file like so:

document.writeln('blah
blah
blah
blah');

tt will not work. Any ideas of a better way to do this? A different javascript?

 

CloudLong




msg:1476745
 11:18 pm on Dec 29, 2003 (gmt 0)

if I understand you correctly, then below must be the solution

document.writeln('blah \
blah \
blah \
blah');

add the "\" will tell them the script continue at new line.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved