国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看

打開(kāi)APP
userphoto
未登錄

開(kāi)通VIP,暢享免費(fèi)電子書(shū)等14項(xiàng)超值服

開(kāi)通VIP
利用JQuery的load函數(shù)動(dòng)態(tài)加載頁(yè)面 - Master HaKu - 博客園
JQuery有好多Ajax函數(shù),其中l(wèi)oad是用來(lái)動(dòng)態(tài)加載一個(gè)頁(yè)面的內(nèi)容到指定的dom元素上。

我們來(lái)做個(gè)例子:
做一個(gè)上下(左右)結(jié)構(gòu)的頁(yè)面,其中下左部分放2個(gè)以前我們做過(guò)的div按鈕,下右部分則為動(dòng)態(tài)加載內(nèi)容。
按每個(gè)按鈕,加載該按鈕相應(yīng)的網(wǎng)頁(yè)內(nèi)容到下右區(qū)域。

基本語(yǔ)法為:
$('#區(qū)域id').load('頁(yè)面名稱(chēng)');

完整的網(wǎng)頁(yè)代碼如下:
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    
<title>JQuery - Load</title>
    
<link rel="stylesheet" media="all" type="text/css" href="../CSS/myStyle.css" />
    
<script type="text/javascript" src="../JsLib/jquery-1.3.2.min.js"></script>//必須,且在某目錄下要存在
    
<script type="text/javascript" src="../JS/basicEffect.js"></script>//必須,且在某目錄下要存在
    
<style type="text/css">
        #header 
{
          margin-bottom
: 1em;
          padding-bottom
: 1em;
          border-bottom
: 1px solid #eee;
        
}
        .buttonListArea 
{
          float
: left;
          width
: 150px;
          padding-right
: 10px;
          border-right
: 1px solid #eee;      
          margin-right
: 10px;
        
}
        .buttonArea 
{
          margin
: 10px;
          padding-bottom
:20px;
        
}
        #load_content 
{
          float
: left;
          width
: 550px;
          text-align
:center;
        
}
    
</style>
    
<script type="text/javascript">
        $(document).ready(
function() {
            $(
'#btnLoad1.button').click(function() {
                $(
'#load_content').load('loadContent1.htm');
            });
            $(
'#btnLoad2.button').click(function() {
                $(
'#load_content').load('loadContent2.htm');
            });
        });
    
</script>
</head>
<body>

<form id="form1" runat="server">

<div id="container">

    
<div id="header">
        
<h2>JQuery Load Example</h2>
    
</div>

    
<div class="buttonListArea">
        
<div class="buttonArea">
            
<div class="button" id="btnLoad1">Load 1</div>
        
</div>
        
        
<div class="buttonArea">
            
<div class="button" id="btnLoad2">Load 2</div>
        
</div>
    
</div>
    
    
<div id="load_content">
        
<h2>這是要被加載的區(qū)域</h2>
    
</div>

</div>

</form>

</body>
</html>
本站僅提供存儲(chǔ)服務(wù),所有內(nèi)容均由用戶(hù)發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊舉報(bào)
打開(kāi)APP,閱讀全文并永久保存 查看更多類(lèi)似文章
猜你喜歡
類(lèi)似文章
jQuery Ajax之load()方法
原生js對(duì)Ajax封裝
load()方法---------jQuery動(dòng)態(tài)加載html
學(xué)習(xí)JQuery的$.Ready()與OnLoad事件比較[轉(zhuǎn)]
jQuery – AJAX load() 方法 | 菜鳥(niǎo)教程
jQuery用iframe來(lái)解決跨域的簡(jiǎn)單示例(1)
更多類(lèi)似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長(zhǎng)圖 關(guān)注 下載文章
綁定賬號(hào)成功
后續(xù)可登錄賬號(hào)暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服