0

I have a ajax function which calls onclick. Actually it is a pagination function. When i click on the pagination link i am passing start variable to the url.But for me for every ajax call the same start variable appending like this. The following observed in mozilla firebug console.

For first click

http://127.0.0.1/testproj/ajax/pagination.php?start=2

for second call

http://127.0.0.1/testproj/ajax/pagination.php?start=2&start=4 

for third call

url/ajax/pagination.php?start=2&start=4&start=6

But generally it should work like this for every call the only start limit need to be pass to start variable.Below is my ajax pagination function , please suggest me where i am doing wrong/mistakes.

    function getUEOPaginate(start)
    {
    var qstring = "start="+start;
    jQuery.ajax({
        async: false,
        type: 'GET',
        data : qstring,
        url: "ajax/pagination.php",
            success:function(valid_result){                                                    
                 if(valid_result)
                  {
                        jQuery('#paginate_div').html(valid_result);
                  }                 
              }
            });
    }

Please help me in this regard...Any help would be appreciated.

griegs
  • 22,624
  • 33
  • 128
  • 205
user3408779
  • 981
  • 2
  • 19
  • 43

1 Answers1

0
  1. First take URL - document.URL
  2. Append the url with your new query string

    url : document.URL + "&start="+start,

Preejith P
  • 39
  • 1
  • 5
  • sorry , its not working for me eventhough it is adding start=2&start=4 like that – user3408779 Aug 21 '14 at 05:57
  • HI All,I have solved this one by using uri. Previously i am calling this complete url like http://127.0.0.1/proj/ajax/filename.php?start=start. But now i am calling this as /ajax/filename.php?start=start. Thanks for every one. – user3408779 Aug 21 '14 at 06:08