Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to check for the parameter passed?
Message
From
07/07/2008 17:44:58
 
General information
Forum:
ASP.NET
Category:
Client-side development
Environment versions
OS:
Windows XP
Database:
MS SQL Server
Miscellaneous
Thread ID:
01329577
Message ID:
01329612
Views:
12
>Somehow I'm still getting the same error, though the line seems to change. I may try to disable JavaScript errors in IE because I believe I'm getting some weird errors I should not be getting.
>
>>>Hi everybody,
>>>
>>>I have a JavaScript function I'd like to call either with one or two parameters. The second parameter is a character string.
>>>
>>>I'm wondering how can I check for the parameter being passed?
>>>
>>>For some reason, check if (MyParameter) produces an error "Object required". I got the same error trying
>>>typeof MyParameter !="undefined".
>>>
>>>How can I test for the second parameter?
>>>
>>>Thanks a lot in advance.
>>
>>I think this should work:
>>
>>
>>function Sample(param)
>>{
>>   if (param == undefined)
>>      alert('No parameter.');
>>   else
>>      alert('Parameter passed: ' + param);
>>}
>>
Try
if (param != null)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform