Mangler wrote on 02 jan 2007 in microsoft.public.inetserver.asp.general:
Quote:
>
Evertjan. wrote: Quote:
>so you are making a series of clientsided functions all called
>>
>Add()
>>
| >
One more thing to add, the functions are different.
>
function Add(<%=i%>)
|
Please first forget about the ASP part and try to build a clientside
javascript code that is legal and working.
Quote:
With the loop gives a list a fuctions like
>
Add(3)
Add(4)
Add(6)
Etc....
|
No these are not different functions,
they are seperate calls executing one and the same function.
Quote:
|
Be easy on me here, I barely know what I am doing with functions.
|
The statement word "function" starts the definition of a function.
function Add(7) {alert('hello');};
is illegal/not working, because in the parameter field, only variable
names are allowed, that can be filled with a litteral value or a variable
or a script that results in such value.
Example of a correct functions:
<script type='text/javascript'>
function add7(x) {
return x + 7;
};
alert( add7(3) ); // this will alert with the value "10"
alert( add7('hi ') ); // this will alert with the valie "hi 7"
// ----------------------------
function add(x,y) {
return x + y;
};
alert( add(15,25) ); // this will alert with the value "40"
</script>
======================
Again: please be proficient with clientside javascript,
before you go using Serverside script [eiter ASP-vbs or ASP-
js]
into the clientside script.
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)