Skip to content
Advertisement

Tag: php

how to pass $(this).data() in ajax request

i need to pass $(this).data into success func in ajax. here is my code But $(this).addClass(‘wishlist-comp-saved’); is not working inside success: function(data) {} Answer $(this) will change context when called. When inside of the success: function (data), $(this) is not the same as it was inside of whatever is calling this $.ajax() request. For your issue, you simply have to

Creating an extension js inclusion problem

I am creating a small plugin with JS animation. In my plugin, I created an index.php file for my shortcode, functions.php to call my JS code and a JS file for the animation. Anyway my shortcode works, but not the animation So I called all these files in my console, it seems to tell me that I don’t have an

Receiving data in php via AJAX (inside WordPress)

I have a php function that needs to receive data via AJAX. This is my code: Javascript php The issue is that the searchstring from the AJAX call is not received inside the php function (the received string is empty). Can anybody help me? Answer well your main problem is that none of the data you are sending via ajax

ajax call to delete a server file returns html of current page

I want to use a click to delete eror_log file on server In the code below why I’m getting html of currently viewing page as a response? This happens regardles error_log exists or not I’m expecting empty string as a response aa.php Answer In the code below why I’m getting html of currently viewing page as a response? Because that

JS background with Html text

I have found a js background and now I would like to have this background on all my php files. The problem is that html code goes either under js or behind it. How can I solve this? JS file: Another Php file where I included js: Css for Php file: Answer At the moment the cavas which ‘paints’ the

Advertisement