Administrators Nathan Posted May 14, 2014 Administrators Share Posted May 14, 2014 Looking for a little help with my first AJAX call I've tried. It keeps telling me the function "mark complete" is not defined but I see it as though it is. My jQuery at top of page: <!--Task jQuery/Ajax Call--> <script> $(document).ready(function markcomplete(taskid,projectid) { $.ajax({ url : 'scripts/submit.php?taskid='+taskid+'&projectid'+projectid+'submittype=7', // give complete url here type : 'post'; }); }); </script> My html/php: echo '<li class="open"> <img onClick="markcomplete('.$projectid.','.$tasks['id'].')" src="images/ico-redx.png" style="margin-left:8px;margin-right:20px;"/>'. $tasks['task_name'].' </li>'; Quote Link to comment Share on other sites More sharing options...
Administrators Nathan Posted May 14, 2014 Author Administrators Share Posted May 14, 2014 <!--Task jQuery/Ajax Call--> <script> function markcomplete(taskid,projectid) { $.ajax({ url : 'scripts/submit.php', // give complete url here type : 'post', data : { taskid : taskid, projectid : projectid, submittype : 7}, success: function (data) { // returns from server on success console.log(data); }, failure: function (error) { // returns here on error console.log(data); } }); } </script> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.