Tag Info

Hot answers tagged

3

You use globals :( whenever you think that you need to use a global you should automatically stop coding and invest as much time as it takes to remove that need. In your case it seems like you assume that global variables persist between Ajax request, but they don't. In addition your design of the code is broken as in client server configuration you can not ...


2

You're sending your AJAX request to the wrong place. Of course calling functions.php directly will get you undefined function errors, because the WordPress API isn't loaded by functions.php ( it's the other way round ). A car doesn't make fuel go forward, fuel makes a car go forward, simply getting in the car won't make fuel magically appear, in the same ...


1

You are going on the wrong way.This will create difficulties and is NOT WORDPRESS STANDARD.Wordpress has a ajax technique to implement this. Call the ajax from your page <script> var data = { 'action': 'insert_data_customtable', 'first_name': firstname, 'last_name': lastname }; // since 2.8 ajaxurl is always defined in the admin header ...


1

I think you are missing the point here about dependency. If the dependency parameter has been set when registering or enqueueing a style or script, that style or script will wait in queue for the style or script it is dependent on to load. This particular script or style will not load until the script or style it is dependant on is fully loaded. Now, if you ...


1

WordPress gets delivered with jQuery. All you have to do is tell your theme to wp_enqueue_script() jQuery: wp_enqueue_script( 'jquery' ); This code belongs into your functions.php. Of course, you can also change which version of jQuery should be loaded, and from which ressource, check this thread for further details. Afterwards you can put your ...



Only top voted, non community-wiki answers of a minimum length are eligible