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 892761
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T14:06:38+00:00 2026-05-15T14:06:38+00:00

I am using jquery(newbie for jquery) in my application. In short what I am

  • 0

I am using jquery(newbie for jquery) in my application. In short what I am doing: I have a home page, where user enters his name and gets results on the same page. So I wrote two functions in home.php , one for body load event another for getting user’s result. I have “get_home_info.php” which will load on body’s load event and get_info.php on button click event which will overwrite “get_home_info.php” and give user search results(i.e get_info.php).
These functions are as follows:

 $(document).ready(function(){        
            $('body').load($.get('/get_home_info.php', function(data){
            $('#get_data').html(data);
      })); 
    });

And another one for getting user result:

$(document).ready(function(){
    $("#btn_submit").bind('click', function(){
        if($('#tnm').val() != '' && $('#tnm').val() != 'Enter a twitter username to know its Honest Followers!'){

        $('#loadimg').html('<img src="images/images/ajax-loader.gif">');
            $('#loadimg').show();       
            $.get('/get_info.php?tnm='+$('#tnm').val(), '', function(data){
                $('#get_data').html(data);
                 $('#loadimg').hide();  
            });
        }
    });
});

Note: There are div tags in below code properly in body.
Now my problem is that, I am not able to execute these two functions simultaneously, i.e when I comment bodyload function, and enter user name I get result, and uncommenting body and trying username simply shows search result.

My question are :

  1. can I write two function and execute these two functions at a time.
  2. How can I give effects like on button’s click event first page should disappear so that I can show loading image and after that result.

Can somebody help here please?
thank you in advance.

  • 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-15T14:06:38+00:00Added an answer on May 15, 2026 at 2:06 pm

    you should place those two functions in 1 $(document).ready(function(){}); and you can elemenate $('body').load() function because the .load() function is already an ajax call to a static html element.

    $(document).ready(function(){
    
        $.get('/get_home_info.php', function(data){ $('#get_data').html(data); });
    
        $("#btn_submit").bind('click', function(){
            if($('#tnm').val() != '' && $('#tnm').val() != 'Enter a twitter username to know its Honest Followers!'){
    
            $('#loadimg').html('<img src="images/images/ajax-loader.gif">');
                $('#loadimg').show();       
                $.get('/get_info.php?tnm='+$('#tnm').val(), '', function(data){
                    $('#get_data').html(data);
                     $('#loadimg').hide();  
                });
            }
        });
    });
    

    you can get more definitions in the .load() function in here

    and $.get() in here

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

Sidebar

Related Questions

I am newbie to jQuery and javascript. In my application I have a list
i'm newbie at web developing. i have some input form.i'm using jquery 1.4.2 inside
Using jQuery, how would you find elements which have a particular style (eg: float:
I am using jQuery accordion plugin for my application. Is there a way to
I'm a newbie using jquery and js either, so maybe thats the reason why
I'm a newbie to the jQuery UI plugin and I'm building a demo application
I am using jQuery and a Java based backend system. I am a newbie
Using jQuery , how can I dynamically set the size attribute of a select
Using jQuery, how do you bind a click event to a table cell (below,
Using jQuery, how do you check if there is an option selected in a

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.