473,385 Members | 1,620 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Load text from external file?

Hey all,
I was wondering, how could I load text from an external file? It would be located locally on the server, probably in the same file path.

Also, what format could I make the file in, so that the javascript script looks for a user name, and then retrieves an array that corresponds to what the user wants?

I need the javascript file to set a variable that is the same as the one it is looking for (the user's list of stuff), and the write out some stuff in the html document.

Sorry if I'm being a bit unclear.
Dec 20 '07 #1
3 4157
acoder
16,027 Expert Mod 8TB
This is not possible with JavaScript, however you could use Ajax to make a request to a server-side script which loads the file and returns the contents in the response.
Dec 22 '07 #2
dlite922
1,584 Expert 1GB
learn a server side script, like PHP, ASP. probably easier than messing with Ajax at your level.
Dec 23 '07 #3
acoder
16,027 Expert Mod 8TB
learn a server side script, like PHP, ASP. probably easier than messing with Ajax at your level.
Possibly true, but it depends on thetechgeek's requirements, and some server-side code will be required anyway.
Dec 24 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Del | last post by:
I am *NOT* using local at all, just so you know. My webhosting server's stats: MySQL: 4.0.20-standard phpMyAdmin: 2.5.6 Apache: 1.3.31 (Unix) I open phpMyAdmin, choose my 'links'...
2
by: Mark Anderson | last post by:
Problem in short: user is moving (clicking a link) from my page before some JS code is run (to write a cookie). The code does not run (in Body's onLoad event) until the page loads as there are a...
3
by: jason baumunk | last post by:
I author applications in php which use external stylesheets. When viewed through ie 6, netscape 6, et al. occassionally the stylesheets will not load or be applied. Has anybody encountered this...
4
by: Mark Anderson | last post by:
Sorry if this is borderline JS vs. HTML. I ask here as the success/failure if the resulting JS is key. I've a small external .JS library that allows a non code-savvy user to occasionally update...
2
by: jay | last post by:
hi, Question on Load/import command. consider a sample table create table table_name ( col1 timestamp not null default current timestamp, col2 int, col3 int, col4 int, primary key(col1) );...
6
by: bfowlkes | last post by:
Hello, I am trying to parse two pre-formatted text files and write them to a different files formatted in a different way. The story about this is I was hired along with about 20 other people...
19
by: natG | last post by:
On a warehouse app, our Java clients constantly load/insert rows into the db. I would like to throttle these inserts (1.5 million rows per hr) from the Java app, based on current 'busy state' of...
1
by: galivio | last post by:
I need a code in C where accepts inputs coming from an external text file and will give an output stored on another text file. For example, a C program to compute the sum of the two integers. The...
0
by: flaviosemeao | last post by:
Hi guys, I am gonna ask the same question again regarding tweening in text fields. I already read some Adobe documentation and I understood that text field has its property _alpha available just...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.