大佬教程收集整理的这篇文章主要介绍了javascript – jQuery在url的末尾添加#,即使我返回false;,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
// Called right away after someone clicks on the Vote up link $('.Vote_up').mouseup(function() { $("#loading").show(); var problem_id = $(this).attr("data-problem_id"); Vote(problem_id,1); //Return false to prevent page navigation return false; }); $('.Vote_down').mouseup(function() { $("#loading").show(); problem_id = $(this).attr("data-problem_id"); Vote ( problem_id,-1 ); //Return false to prevent page navigation return false; }); // Global function var Vote = function(problem_id,Vote) { var dataString = 'problem_id=' + problem_id + '&Vote=' + Vote; // The person is actually logged in so lets have him Vote $.ajax({ type: "POST",url: "/auth/check_login.PHP",dataType: "json",success: function(data) { $.ajax({ type: "POST",url: "/problems/Vote.PHP",data: dataString,success: function(html) { $("#loading").hide(); if ( html == "not_logged_in" ) { queue.login = false; //set the current problem id to the one within the dialog $problemId.val(problem_id); // Try to create the popup that asks user to log in. $("#loginpopup").dialog( {title: 'Please Login To Vote'} ); // title: 'Login Dialog' // prevent the default action,e.g.,following a link return false; } else if ( html == "already_Voted" ) { // Display a dialog Box saying that the user already Voted $('<div>You already Voted this way on this problem.</div>').dialog( {title: 'Already Voted'}); // show div which says un-important,hide div which says important $("#support").hide(); $("#dont_support").show(); return false; } else if ( html == "error_getTing_Vote" ) { $('<div />').html('Error getTing exisTing Votes.').dialog(); } else { if ( Vote == -1 ) { $("#support").show(); $("#dont_support").hide(); } else { $("#support").hide(); $("#dont_support").show(); } // Now make a call to AJAX to get the count of Votes $.ajax({ type: "POST",url: "/problems/get_Vote_count.PHP",success: function(html) { var class_name = ".Votes_"+problem_id; $(class_Name).text(html); return false; } }); return false; } },error: function(html) { $("#loading").hide(); return false; } // End of error case }); // Closing inner AJAX call. },error: function(data) { $("#loading").hide(); $("#loginpopup").dialog( {title: 'Please Login To Vote'} ); return false; } // End of error }); // End of outer AJAX. return false; };
以上是大佬教程为你收集整理的javascript – jQuery在url的末尾添加#,即使我返回false;全部内容,希望文章能够帮你解决javascript – jQuery在url的末尾添加#,即使我返回false;所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。