簡體   English   中英

如何獲取javascript以獲取打開另一個html頁面的按鈕?

[英]How do I get javascript to get a button to open another html page?

     First I must apologize Halnex for calling you Helix this whole time. I attempted to try your code but I am not getting my submit page to show up and I’m not completely sure why. Note I just copied the source code of JQuery to a file inside of one of my folders inside the folder holding these html pages.

<!DOCTYPE HTML>
<html>
    <HEAD>
        <title>WELCOME TO MY FORM PAGE</title>
<link rel="stylesheet type="text/css" href="style/style.css"> 
            <script src="jquery-1.12.4.min.js"></script>
            <script type="text/javascript">
                $(document).ready(function (){

                $('#button1').click(function (){

                    $('#response').load('form_submit.html');    
                    });
                });
            </script>
    </HEAD>
<BODY>

只是兩個文本框,沒什么特別的。

報名

用戶名:
密碼:
我不確定這兩行是否正確。 輸入行是否應該包裝div或類似的東西?

 Maybe my issue is with my code on my file I'm trying to load (form_submit.html)? This is all I have on my form_submit.html file: Does this code below for the submission page look acceptable or could this be where I am failing? <!DOCTYPE HTML> <html> <head> <title>User Submission Page</title> </head> <body> Here are the details of the submitted form: </body> </html> 

如前所述,您的按鈕正在嘗試提交表單。 要加載按鈕上的html頁面,請使用它。

<input type="button" id="button1" value="Load HTML Page">

<div id="response"></div>

jQuery的

$(document).ready(function() {
    $('#button1').click(function() {
        $('#response').load('test.html');
    });
});

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM