Recover values passed by Jquey on an ASP page

Asked

Viewed 105 times

0

Dear friends,

I am with a big problem, I created a page that loads more values (load more) where I enter values via Jquery and recover in another ASP page through request example:

page_number = Request("page")

View the Jquery code:

$(document).ready(function() {

$("#load_more_button").hide();
$("#load_more_button").delay(2000).fadeIn('fast');

var track_click = 0; //track user click on "load more" button, righ now it is 0 click

var register_per_page = 8;

var total_pages = 3,625;

$('#results').load("links_mais.asp", {'page':track_click, 'reg_per_page':register_per_page}, function() {track_click++;}); //initial data to load

$(".load_more").click(function (e) { //user clicks on button

    $(this).hide(); //hide load more button on click
    $('.animation_image').show(); //show loading image

    if(track_click <= total_pages) //user click number is still less than total pages
    {
        //post page number and load returned data into result element
        $.post('links_mais.asp',{'page': track_click, 'reg_per_page':register_per_page}, function(data) {

            $(".load_more").show(); //bring back load more button

            $("#results").append(data); //append data received from server

            //scroll page smoothly to button id
            $("html, body").animate({scrollTop: $("#ate_aqui").offset().top}, 500);

            //hide loading image
            $('.animation_image').hide(); //hide loading image once data is received

            track_click++; //user click increment on load button

        }).fail(function(xhr, ajaxOptions, thrownError) { //any errors?
            alert(thrownError); //alert with HTTP error
            $(".load_more").show(); //bring back load more button
            $('.animation_image').hide(); //hide loading image once data is received
        });


        if(track_click >= total_pages-1) //compare user click with page number
        {
            //reached end of the page yet? disable load button
            $(".load_more").attr("disabled", "disabled");
        }
     }

    });
});

Watch the lines:

var register_per_page = 8;

var total_pages = 3,625;

These values are passed to the file: links_more.Asp.

On my offline server runs normal, but online no.

Why does this happen? Does anyone know how to say?

Thank you for your attention.

  • 1

    On your online server, you have already tried to access the page links_mais.asp on the server passing the same parameters that the jQuery request passes? What happens?

  • For security reasons the server may not only use Request(). Try using Request.Form of your data is sent via POST, or the Request.QueryString if your donor is sent via GET

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.