我正在尝试根据点击的图像显示和隐藏div,因此当您单击resteraunt图像时,它会显示名为members窗口的div.我得到的错误是Uncaught SyntaxError: Unexpected token {.
这是一个单独的JavaScript文件的脚本
$(document).ready(resteraunt(){
$('people').click(function(){
$("memberswindow").show();
});
});
Run Code Online (Sandbox Code Playgroud)
这是HTML
<!DOCTYPE html>
<html>
<head> <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="Wolfeboro_Connection/Scripts/homepage.js"></script>
<script src="Wolfeboro_Connection/Scripts/menu.js"></script>
<link rel='stylesheet' href='Wolfeboro_Connection/CSS/index.css'>
</head>
<body>
<img src="Wolfeboro_Connection/wc.png" id="wc">
<a href='' onclick='resteraunt();'><img src='Wolfeboro_Connection/resteraunt.jpg'
id="resteraunt"></a>
<a href='' onclick='map();'><img src='Wolfeboro_Connection/map.jpg' id="map"></a>
<a href='' onclick='mail();'><img src='Wolfeboro_Connection/mail.jpg' id="mail"></a>
<a href='' onclick='people();'><img src='Wolfeboro_Connection/people.jpg' id="people"></a>
<div id="window"> <div id="memberswindow"> <input type="text" id="username"
placeholder="Username">
<input type="text" id="loginpassword" placeholder="Password">
<input type="text" id="email" placeholder="Email"> </div> </div>
<div id="banner"> <h1> Wolfeboro Connection </h1> </div>
</body>
</html>
Run Code Online (Sandbox Code Playgroud) 我试图发布数据并将其放入msql数据库,但当我把数据放入print_r($ _ POST); 它将数组显示为空.我知道它正确地获得了价值但不发布
<!DOCTYPE html>
<html>
<head> <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="Scripts/menu.js"></script>
<script src="Scripts/signup.js"></script>
<link rel='stylesheet' href='CSS/index.css'>
</head>
<body>
<img src="wc.png" id="wc">
<img src='restaurant.jpg' id="restaurant">
<img src='map.jpg' id="map">
<img src='mail.jpg' id="mail">
<img src='people.jpg' id="people">
<div id="window"> <div id="membersWindow"> <input type="text" id="signupUsername" value="name" placeholder="Username">
<form action="/signup.php" method="post">
<input type="password" id="signupPassword" placeholder="Password">
<input type="text" id="signupEmail" placeholder="Email">
<input type="text" id="signupphoneNumber" placeholder="Phone Number">
<iframe src="useragreement.html" id="userAgreement"> </iframe>
<input type="submit" id="signupSubmit">
</div>
</form>
<div id="restaurantWindow"> Restaurant Window </div>
<!--- <div id="mapWindow"> <iframe src="https://maps.google.com/?ie=UTF8&ll=29.817178,-95.401291&spn=0.689868,1.256561&t=h&z=10&output=embed"></iframe>
</div> ---> …Run Code Online (Sandbox Code Playgroud) 我试图在页面打开时隐藏元素,然后在单击按钮时显示,但它不显示元素.我希望隐藏id extraForm的表单,直到按下按钮
<!DOCTYPE html>
<head>
<script src="Javascripts/jquery.js"></script>
<script type="text/javascript">
$(function () {
$("#extraForm").hide()
});
$('#showForm').click(function(){
$('#extraForm').show();
});
</script>
<link rel='stylesheet' href='website.css'>
</head>
<body>
<form action="submit.php" method="post">
<table> <table border="1"> <tr>
<tr> <td> First Name: </td> <td> <input type="text" name="firstName"> </td> </tr>
<tr> <td> Last Name: </td> <td> <input type="text" name="lastName"> </td> </tr>
<tr> <td> Dorm Name: </td> <td> <input type="text" name="dormName"> </td> </tr>
<tr> <td> Room Number: </td> <td> <input type="text" name="roomNumber"> </td> </tr>
<tr> <td> Pizza Type: </td> <td> …Run Code Online (Sandbox Code Playgroud)