Ajaxform or ajaxpost, causing Echo/var_dump to interrupt the operation of the PHP program?

Source: Internet
Author: User
A very strange thing, the page has a link xxx, using AJAX, click to go to the controller in the thinkphp, I added the controller inside Echo or var_dump want to see some parameter values, the results are not executed, the page will not jump. Remove the echo or Var_dump and the execution succeeds.

Do not understand why, is the implementation process can not be interrupted?

If it's Ajax-led, how can I look at the data in the controller?

Reply content:

A very strange thing, the page has a link xxx, using AJAX, click to go to the controller in the thinkphp, I added the controller inside Echo or var_dump want to see some parameter values, the results are not executed, the page will not jump. Remove the echo or Var_dump and the execution succeeds.

Do not understand why, is the implementation process can not be interrupted?

If it's Ajax-led, how can I look at the data in the controller?

No, it won't.

No, it won't.

This is related to your handling of the returned results in Ajax.

echo output.

Currently do not know your page code, if the AJAX request controller, then the problem should be you echo the content, resulting in the return is not the JSON format information, the page can not be processed, so there is no response

Will, Ajax debugging recommended with firephp or Socketlog

Will not continue debug

The content of the echo output causes JSON to not parse properly.

Ajax with the JSON type, so echo will break the JSON format, resulting in JS parsing can not parse, in fact, there is data returned, you can open the browser "element review" is the developer tool grab package to see the response

Not at all. Should be a problem with the data format.

Estimate is the reason that the landlord uses Ajax, because no echo data, the return of the data is normal, jump is also in success success after the jump, and Echo, the returned data is not normal, did not perform a jump

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.