Check if the entered string is a url

S

S N

How to check if the entered string is a valid url?
Is there a function in asp which is similar to javascript string.isurl

Please advise.

S N
 
E

Evertjan.

S N wrote on 16 mrt 2009 in microsoft.public.inetserver.asp.general:
How to check if the entered string is a valid url?

With ASP, serverside?
Test with Server.xmlhttp methinks.

Or do you mean if the string has characteristicts
that make it impossible to be an url, like absense of http://?
Is there a function in asp which is similar to javascript string.isurl

I am sure that there is no such function in Javascript,
even the syntax does not fit Javascript.

There seems to be a fundamental error in your question.
ASP is not a language, VBscript and Javascript are.
ASP is a serverside platform for languages like VBscript and Javascript.

So there can be no functions in Javascript that are not in ASP.
[unless they are only in a dialect of Javascript]
 
B

Bob Barrows

S said:
How to check if the entered string is a valid url?
Is there a function in asp which is similar to javascript string.isurl
ASP is not a language. it is a "platform" which supports several
scripting languages including vbscript and jscript. See here how to
specify a different language than vbscript to be used in your
server-side code:
http://classicasp.aspfaq.com/general/does-order-matter-when-using-different-languages-in-asp.html

Having said that, I do not believe isurl is a built-in javascript
function (http://www.tneoh.zoneit.com/javascript/js_func.html). You will
likely need to recreate it for your server-side code.
 
S

S N

I want to check
if the string has characteristicts that make it impossible to be an url,
like absense of http://?


Evertjan. said:
S N wrote on 16 mrt 2009 in microsoft.public.inetserver.asp.general:
How to check if the entered string is a valid url?

With ASP, serverside?
Test with Server.xmlhttp methinks.

Or do you mean if the string has characteristicts
that make it impossible to be an url, like absense of http://?
Is there a function in asp which is similar to javascript string.isurl

I am sure that there is no such function in Javascript,
even the syntax does not fit Javascript.

There seems to be a fundamental error in your question.
ASP is not a language, VBscript and Javascript are.
ASP is a serverside platform for languages like VBscript and Javascript.

So there can be no functions in Javascript that are not in ASP.
[unless they are only in a dialect of Javascript]
 
E

Evertjan.

S N wrote on 16 mrt 2009 in microsoft.public.inetserver.asp.general:
Could you please stop toposting and quoting my signature,
this is usenet.

I want to check
if the string has characteristicts that make it impossible to be an
url,
like absense of http://?

Then it seems to be your task to write a function that tests for those
characteristics you want included and excluded. A good task for a newbe.
Under ASP, you can do that in VBscript or Jscript/Javascript, or even in
other scripting languages.

However that does not mean the URL is valid, since it could be that there
is no such url active on the web. Most typing errors fall in the latter
cathegory, methinks.

And perhaps, it would be nice to help the user by adding an absent
http:// in stead of blocking it.
There seems to be a fundamental error in your question.
ASP is not a language, VBscript and Javascript are.
ASP is a serverside platform for languages like VBscript and
Javascript.

So there can be no functions in Javascript that are not in ASP.
[unless they are only in a dialect of Javascript]

Do you understand what I am talking about?
 
A

Adrienne Boswell

How to check if the entered string is a valid url?
Is there a function in asp which is similar to javascript string.isurl

Please advise.

S N

You are going to have to roll your own. I would start with a list of
current TLDs, and read backwards, eg:

example.xyz would not be a valid url because xyz is not a valid TLD.

I wrote a function for this, you can get it at
http://www.cavalcade-of-coding.info/validurl.php
 

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

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top