Welcome to Dream.In.Code
Click Here
Getting Help is Easy!

Join 118,589 Programmers for FREE! Ask your question and get quick answers from experts. There are 826 online right now! We've got more than 500 tutorials and 2,000 snippets. Join and find out why Dream.In.Code is the #1 programming help community on the internet! Registration is fast and FREE... Join Now!



Javascript variables.

 
Reply to this topicStart new topic

Javascript variables., Help me? :D

kevinawad
post 22 Jul, 2008 - 07:01 AM
Post #1


New D.I.C Head

*
Joined: 21 Jul, 2008
Posts: 3

It's been 3 days im trying to make it work.


I need a way in javascript to load variables from a text file.

Let's say...in the text file, it write Name = "...."

It will load the Name variable.
Then, i can use the variable.
I need it for a website.

Thank you.

If anyone can help me, that'll be great.
User is offlineProfile CardPM

Go to the top of the page


BetaWar
post 22 Jul, 2008 - 10:34 AM
Post #2


#include <soul.h>

Group Icon
Joined: 7 Sep, 2006
Posts: 1,669



Thanked 64 times

Dream Kudos: 1075
My Contributions


I would suggest not worrying about getting it in a text file (if you do you will havde to use ajax then evaluate the returned value (which means people can put javascript in the text file and make your site do things it isn't supposed to)).

I would suggest creating a new javascript file (.js) and placing all the variables in that then linking to it. It takes out the need for ajax or evaling the returned data.

Here is an example of how to link the js file:

CODE
<script src='example.js' language="javascript"></script>
User is online!Profile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 10/11/08 07:43PM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month