开发者

How to convert an AJAX error code generated at runtime into a php variable for analysis

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

  1. Capture the error number in javascript variable.
  2. Make an AJAX request, sending this variable in the data.
  3. Process the request in your PHP file.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜