Skip to content

Tag: jquery

The usage of `header(“Content-type:application/json”);`

I just created an JQuery ajax function to retrieve some json-encoded data from PHP, here’s my code : file name : bank.php and in data.php I wrote the question is, when I delete the line of header(“Content-type:application/json”); in data.php the console.log tell that the type of data returne…

Download file with ajax and php – readfile not working

I want to save a value to a txt-file and download it to the user. Right now, the value is being printed into the txt-file correctly, but the readfile function is not triggered, thus no downloading begins. The php, this code is located on the same page as the ajax call. The javascript, there is no url because …

How can I set session variable with JavaScript

By using below code on button click I get the href attribute value, until this everything is fine but when I got my href link on button click we want to store it in the session variable (i.e. var href) because we also use this variable elsewhere. Please suggest me how to store JavaScript variable in session.?…

Open a popup box after receiving result from ajax

i have a ajax code that works properly and gives the desired result. I want to modify this code and want that when a reply is received from ajax a popup/modal box should get opened. I am able to open popup/modal box on a click of a button but don’t know how to open it automatically within ajax. here is

DataTables warning: Non-table node initialisation (TBODY). PHP

I’m trying to use DataTables second time in other PHP Page but I’m stock in this error, DataTables warning: Non-table node initialisation (TBODY). What did i do wrong? i tried this code with my first PHP Page and its working fine. Here is my Code for Table And I’m using this for JQUERY Answe…