PDA

View Full Version : how to call an function with i a javascript function



msg2ajay
08-02-2007, 04:24 AM
hi,






<html>
<head>
<script language="javascript">
function domyAction(){
onemoreAction('arg1,arg2,arg3,arg4'); //-------> this described in .js file }
</script>
</head>
<body>
<select onchange="domyAction()">
<option value ="volvo">Volvo</option>
<option value ="saab">Saab</option>
<option value ="opel">Opel</option>
<option value ="audi">Audi</option>
</select>
</body>
</html>

jscheuer1
08-02-2007, 05:42 AM
<script language="javascript">
function domyAction(){
onemoreAction('arg1,arg2,arg3,arg4'); //-------> this described in .js file }
</script>

This will do nothing because:

a ) The closing brace for the containing function is after a comment delimiter.

b ) All well and good that the function within the function is described elsewhere, but you show no link to or any other evidence of that 'elsewhere'.

c ) 'arg1,arg2,arg3,arg4' is only one parameter. It should be either:

'arg1',arg2','arg3','arg4'

or:

arg1,arg2,arg3,arg4

or some combination. With the quotes, the arguments are literals, without them they are variable values.

msg2ajay
08-02-2007, 06:19 AM
hi,


-----------> 'arg1',arg2','arg3','arg4'