溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

jquery的load加載js頁面到指定div中

發(fā)布時(shí)間:2020-07-10 02:15:03 來源:網(wǎng)絡(luò) 閱讀:523 作者:matengbing 欄目:web開發(fā)

4<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'test.jsp' starting page</title>
    
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">    
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="This is my page">
    <!--
    <link rel="stylesheet" type="text/css" href="styles.css">
    -->
    <script src="js/jquery-2.1.1.min.js">
        
    </script>
    <style>
        #div,#div2{
            background-color:#bef3f3;
            width:400px;
            height:300px;
            margin:10px;
            position:relative;
            overflow:hidden;
        }
        #div3,#div4{
            background-color:#bff7f0;
            width:150px;
            height:100px;
            margin:10px;
            position:relative;
            display:inline;
        }
        #div3{
            float:left;
            overflow:hidden;
        }
        #div4{
            float:right;
        }
    </style>
  </head>
 
  <body>
   
    <div id="div">
        <input type="button" value="jquery加載js文件" id="button"><br>
        <input type="button" value="jquery加載下拉框" id="button1"><br>
    </div>
    <div id="div2">
        <div id="div3">
            div3
        </div>
        <div id="div4">
            div4
        </div>
    </div>
  </body>
  <script language="JavaScript">
      $("#button").click(function(){
        $("#div3").load("test2/test3.jsp");
    });
    $("#button1").click(function(){
        $("#div4").load("test2/test2.jsp");
    });
  </script>
</html>
jquery的load加載js頁面到指定div中

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI