How the MUI app interacts with the server

Source: Internet
Author: User

<!DOCTYPE HTML><HTML><Head>    <MetaCharSet= "Utf-8">    <Metaname= "Viewport"content= "Width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />    <title></title>    <Scriptsrc= "Js/mui.min.js"></Script>    <Linkhref= "Css/mui.min.css"rel= "stylesheet"/>    <Scripttype= "Text/javascript"CharSet= "Utf-8">    /*Pre-load other pages in advance so that the loaded pages are ready for good results.*/Mui.init (); </Script></Head><Body><Headerclass= "Mui-bar Mui-bar-nav">    <aclass= "Mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>    <H1class= "Mui-title">Hello</H1></Header><Divclass= "Mui-content">    <Buttontype= "button"ID= "BTN1">Get server-side data</Button></Div>    </Body><Scripttype= "Text/javascript">mui.init (); Mui.plusready (function() {document.getElementById ('BTN1'). AddEventListener ('Tap',function() {mui.ajax ({URL:'http://demo.hcoder.net/index.php', type:'GET', Success:function(data) {mui.toast (data); }, Error:function(Xhr,type,errorthrown) {mui.toast (type);    }        });            });}); Mui.post ('http://server-name/login.php', {username:'username', Password:'Password'    },function(data) {//the server returns the response and, based on the response results, analyzes whether the login was successful;            ...        },'JSON'    ); Mui.get ('http://server-name/list.php', {category:'News'},function(data) {//Get Server Response        ...        },'JSON'    ); Mui.getjson ('http://server-name/list.php', {category:'News'},function(data) {//Get Server Response        ...        } );</Script></HTML>

How the MUI app interacts with the server

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.