I'm having an annoying problem which I have asked some questions about already, now I finally tracked it down, and I think I'm close to a solution, with your help of course.
I have two JavaScript files, both using jQuery, but only one of them are running. The one working starts with "$(document).ready(function() {.." and works just fine. The other one which does not work starts with "function pageLoad(){..".
The reason to why I need the pageLoad event, is because it's triggered even on async postBacks, but it's not even loaded on non-async post backs? ..
I guess there is some problem in the code which makes it bug, but it works just fine on my local machine, but as soon as it's run on my web-host's server through the Internet, everything in that javascript-file is just not working.
Code:
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")
});
}