我遇到了一個惱人的問題,我已經提出了一些問題,現在我終於找到了它,並且我認爲我已經接近解決方案,當然還有您的幫助。爲什麼不執行此功能?
我有兩個JavaScript文件,都使用jQuery,但只有其中一個正在運行。其中一個以「$(document).ready(function(){..」)開頭,工作正常,另一個不工作以「function pageLoad(){..」開頭。
原因爲什麼我需要pageLoad事件,是因爲它甚至在異步postBacks上觸發,但它甚至沒有加載到非異步postback上?
我猜在代碼中存在一些問題,它只要它是通過互聯網我的網絡主機的服務器上運行工作得很好我的本地機器上,但是,一切都在JavaScript的文件只是不工作
代碼:
function pageLoad(){
alert("this does not even show :(");
//var's to be set
var sendPM_pxToBottomWhenAutoScrolling = 140 //
$(".NewConversationTrigger").click(function() {
$("#pm_area_OpenSamtaleID").val(this.id);
$("#pm_area_TriggerOpenSamtale").click();
});
//Auto Scroll system for PM
if ($(".nyPM_SubmitButton").attr("disabled") == true) {
$(".scrollToBottom").attr({ scrollTop: $(".scrollToBottom").attr("scrollHeight") });
}else{
$(".scrollToBottom").animate({ scrollTop: ($(".scrollToBottom").attr("scrollHeight") - $(".scrollToBottom").height() - sendPM_pxToBottomWhenAutoScrolling) }, 1000);
}//Auto Scroll system for PM
//Reciver PM's
$(".SentPM:not(:last-child)").hover(function() {
$(this).children(".PM_Options").show();
}, function() {
$(this).children(".PM_Options").hide();
});//Reciver PM's
$(".RecivedPM").hover(function() {
$(this).children(".PM_Options").show();
}, function() {
$(this).children(".PM_Options").hide();
});//Reciver PM's
//TypeWatch
$("#userlist_area_filterText").typeWatch({ highlight:true, callback:finished });
function finished(txt) { $("#userlist_area_filterSubmit").click() };
$(".updateSamtaleVindue").click(function(){
$("#pm_area_OpenSamtaleID").val(this.id);
$("#pm_area_TriggerOpenSamtale").click();
});
$(".nyPM_SubmitButton").click(function(){
$("#pm_area_SendMessageText").val($(".nyPM_TextArea").val());
$("#pm_area_TriggerSendMessage").click();
$(".nyPM_SubmitButton").attr("disabled","disabled"); $(".nyPM_SubmitButton").val("Din Besked er Sendt");
$(".nyPM_TextArea").attr("readonly", true); $(".nyPM_TextArea").addClass("SentPM_FakeBox")
});
}
這並沒有把戲:( 無論如何,這不會像在本地運行一樣的錯誤在線行爲? – 2010-01-19 14:53:03