Simple record that $. getJSON does not execute at a time. getjson execution record

Source: Internet
Author: User

Simple record that $. getJSON does not execute at a time. getjson execution record

When someone else's code is called, it finds that the modification function cannot be used. When the modification is made, json is sent through ajax to obtain the data. The chrome developer tool finds that data is sent and the return value is returned;

Initiate a request and obtain data. The callback function is not executed!

$.getJSON(site_url+'?m=test&a=getOne',{id:id},function(d){  if(d.status){    vardata=d.data;    $('input[name="id"]').val(data.id);    $('input[name="name"]').val(data.name);  }else{    Message.fairue(d.info);    setTimeout(function(){      // todo    },2000);  }});

Php return data code:

if($findOne){  $this->ajaxReturn($findOne,'success',true);}else{  $this->ajaxReturn($findOne,'faild',false);}

The returned data also looks normal in the browser:

{"Data": {"id": "1", "name": "admin",}, "info": "success", "status": true}

Adjusted for half a day...

Some people say it is a json format problem, some say it is a parameter problem, and I am not familiar with js. After troubleshooting, I will eliminate it one by one...

Paste the json data returned by the browser to vim and find that:

<Feff> {"data": {"id": "1", "name": "admin",}, "info": "success", "status ": true}

<Feff> ??? Bomb...

Attachment: vi bomb operation:

# Add BOM: set bomb # Delete BOM: set nobomb # query BOM: set bomb?

Find all files in the current directory that contain bomb:

grep -I -r -l $'\xEF\xBB\xBF' ./

The final result is that/Conf/config. php has bomb, which is modified...

Project framework: ThinkPHP

The simple record of $. getJSON not executed in the preceding section is all the content shared by Alibaba Cloud. I hope you can give us a reference and support for the customer's house.

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.