在手风琴中加载其他页面和在表格中加载其他的页面有写类似的,就是请求另外一个页面显示数据。
1.先看看引用的资源文件
<link rel="stylesheet" href="jquery-easyui-1.3.5/themes/default/easyui.css" /> <link rel="stylesheet" href="jquery-easyui-1.3.5/themes/icon.css" /> <link rel="stylesheet" href="jquery-easyui-1.3.5/demo/demo.css" /> <script type="text/javascript" src="jquery-easyui-1.3.5/jquery.min.js"></script> <script type="text/javascript" src="jquery-easyui-1.3.5/jquery.easyui.min.js"></script>
还是没有什么的变化2个js文件和三个css文件。
2.再看看html代码
<body> <h2>Loading Accordion Content with AJAX</h2> <div class="demo-info"> <div class="demo-tip icon-tip"></div> <div>Click AJAX panel header to load content via AJAX.</div> </div> <div style="margin:10px 0;"></div> <div class="easyui-accordion" style="width:500px;height:300px;"> <div title="About" data-options="iconCls:‘icon-ok‘" style="overflow:auto;padding:10px;"> <h3 style="color:#0099FF;">Accordion for jQuery</h3> <p>Accordion is a part of easyui framework for jQuery. It lets you define your accordion component on web page more easily.</p> </div> <div title="Help" data-options="iconCls:‘icon-help‘" style="padding:10px;"> <p>The accordion allows you to provide multiple panels and display one at a time. Each panel has built-in support for expanding and collapsing. Clicking on a panel header to expand or collapse that panel body. The panel content can be loaded via ajax by specifying a ‘href‘ property. Users can define a panel to be selected. If it is not specified, then the first panel is taken by default.</p> </div> <div title="Ajax" data-options="href:‘_content.html‘" style="padding:10px"> </div> </div> </body>
在表格中就是data-options="href:‘_content.html‘"这一句起作用的,这个和上面一篇中用到的html文件是同一个的。
看看效果
可以看到这个请求是get请求。
这一片文章中也没有包含多少内容,下面的笔记中将包含好几2至3个例子。