Click to See Complete Forum and Search --> : Ampersands and Files


benfaust
06-28-2003, 08:57 AM
I have two questions to which I have been unable to find satisfactory answers. Thought maybe someone here could help.

1. I'm trying to use JavaScript to go to a URL that has an apersand (&) in it, but it keeps changing the character to &amp (or something like that). Are there special characters in which I can enclose the string which will keep JavaScript from changing or "interpreting" anything in it?

2. Is there some simple way to grab the contents of a file (preferably on a different server) into a variable?

Thanks,
-Ben

Khalid Ali
06-28-2003, 09:22 AM
naswer to your first question?
JavaScript should not make any changes to the url that you are not asking for,however if there is an empty space in between 2 values that will be replaced by %20
and if you want that space to be retained in the url
you can use escape(url)

Answer to your second question is No,
JavaScript does not have the built in functionality to process files from a system/server,you may have work arounds by using Java Applets or MS ActiveXControls..