所以我有這個jQuery腳本,但是當你點擊按鈕時,它並沒有按照它的設想去做。jQuery腳本不工作?
我在不同的按鈕上使用相同的腳本,它的工作原理。
似乎無法找到問題d:
jQuery腳本:
<script type="text/javascript">
$(document).ready(function(){
$("#stop").click(function() {
var host = $("host").val();
if(host != ""){
$("#bootres").html("<p class='box'><img src='http://urgentbooter.com/img/ajax-loader.gif' border='0' alt='' /> Stopping attack...</p>");
$.post("index.php?action=boot",{host:host,port:port,time:time,method:"STOP",submit:"submit2"},function(data){
} else {
alert("The host field must contain the IP to the attack you want to stop!");
$("#host").focus();
}
});
});
</script>
按鈕代碼:
<button type="button" id="stop" class="button red">Stop Attacks</button>
順便說其他的按鈕,它適用於幾乎相同的代碼並在同一頁上。
讓我知道是否需要更多信息!
我的單擊事件處理程序後和VAR主機前行擺正「警報(‘測試’);」當你點擊按鈕時它不起作用,如果有幫助的話。 – user3023566
只是一個提示:嘗試查看您的控制檯中有哪些錯誤。它會告訴你很多關於這種錯誤的信息! felix的答案將解決我認爲的問題! –
它顯示在第98行還有一個意外的標記,這是其他地方說的{alert(「主機字段」....等.. – user3023566