02 jquery easyui 之 parser解析器

來源:互聯網
上載者:User

標籤:jquery easyui parser解析器

parser 是jquery easyui中的解析器,頁面中class就是用它來渲染。

自動渲染

頁面載入過程:

  1. 先裝載HTML頁面文件項目

  2. 然後調用$().ready(function(){})

  3. 最後調用parser渲染頁面


手動渲染

通過DOM操作輸出HTML(easyui)元素資訊,那easyui頁面不會初始化,只顯示原有的HTML代碼

<script type="text/javascript">$().ready(function(){    document.getElementById("info").innerHTML=‘<div class="easyui-accordion" id="tt"><div title="title1">1</div><div title="title2">2</div></div>‘;});</script></head><body><div  id="info"></div></body>

效果:

650) this.width=650;" src="http://s3.51cto.com/wyfs02/M02/56/BB/wKiom1SLKhiAr5YOAAAKTbdAhko925.jpg" title="QQ20141212235559.jpg" alt="wKiom1SLKhiAr5YOAAAKTbdAhko925.jpg" />

需要手動渲染:在DOM操作後添加

$.parser.parse(‘#info‘); // 解析某個具體節點

或$.parser.parse(); // 解析整個頁面

<script type="text/javascript">$().ready(function(){    document.getElementById("info").innerHTML=‘<div class="easyui-accordion" id="tt"><div title="title1">1</div><div title="title2">2</div></div>‘;    $.parser.parse(‘#info‘); // 解析某個具體節點    //$.parser.parse(); // 解析整個頁面});</script></head><body><div  id="info"></div></body>


效果:

650) this.width=650;" src="http://s3.51cto.com/wyfs02/M00/56/B8/wKioL1SLKuLhus5KAAB7d7QO97g969.jpg" title="QQ20141213014800.jpg" alt="wKioL1SLKuLhus5KAAB7d7QO97g969.jpg" />

本文出自 “老牛Java” 部落格,請務必保留此出處http://liuyj.blog.51cto.com/2340749/1589500

02 jquery easyui 之 parser解析器

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.