Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6199255
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T04:09:26+00:00 2026-05-24T04:09:26+00:00

Sorry, that I have been posting here so often — I have been doing

  • 0

Sorry, that I have been posting here so often — I have been doing a lot of work and in turn have ran into lots of problems.

The click handler just modifies some global variables and sends those variables off to update the page via Ajax. Here is my Javascript: (please note that the getPosts function is working, but it is not being called on .click() presumably).

if you wish to view the documents in the flesh, go to http://www.ethoma.com/testhome.php and for the php go to http://www.ethoma.com/getposts.php.

var category = "undefined";
var page = 0;
var order="id";

function getPosts(){
            var queryString = "category=" + category + "&page=" + page + "&order=" + order;
            $.ajax({
                url: 'getposts.php',
                data: queryString,
                success: function(data) {
                $('#postcontainer').html(data);
                 }
            });
        }
$(document).ready(function() {
            getPosts();
         });

         setTimeout(getPosts(), 20000);

         $("#all").click(function(){
                category = "etc.";
                getPosts(); 
            });
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T04:09:26+00:00Added an answer on May 24, 2026 at 4:09 am

    Your click is assigned outside the document.ready

    I would do

    $(document).ready(function() {
      getPosts();
      setTimeout(getPosts, 20000); // notice I removed the ()
    
      $("#all").click(function(){
        category = "etc.";
        getPosts(); 
      });
    
    });
    

    Firefox console even tells you one of the errors, except in a very w3schools way 😉

    Error: useless setTimeout call (missing quotes around argument?)
    Source File: http://www.ethoma.com/testhome.php Line: 39

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey, sorry for posting this here, I know that this question better suites into
I ran into an interesting issue today. I have canvas elements that I am
I'm sorry that I have to ask that here, but I haven't found a
I have a signal that blocks SIGINT and basically says Sorry, you can't quit.\n
Sorry the title isn't more help. I have a database of media-file URLs that
Sorry guys! i am so into the code! that i forgot to put the
I have the following situation: There is a windows folder that has been mounted
So I have been working with multiple different MS Access apps at work (about
I'm currently using the following code to scan files that have been uploaded as
I have recently been updating a site so that it looks nearly as good

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.