views:

87

answers:

3
function abc(a,b,c)
{
    alert('a :'+a+' b:'+ b);
    xyz(c);
}

function xyz(c)
{
   alert('c :' + c);
}


<a href="javascript:abc(1,2,3)" >click here to check value of abc </a>
+4  A: 

This is a wild guess but I think you might want to rename link to something like

<a id='myId'>click here ...</a>

And do the following in jquery

$(document).ready(function(){$('#myId').click(function(){
  abc(1,2,3)})});

Jquery is a javascript framework, not a programming language.

Tim
+1... Fastest gun to you...
beggs
$(document).ready === $
stereofrog
great thanx where can i get jquery basic fundas
sai
+3  A: 

You could fire the event using this:

$(document).ready(function(){$('some-id').click(abc(1, 2, 3))});

function abc(a,b,c) { 
   alert('a :'+a+' b:'+ b);
   xyz(c);
}

function xyz(c) {
   alert('c :' + c);
}

...

<a id="some-id">click here to check value of abc </a>
beggs
That code won't run. Error on first line.
svinto
oops.... fixed.
beggs
+1  A: 

jQuery is a JavaScript library whose purpose is to make some browser scripting tasks easier. It is not a replacement for JavaScript. Don't try to use it for everything.

Also, using onclick is preferable to using the javascript: pseudo-protocol in a link, and you should provide a real URL for the link to take the user when they have JavaScript turned off:

<a href="non_js_alternative.html" onclick="abc(1, 2, 3);">click here to check value of abc </a>
Tim Down