An exception occurred when Ajax obtained JSON data.

Source: Internet
Author: User

A page in the project needs to obtain order-related information. For Asynchronous interaction, Ajax is used to retrieve data. The background order information is serialized into a string through jsonarray and then returned.

It looks like a normal process, but it suddenly finds that the order number provided by the user cannot be found, and the order number is + 1 or-1. The preliminary check shows that the data is obtained from the database.

The serialization is normal, but after the JSON interface result is formatted by jsonview (a chrome plug-in used to format JSON), + 1 is displayed.

In the case of-1, the order number does not change when you right-click to view the source code. It is inferred that the value has changed when JS obtains the JSON:

13021817070800019 --> 13021817070800020

13021816563900017 --> 13021816563900016

By the way, it was not the maximum value of long. Then, I entered javascript: Alert (13021817070800019) in the browser );

Even the changes in the preview in chrome debugging tools

That's right. The bounce is 13021817070800020. I do not know where the bug is. At present, the order number is processed in strings and used on the homepage. Please forgive me!

If you know what is going on, I 'd like to reply to you.

 

Related Article

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.