【小(xiǎo)編推薦】apicloud遠(y←₩λuǎn)程頁面api方法

2019-01-10   |&<<nbsp;  發布者: &nλ£®bsp; |   ©σ∏&;查看(kàn):3320次

前端開(kāi)發

APP內(nèi):    we≥±←b.html 內(nèi)寫好(hǎo)的(dσ‌λe)函數(shù)setTitle(),這¶↕(zhè)個(gè)web.html 的(de)窗(chuāng§♣)口名稱是(shì) web

/*

* 設置頁面标題

*/

function setTitle(str,openStatus){

    $api.html($ap¶₽i.byId('pageName'),str); // §λδ♦未檢查數(shù)據安全性,未過濾特殊字符,注意XS✘​S

}

服務器(qì)上(shàng):    tar  Ωγget.html 內(nèi)把這(zhè)β•✔↕代碼放(fàng)在頁面最後面

apiready = function(){

    api.execScripγαt({

     &nbδ≥★sp;  name: &#$ Ω±39;web',

        s>↓™cript: 'setTitle("我是(shì)新标題&q♠↑™uot;);'

    });

};

注意:    &nb¶‌→sp;name  :  we•©$b  不(bù)是(shì)  ope™‌nframe的(de) 名字,而是(sh₽☆©‌ì)   APP當前頁面  <←λ 本身(shēn)的(de)  naε∞me。