我已经写了两个函数来控制上单击事件如何正确检查点击事件?
jQuery的
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<title>Classic Online Store</title>
<link rel="stylesheet" type="text/css" href="../css/login-form.css" />
<link rel="stylesheet" type="text/css" href="../css/style.css" />
<link rel="stylesheet" type="text/css" href="../css/nav-menus.css"/>
<!--tabs in the accordion -->
<link rel="stylesheet" type="text/css" href="../css/acard.css"/>
<!-- the template script-->
<script type="text/javascript" src="../js/jquery-1.3.2.min.js"></script>
<!-- side category accordion -->
<script type="text/javascript" src="../js/custom.js"></script>
<script type="text/javascript" src="../js/customlog.js"></script>
<script type="text/javascript" src="sideacardeion/script.js"></script>
<script language="javascript" type="text/javascript">
$('#btn_Run').click(function(e) {
alert("Hello! ShareChiWai.");
});
</script>
</head>
HTML
我这里跑
.....
菜单然后登录fo RM
<?php
if ($_SESSION['Id'] > 0){
echo '<h1>Login Form</h1>
<h2>You have loged in already<br/></h2>
<br />
<h3>Click logout to exit </h3>
<br />
<h3><a href="logout.php"> logout</a></h3>';
} else {
echo ' <h1>Login Form</h1>
<div id="contact_form">
<form name="contact" action="">
<fieldset>
<label for="email" id="email_label"><font color="#FFFFFF">Email</font></label>
<input type="text" name="email" id="email" size="30" value="" class="text-input" />
<label class="error" for="email" id="email_error">This field is required.</label>
<label for="phone" id="phone_label"><font color="#FFFFFF">Password</font></label>
<input type="password" name="phone" id="phone" size="30" value="" class="text-input" />
<label class="error" for="phone" id="phone_error">This field is required.</label>
<input type="button" id="btn_Run" value="Run" />
<br />
</fieldset>
</form>
</div>
';
if (isset($_SESSION['attmpt'])){
$leftlog = $_SESSION['attmpt'] - 4;
echo '<div class="atmpt" id="atmpt"><font color="#FF0000"> You have '.$leftlog.' more chanse(s)</font></div>';
}
}
?>
页
这一个什么都不做的其余部分,
我不知道什么是错我的点击事件函数?你能告诉我如何正确地检查点击事件吗?我已经谷歌所有的jQuery事件控制器,我发现我的第一个功能应该工作正常,但它不。
我没有得到任何错误,并在控制台没有警报,当我点击登录BTN
请帮帮忙,在此先感谢。
它适用于我 –
你包括'jQuery'? – xdazz
第二个例子可能有用,但这是不好的做法。请阅读以下部分结果:https://www.google.com/search?q=Why+is+inline+js+bad%3F – m59