Re: 2 Qs re JS scripting

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Randy Webb wrote:
> Bob Barrows [MVP] said the following on 8/12/2005 6:02 PM:
>> Adrian wrote:
>>
>>> 1. I have an HTML file on a local harddisk and I want to open it
>>> from another local .js file passing it a string for it to read and
>>> display e.g. test.html?this_is/atest so how do I do all of that?!
<snip>
>>
>> You need ASP in order to use a querystring,

This statement is admittedly in error. My head's in the ASP world, so when I
think of displaying something, I tend to think of "response.write"

>> which means you need a
>> web server. You cannot use a querystring in a .htm file, especially
>> one opened from a hard drive without using a web server.
>
> Excuse me? JScript is very well capable of handling a queryString.
>
> var myLoc = document.location.href;
> var queryString = myLoc.split('?');
> if (queryString[1]){alert(queryString[1])}
> else{alert('NO Query String present')}
>
> Why do you need a web server?
>

Could you explain how to open an html file from a hard drive, passing a
dynamic querystring to it without a web server?

Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


.



Relevant Pages

  • Re: 2 Qs re JS scripting
    ... I have an HTML file on a local harddisk and I want to open it from ... You need ASP in order to use a querystring, which means you need a web ... from a hard drive without using a web server. ... This email account is my spam trap so I ...
    (microsoft.public.scripting.jscript)
  • Re: Call a Rexx Script from a Web Page
    ... Put your HTML files in ".\html". ... start "Web server" /min web.exe ... Now you have a web server ready for REXX CGI programming. ... As sample HTML file: ...
    (comp.lang.rexx)
  • Re: Creating and writing in text files
    ... > You got good quality help. ... Are you saying that when the html file is on a web server, ... But if it only works when using the local website (i.e. C:\Documents and ...
    (microsoft.public.scripting.jscript)
  • Re: (OT) PhP For Dummies ...
    ... your web server cannot parse php in a .html file. ... Clue: have a look at ...
    (uk.rec.motorcycles)
  • Re: Blogs, wikis and note-taking apps
    ... This is a portable wiki - it is just an html file with built-in javascript ... stick, or both, or put it on a web server as well. ...
    (Ubuntu)