It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming JavaScript Forum

asp to javascript

asp to javascript

Postby fromhell on Wed Aug 13, 2008 2:54 am

hye all, i'm new with javascript thing
can someone show me how to convert the asp code (given below) to javascript..

please help me



Function getID(instring)
if instr(instring,"light") or instr(instring,"lite") then
getID=7
elseif instr(instring,"mix") then
getID=8
fromhell
 
Posts: 4
Joined: Wed Aug 13, 2008 2:51 am

Postby fromhell on Wed Aug 13, 2008 3:35 am

i want this script to get an instring value and match it..and after that assign an id to getID...

i try to write the code to this, but i just got an 'undefined' messagebox

function getID(instring)
{

if (instring.match("era"))
{
getID=8;
}

}

alert(getID("era"))

</script>
fromhell
 
Posts: 4
Joined: Wed Aug 13, 2008 2:51 am


Who is online

Users browsing this forum: No registered users and 3 guests