• MUI跨域请求数据的例子:


                <ul class="mui-table-view" style="margin-top: 25px;">
                    <li class="mui-table-view-cell">
                        <id="about" class="mui-navigate-right">
                            关于mui
                        </a>
                    </li>
                </ul>


            document.getElementById("about").addEventListener('tap'function() {
                fGetData();
            }); 

                需要严格按照下面的格式,请求的字段写在data里头,url后头需要加上?jsoncallback=?
            function fGetData() { //请求数据
                alert('start get data');
                mui.ajax({
                    type"get",
                    url"http://115.28.18.116:8089/?jsoncallback=?",
                    asynctrue,
                    data{
                        cid3,
                        key'Instant'
                    },
                    dataType"jsonp",
                    jsonp"jsoncallback",
                    timeout1000,
                    successfunction(data) {
                        alert(data);
                        var vData JSON.stringify(data);
                        alert(vData);
                    },
                    errorfunction(xhrtypeerrorThrown) {
                        plus.nativeUI.toast(errorThrown);
                    }
                });
            } 

    好了,本次教程到此结束,转载请保留原作者地址以及姓名(本人无偿分享经验,有偿接单制作APP,有需要可以联系我。);

    作者:南宫萧尘  
    E-mail:314791147@qq.com
    日期:2016-04-03
  • 相关阅读:
    HDU 4221 Greedy?(贪心)
    HDU 3400 Line belt (三分法)
    POJ 1026 Cipher(置换)
    POJ 1166 The Clocks(暴搜)
    HDU 4122 Alice's mooncake shop(RMQ,或者单调队列)
    POJ 1721 CARDS(置换)
    POJ 3270 Cow Sorting(置换)
    高斯消元法(模板)
    http://blog.seirsoft.com
    转载 STL容器的erase用法
  • 原文地址:https://www.cnblogs.com/nangong/p/37be446c31dd50b20338179c16465d1c.html
Copyright © 2020-2023  润新知