How to call php function which is inside a class (external file) from jquery? -


in php script @ top have require_once('../registration/include/membersite_config.php'); wich class site functions. class called fgmembersite. there function inside normaly call $fgmembersite->stats have call jquery function.

in same php script have jquery code:

$('a.slick-toggle').click(function(){       var the_id = $(this).attr('href');       var div_id = $('#job_' + the_id);       if ($(div_id).is(":visible")==false) {       //here put ajax call       }       $(div_id).toggle(400);       return false;     }); 

i want call stats() function form jquery code when condition trigered, function inside class wich loaded requiere_once top.

normaly when make ajax call pass parameters via post function writen in other php file using example: $.ajax({ url: 'addremovelive.php', data: {addname: val,addlevel: val1}, type: 'post',success: function(d) {$('#add_lang_level').val('');$('#add_lang').val('');}});

using method means have change struture in class in order respond post call. there method call function using jquery/ajax?

thanks orientation!

you can't call methods/functions or jquery directly. can trigger required method post/get variable jquery. means have add did before post call file functions , yes - change method gets triggered post/get variable included in call.


Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -