This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Servlets and the fly likes cending the contents of a text file to a javascript array Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "cending the contents of a text file to a javascript array" Watch "cending the contents of a text file to a javascript array" New topic
Author

cending the contents of a text file to a javascript array

David McHugh
Greenhorn

Joined: Oct 01, 2008
Posts: 23
hi all,

not usre if i am in the right area for this one, but the servlet is the starting point!!

i need to use a javascript sort function to sort array values, i am going to use the split function to seperate each set of values.

What my main question is how do i send the whole text file contents to the browser to populate the array, i do not need the contents displaying, just to poulate the array, then i will use the javascript sort function.

i currently use a standard println to print vaues to the screen but now i need javascript to handle all the processing, hope this makes sense? but the values must come from the text file not the client side, e.g. static or form values.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60774
    
  65

You can format the page any way you want, including creating JavaScript variables to hold data.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: cending the contents of a text file to a javascript array
 
Similar Threads
adding values in the textbox and put total in same
using arrays in XSL ??
Dependent drop down boxes with javascript
please help me to pass form bean values to the script function
Problem in sequence of actions in JSP