使用Rexsee、Jquery、PHP開發行動裝置 App中的資料互動有關問題

來源:互聯網
上載者:User
使用Rexsee、Jquery、PHP開發行動裝置 App中的資料互動問題

?

Rexsee社區的一篇經驗貼,轉過來,主要是介紹資料互動這一塊的實現,共同學習:

?

在開發某移動銷售產品時,使用者要求通過WebService調用進行資料互動。使用Rexsee,Jquery-mobile,PHP,WebService幾種開發工具可以做到裝置調用完成照片、定位等功能,使用Juqery-mobile開發介面,使用PHP+SOAP完成資料庫及Webservice的資料互動功能,通過JSON使用PHP將返回資料封裝後再返回到前端,這樣就做到了資料的非同步互動,而且返回結果標準統一,可用性強。下面通過幾個例子介紹一下:

登入頁面:

?

?

     移動銷售        
?

?

以上頁面通過Jquery-mobile顯示一個登入頁面,點擊提交後非同步呼叫func_sap函數完成WebSerivce調用及返回,返回資料以JSON形式,通過javascript的json函數將資料提取並處理。

func_soap.php檔案 $phone); $objectresult = $soap_client->AgetShop($param);$simpleresult = $objectresult->AgetShopResult; $obj = simplexml_load_string($simpleresult);$obj->Shop[0]->addChild("oper", "getshop");$json = json_encode($obj);$array = json_decode($json,TRUE); $_SESSION['shopno']= $array["Shop"]['shopno'];$_SESSION['phone']=$phone;return $json;}//調用函數header("Content-Type:text/html;charset=utf-8");$moper=$_POST['oper']; if ($moper=="getshop"){$mresult=getshop($muname);echo $mresult;}?>

?原文連結:http://www.rexsee.com/CN/bbs/thread/2012-04-29/556.html

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    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.