parse URL

  • Thread starter Thread starter fred rosenberg
  • Start date Start date
F

fred rosenberg

hi,

i would like a button in an application i am writing to go out to my web
site and check to see if there is a later application update available.
here is how i think
it needs to be done, but please redirect me if i got this wrong.

I pass a "parameter" in the URL, e.g.
www.abc.com/VersionCheck.htm?userversion=2.0,
and then have the web page parse the URL and compare the user's version with
the
current version.

is this the proper way to do it? any examples of HTML that does this kind
of thing?

(i'm using FP 2003).

thanks!

fred
 
thanks mike,

1. any examples of the logic to get the URL, for instance? (haven't done
much javascript)..
2. are there other ways to do this?

thanks,

fred

--
Fred Rosenberg
Osage Computing Services, Inc.
Creators of "Osage Inside Access"
-- A MultiFunction Developer's Dashboard Featuring Clickable Dependent
Objects
MD Websunlimited said:
Hi Fred,

That will work provide the page VersionsCheck has logic (JavaScript) to
check the version against a table in the page.
 
Here is a javascript function you can use that parses the value out of a querystring

Rhond

function getVersion(

//get the version from the querystring.

var sVersion = new Object()
var querystring = location.href.substring(1)
var qs = querystring.split("?");
for(var i = 0; i < qs.length; i++)
var pos = qs.indexOf('=');
if (pos == -1) continue;
var argname = qs.substring(0,pos);
var value = qs.substring(pos+1);
sVersion[argname] = unescape(value);

if ((sVersion[argname] == "") || (qs.length == 1)

return "MAP"

els

return sVersion[argname]
 
OOps. Forgot to change one line before posting. This is a function I have used in one of apps and I changed to reflect the version. My default value that I was looking for happened to "MAP" you probably want your default value to be a certain version number. This code only gets executes in the case where the address gets executed with a blank querysting. So if someone went to www.abc.com/VersionCheck.htm for insance without the ?useversion=2.0 on it. Make sense

Rhond

function getVersion(

//get the version from the querystring.

var sVersion = new Object()
var querystring = location.href.substring(1)
var qs = querystring.split("?");
for(var i = 0; i < qs.length; i++)
var pos = qs.indexOf('=');
if (pos == -1) continue;
var argname = qs.substring(0,pos);
var value = qs.substring(pos+1);
sVersion[argname] = unescape(value);

if ((sVersion[argname] == "") || (qs.length == 1)

return "1.0"

els

return sVersion[argname]
 
thank you skydolphin!

i think this outght to do it. i won't be able to work on this for a few
days, though.

thanks again.

fred

--
Fred Rosenberg
Osage Computing Services, Inc.
Creators of "Osage Inside Access"
-- A MultiFunction Developer's Dashboard Featuring Clickable Dependent
Objects
Skydolphin said:
Just to add another note. Inside your html you would need to execute that
function. Like on the onload event of the page.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top