Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/74.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery 将外部html作为内联html导入_Jquery - Fatal编程技术网

Jquery 将外部html作为内联html导入

Jquery 将外部html作为内联html导入,jquery,Jquery,我有一个html页面,包含 <div id="recoverpass"> <h2>Recover Password</h2> <form action="#" method="post" name="recoverpass"> <p><label> Enter E-Mail Address: </label> <input type="text" name="email" i

我有一个html页面,包含

<div id="recoverpass">
    <h2>Recover Password</h2>
    <form action="#" method="post" name="recoverpass">
        <p><label> Enter E-Mail Address: </label> <input type="text" name="email" id="name" /></p>
        <input type="submit" value="Recover Password" />
    </form>
</div>
<div id="registernew">
        <h2>Register New User</h2>
        <form action="#" method="post" name="recoverpass">
            <p><label> Enter E-Mail Address: </label> <input type="text" name="email" id="name" /></p>
            <input type="submit" value="Recover Password" />
        </form>
</div>

恢复密码
输入电子邮件地址:

注册新用户 输入电子邮件地址:

在我的index.html页面中,单击相应链接时会加载一个弹出窗口。我想要的是,当忘记密码弹出窗口被加载时,它应该从sth.html导入html,然后是recoverpass'div'的内容。当注册弹出窗口加载时,它应该从sth.html导入html,然后再导入registernew'div'的内容。

易于处理

$("#popup").load("sth.html #recoverpass");
$("#popup").load("sth.html #registernew");