This json format is correct, but the callback function cannot execute the solution.

Source: Internet
Author: User
This json format is correct, but the callback function cannot execute [{id: 4, type_name: Galaxy & nbsp; Note2, sid: v4}, {id: 12, type_name: ascend & nbsp; P6, sid: v12}] this is the data in the generated json format. the format is correct. The json format of adding Model function & nbsp; show_m is correct, however, the callback function cannot be executed.

[{"id":"4","type_name":"Galaxy Note2","sid":"v4"},{"id":"12","type_name":"Ascend P6","sid":"v12"}]

This is the data in json format generated. the format is correct.


// Add models
Function show_mobiletype (modelid, id ){
$. GetJSON ("? M = content & c = content & a = mobile_getjson_ids & modelid = "+ modelid +" & id = "+ id, function (json ){
Alert (json );
Var newrelation_ids = '';
If (json = null ){
Alert ('No related articles added ');
Return false;
}
$. Each (json, function (I, n ){
Newrelation_ids + ="
  • · "+ N. type_name +"
  • ";
    });

    (('{Lele_type_text'{.html (newrelation_ids );
    });
    }


    However, the callback function is not executed.
    ------ Solution --------------------
    Alert (newrelation_ids );

    No problem. check other places
    Whether it is the impact of the BOM header should also be considered
    ------ Solution --------------------
    That's because you didn't call the method according to the rules.

    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.