This project has moved and is read-only. For the latest updates, please go here.

Button click jquery function is not calling SP services function in CEWP

Feb 17, 2014 at 6:27 AM
Edited Feb 17, 2014 at 6:28 AM
I have call an Sp services function in button click but it is not working here this is my code
function getSkill(){ 
var skill = []; 
operation: "GetListItems", 
listName: "lookup",
CAMLViewFields: "", 
CAMLQuery: "<Query><Where><Eq><FieldRef Name='Title'/><Value Type='Text'>SKILL</Value></Eq></Where></Query>",
async: false, 
completefunc: function (xData, Status) { 
$(xData.responseXML).SPFilterNode("z:row").each(function() { 

source: skill, 
minLength: 2, 
can you please help me.
Feb 17, 2014 at 2:44 PM
What's not working?

Feb 18, 2014 at 3:34 AM
on this click function the getSkill() function is not getting called.. so this not working.
Feb 18, 2014 at 5:22 AM
Are you getting an error? Have you tried debugging by stepping through your code?

You don't have your code wrapped in a $(document).ready(), so the input element may not be in the page yet when it runs.

Feb 18, 2014 at 5:48 AM
ya i have tried using $(document).ready() too, it is not calling the getSkill(), it is not showing any erro msg too.
Feb 18, 2014 at 2:10 PM
Well, your selector for the input element could be wrong, so the click even may never happen. Add an alert in there so that you can be sure it's firing.

Feb 19, 2014 at 12:33 PM
Well i have tried the alert message is not displaying, this function is not getting fire may i know the possible solution...
Feb 19, 2014 at 12:56 PM
You'll need to do some debugging. I'd check the id of the input element and make sure your selector is correct, as I've mentioned above.