Results 1 to 6 of 6

Thread: passing dynamic gets with javascript for PHP to handle? or other method?

  1. #1
    Join Date
    Feb 2007
    Location
    Colorado, USA
    Posts
    3,716
    Mentioned
    51 Post(s)
    Quoted
    624 Post(s)

    Default passing dynamic gets with javascript for PHP to handle? or other method?

    Hello, I want to pass very simple GET messages with javascript to PHP, that dynamically change as you click them (it is for a limit query)


    anyway I want just like a button and it to send a get to have the pages expand further.. so like it shows 10 of something, and when you click the button it then shows 20 of something (so 10 more) and if it already shows 20, and you click it again, it now shows 30.. etc etc


    http://imgur.com/

    imgur does it kinda.. with just scrolling down, I'd prefer a button. or if there is a way to do it without having to send a $_GET?

    I do have jquery included, so if you have some method that requires jQuery.. that is fine with me. Thanks to anyone that can help
    The only true authority stems from knowledge, not from position.

    You can contact me via matrix protocol: @grats:grats.win or you can email me at the same domain, any user/email address.

  2. #2
    Join Date
    Jan 2007
    Location
    Kansas
    Posts
    3,760
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    The easiest way to do this is to hit a php page with an ajax call ($.ajax from jQuery), you'll probably add the limit as a get parameter like you said, but I would only have it select 10 at a time. So if you already have the first 20 items, make it select 20-30 then send those back in the ajax response (probably best to JSON encode them) and use the javascript to parse and insert the items into the page. That would be the easiest way to do it in my opinion


  3. #3
    Join Date
    Feb 2007
    Location
    Colorado, USA
    Posts
    3,716
    Mentioned
    51 Post(s)
    Quoted
    624 Post(s)

    Default

    Quote Originally Posted by Bobarkinator View Post
    The easiest way to do this is to hit a php page with an ajax call ($.ajax from jQuery), you'll probably add the limit as a get parameter like you said, but I would only have it select 10 at a time. So if you already have the first 20 items, make it select 20-30 then send those back in the ajax response (probably best to JSON encode them) and use the javascript to parse and insert the items into the page. That would be the easiest way to do it in my opinion
    Is there any chance you can show me? I'm horrible with javascript, I know just some pretty basic type things and only ajax I ever did was to grab a mysql query php script to check if a user was already registered type thing.. and even then I copied part of it from stack overflow :P

    I can send you a link to what I want to do and explain it better in PM if you can help out, thanks
    The only true authority stems from knowledge, not from position.

    You can contact me via matrix protocol: @grats:grats.win or you can email me at the same domain, any user/email address.

  4. #4
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    Quote Originally Posted by grats View Post
    Is there any chance you can show me? I'm horrible with javascript, I know just some pretty basic type things and only ajax I ever did was to grab a mysql query php script to check if a user was already registered type thing.. and even then I copied part of it from stack overflow :P

    I can send you a link to what I want to do and explain it better in PM if you can help out, thanks
    http://www.9lessons.info/2009/07/loa...query-php.html

    Replace the scroll function with a button that invokes the last message function or a $("#ButtonID").click(...)
    I am Ggzz..
    Hackintosher

  5. #5
    Join Date
    Feb 2007
    Location
    Colorado, USA
    Posts
    3,716
    Mentioned
    51 Post(s)
    Quoted
    624 Post(s)

    Default

    Quote Originally Posted by Brandon View Post
    http://www.9lessons.info/2009/07/loa...query-php.html

    Replace the scroll function with a button that invokes the last message function or a $("#ButtonID").click(...)
    woo thank you so much, I'll check that out when I wake up

    also totally forgot, youtube comments do exactly what I want to implement (looks like your link will help me do that)

    can't believe I forgot about the youtube comments though, gave imgur as an example rofl
    The only true authority stems from knowledge, not from position.

    You can contact me via matrix protocol: @grats:grats.win or you can email me at the same domain, any user/email address.

  6. #6
    Join Date
    Mar 2019
    Posts
    6
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks for this information. It has helped my to work on my project.
    Dot Net Programming

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •