Skip to content
Advertisement

jQuery ajax parameters not being passed to php as expected

I have the following javaScript code:

JavaScript

And in my php code I have the following (to test values coming accross):

JavaScript

The code as stated above the XLR value from Chrome’s developer tools is blank. If I run with this code instead:

JavaScript

I get:

Warning: Trying to access array offset on value of type null at the statement: $jobId = $parms[“jobID”];

Note: when I get the warning message, javascript executes my success: routine, but the response appears to be null or blank.

I do a similar thing with fetch in another part of the app and it works. I could probably switch to that method, but would like to know why my jQuery call does not work.

Advertisement

Answer

The data option can’t be a function. So this:

JavaScript

should be:

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement