Javascript.RU

Создать новую тему Ответ
 
Опции темы Искать в теме
  #1 (permalink)  
Старый 09.03.2010, 17:05
Новичок на форуме
Отправить личное сообщение для piLL Посмотреть профиль Найти все сообщения от piLL
 
Регистрация: 09.03.2010
Сообщений: 1

Не работает jquery ajax на сервере
Доброго времени суток! Возникла следующая проблема.
Вот этот скрипт почему то не работает на сервере
$(document).ready(function() {
    var imgPoll = new Image();
    imgPoll.src = 'images/red-bar.png';
    $("#btnSubmit").mouseover(function() {
        $("#btnSubmit").css("background-color", "#6699cc")
    });
    $("#btnSubmit").mouseout(function() {
        $("#btnSubmit").css("background-color", "#336699")
    });

    if ($("#divVoted").length > 0) //Already voted
    {
        animateResults();
        $("#ctl00_RightContent_Headertxt").text("РЕЗУЛЬТАТЫ ОПРОСА");
    }

    else {

        $("#rdoPoll0").attr("checked", "checked"); //default select the first Choice
        // Add the page method call as an onclick handler for the Vote button.
        // For more details about how to use JQuery to call Asp.Net AJAX page methods refer follwoing blog posts
        // [url]http://encosia.com/2008/05/29/using-jquery-to-directly-call-aspnet-ajax-page-methods/[/url]
        // [url]http://encosia.com/2008/06/05/3-mistakes-to-avoid-when-using-jquery-with-aspnet-ajax/[/url]
        $("#btnSubmit").click(function() {
            alert('ha-ha');
            $("#divPoll").css("cursor", "wait"); //show wait cursor inside Poll div while processing
            $("#btnSubmit").attr("disabled", "true") //disable the Vote button while processing

            var pID = $("input[id$=hidPollID]").val(); //get Poll ID
            var cID = $("input[name='rdoPoll']:checked").val(); //get the checked Choice
            var data = "{'pID':'" + pID + "', 'cID':'" + cID + "'}"; //create the JSON data to send to server

            $.ajax(
                { //call the Page method using JQuery ajax
                    type: "POST",
                    url: "BudReport.aspx/UpdatePollCount",
                    data: data,
                    contentType: "application/json; charset=utf-8",
                    dataType: "json",
                    success: function(msg)  //show the result
                    {
                        alert(msg.d);
                        $("#ctl00_RightContent_Headertxt").text("РЕЗУЛЬТАТЫ ОПРОСА");
                        $("#divPoll").css("cursor", "default"); //remove the wait cursor
                        $("#btnSubmit").attr("disabled", "false") //enable the Vote button

                        $("div[id$=divAnswers]").fadeOut("fast").html(msg.d).fadeIn("fast", function() { animateResults(); });
                    },
                    Error: function() { alert(msg.d); }
                });
        });
    }

    function animateResults() {
        $("div[id$=divAnswers] img").each(function() {
            var percentage = $(this).attr("val");
            $(this).css({ width: "0%" }).animate({ width: percentage }, 'slow');
        });
    }
});

страница,где должен работать скрипт. И тут же вот этот скрипт тоже почему то не рабатывает(локально работает нормально)
$(document).ready(function() {
    $('caption.month').corner("top");
    $('table.tbl').corner();
    $('td.monthtd').corner("top");

    var a = $('#yan').height();
    var b = $('#feb').height();
    var c = $('#mar').height();
    var row1H = 0;

    if (a > b) {
        if (a > c) {
            row1H = $('#yan').height();
        }
        else {
            row1H = $('#mar').height();
        }
    }
    else {
        if (b > c) {
            row1H = $('#feb').height();
        }
        else {
            row1H = $('#mar').height();
        }
    }
    $('#yan').height(row1H);
    $('#feb').height(row1H);
    $('#mar').height(row1H);

    var d = $('#apr').height();
    var e = $('#mai').height();
    var f = $('#jun').height();

    if (d > e) {
        if (d > f) {
            row1H = $('#apr').height();
        }
        else {
            row1H = $('#jun').height();
        }
    }
    else {
        if (e > f) {
            row1H = $('#mai').height();
        }
        else {
            row1H = $('#jun').height();
        }
    }
    $('#apr').height(row1H);
    $('#mai').height(row1H);
    $('#jun').height(row1H);

    var g = $('#jul').height();
    var i = $('#aug').height();
    var j = $('#sep').height();

    if (g > i) {
        if (g > j) {
            row1H = $('#jul').height();
        }
        else {
            row1H = $('#sep').height();
        }
    }
    else {
        if (i > j) {
            row1H = $('#aug').height();
        }
        else {
            row1H = $('#sep').height();
        }
    }

    $('#jul').height(row1H);
    $('#aug').height(row1H);
    $('#sep').height(row1H);


    var k = $('#oct').height();
    var l = $('#nov').height();
    var m = $('#dec').height();

    if (k > l) {
        if (k > m) {
            row1H = $('#oct').height();
        }
        else {
            row1H = $('#dec').height();
        }
    }
    else {
        if (l > m) {
            row1H = $('#nov').height();
        }
        else {
            row1H = $('#dec').height();
        }
    }

    $('#oct').height(row1H);
    $('#nov').height(row1H);
    $('#dec').height(row1H);
[URL="http://pilotgroup.ru/ActionsCalendar.aspx"]тут[/URL]
});
(при загрузке скрипт определяет большую высоту в строке и привает остальным это значение. Скрипт делает то же самое при изменении размеров страницы-в этом случае ве четко+juqery corners в обоих лучах не срабатывает)

Последний раз редактировалось piLL, 09.03.2010 в 17:12.
Ответить с цитированием
Ответ



Опции темы Искать в теме
Искать в теме:

Расширенный поиск


Похожие темы
Тема Автор Раздел Ответов Последнее сообщение
jQuery Click() не работает на объекте, созданном Ajax vovabigov jQuery 13 09.09.2012 14:25
IE 6, jquery, не работает ajax Прохожый jQuery 3 01.06.2010 17:20
При наборе адреса с www не работает AJAX (JQuery)! madmis AJAX и COMET 3 23.11.2009 19:03
jQuery не так работает на сервере dial jQuery 2 19.11.2009 15:19
Safari + ajax некорректно работает, а в других работает demi AJAX и COMET 35 15.07.2009 14:11