W3C home > Mailing lists > Public > www-html@w3.org > May 2000

Re: JHTML: Forgot

From: Pd Rippe <casper@novacentral.com>
Date: Thu, 25 May 2000 16:10:58 -0400
Message-ID: <004701bfc685$579c3bf0$07bc0418@sking1.ri.home.com>
To: "3x" <3x@planet.nl>, "HTML-list" <www-html@w3.org>
Totally forgot...you can do that with Javascript....wait one sec,, here it
is:


<script>
<!--

function GetToken(strSource,strName,cSep){
    var strRet="";
    var iOffset;
    var iEnd;

    if(strSource.length>0){
  iOffset=strSource.indexOf(strName);
        if(iOffset!=-1){
            iOffset+=strName.length+1;
            iEnd=strSource.indexOf(cSep,iOffset);
            if(iEnd==-1){
                iEnd=strSource.length;
            }
            strRet=strSource.substring(iOffset,iEnd);
        }
    }
    return(strRet);
}

// IE4 now supports the location.search.substring property, so allow any
// browser with a version of 4 or more to use it:
window.focus();
if( ( navigator.appName == "Netscape" ) ||
parseInt( navigator.appVersion.substring( 0, 1 ) ) >= 4 ) ) {
    q = location.search.substring(1, location.search.length);
} else {
    var qoffset = document.location.indexOf("?", 0);

    if( qoffset == -1 ) {
 q = "";
    }
    q = document.location.substring(qoffset + 1, document.location.length);
}

 paramID = GetToken(q, "ID" , ",");
 if ( paramID == 1)

window.open("http://www.novacentral.com/dfme/downloadz/CTF_Mission_Pack_1_MA
DDOG.zip",width=10,height=10); go(); }
 else if ( paramID == 2)

window.open("http://www.novacentral.com/dfme/downloadz/CTF_Mission_Pack_2_MA
DDOG.zip",width=10,height=10); go(); }
 else if ( paramID == 3)

window.open("http://www.novacentral.com/dfme/downloadz/dfpackman121.exe",wid
th=5,height=5); go(); }
 else if ( paramID == 4)

window.open("http://www.novacentral.com/dfme/downloadz/dfpackman121.pdf",wid
th=5,height=5); go(); }
 else {
 location.href="http://www.novacentral.com/dfme";
 }
function go() {
history.back()
}
// -->
</script>

Thats the example thats used at my site...i cut down the amount of
dl's...but because im using ASP on the server, i could also do that like
this:

<%
Dim filenum
filenum = Request.QueryString("id")
If filenum = "1" Then
Response.Redirect("http://www.someurl.com/downloadme.zip")
Else
Response.Write("Bad Boy! Try again!")
End If
%>

And you would call this like: http://www.someurl.com/download.asp?id=1
if there were more querystrings, it would look like this:
http://www.someurl.com/download.asp?id=1&file=downloadme.zip
Note the "&" if there are more than one querystrings!!


----- Original Message -----
From: "3x" <3x@planet.nl>
To: "HTML-list" <www-html@w3.org>
Sent: Wednesday, May 24, 2000 5:29 PM
Subject: JHTML


> Somewhere on the web I came across some 'JHTML' pages.
> Does anyone know what the abbriviation stands for and in what respect
these
> pages differ from regular HTML-pages?
>
> I also sometimes see URLs adressing an HTML-page that end with a query,
like
> when a CGI-script is adressed:
>
> www.hostname.com/example.html?x=1&y=2&z=3
>
> Does this mean that it's possible to pass data among HTML-pages in some
way?
> And what kind of data would that be?
>
> Thanks for your help
> Marco
>
Received on Thursday, 25 May 2000 16:14:00 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 27 March 2012 18:15:43 GMT