I am using an ajax function in my c开发者_如何学运维ode. If an error occurs a div shows the error number. I need this error value for a further database query on same page. How can this be done?
You need to send the value to the PHP file you're using to process those values.
To do this asynchronously, use $.ajax()
or one of it's simpler $.post()
or $.get()
siblings.
So, your workflow will be
- Capture the error number in javascript variable.
- Make an AJAX request, sending this variable in the
data
. - Process the request in your PHP file.
精彩评论