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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T10:15:14+00:00 2026-05-16T10:15:14+00:00

I have this page which loads quotes. It has a search form wherein if

  • 0

I have this page which loads quotes. It has a search form wherein if the user types in the search keyword, it will load the results via ajax. Now, if I click on the link which should load the default page with the Quotes, instead of the search results page, nothing happens.

If I am on the home/default page itself, and click on the link, it will display a random quote, but once it displays the search page, if I click on the link to display a random quote, nothing happens. Firebug shows that the function isn’t being executed.

jQuery code:

            function loadQuotes() {
                $("#bquote").load("quotes_in.php");
}

     $("a#main").click(function() {
                $(this).addClass("current"); 
                $(".toggleDiv").slideUp(600);
                    loadQuotes();
                 });
                loadQuotes();  //call it once on load

            $(".bsearch").keydown(function() {
                     //create post data
                      var postData = { 
                        "search" : $(this).val()
                      };

                      //make the call
                      $.ajax({
                        type: "POST",
                        url: "quotes_in.php",
                        data: postData, //send it along with your call
                        success: function(response){
                                setTimeout(function() {
                                $('#left').html(response);
                                    $("div#smore").hide();
                                }, 250);    

                        }
                      });

                })

HTML:

             <!-- Begin Left Column -->
                <div id="left">
                     <!-- Begin Panel -->
                    <div class="check">
        <p><input type="checkbox" value="Quote" name="quote" id="quote" checked /> <label for="quote">Quote</label></p>
    <p><input type="checkbox" value="Reference" name="reference" id="reference" checked /> <label for="reference">Reference</label></p>
            </div>
         <!-- End Panel -->
          <!-- Begin Quote -->
        <blockquote id="bquote">
        </blockquote>
                                                 <!-- End Quote -->

                                        </div>
                                 <!-- End Left Column -->

  <!-- Begin Naviagtion -->
         <div id="navigation">

             <ul>
                <li><a id="main">Another?</a></li>
                <li><a id="bsearch">Search</a></li>
                <li><a id="babout">About</a></li>
                <li><a id="bcontact">Contact</a></li>
             </ul>   

         </div>
         <!-- End Naviagtion -->

PHP search:

public function formatSearch($row, $search) 
            {
                $cQuote =  $this->highlightWords(htmlspecialchars($row['cQuotes']), $search);

                    return "<div class=\"swrap\">"
                . "<p id=\"s_quotes\"><img src=\"image/list1.png\" alt=\"b\" style=\"position:relative; top:2px;\">&nbsp;" . $cQuote . "&nbsp;</p>"
                . "<div id=\"smore\"><p id=\"s_arabic\">" . $this->h($row['cArabic']) . "</p>"
                . "<p id=\"s_author\"><b>~</b>&nbsp;" . $this->h($row['vAuthor']) . "</p>"
                . "<p id=\"s_reference\"><span class=\"source\">Source:</span> " . $this->h($row['vReference']) . "</p></div></div>"
                . "<img src=\"image/sep.png\" style=\"position:relative; left: 600px;\">";
            }
  • 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-16T10:15:15+00:00Added an answer on May 16, 2026 at 10:15 am

    The new results aren’t going to be acknowledged by the JavaScript as the script only acknowledges what HTML is there upon the page load. For your function to be able to ‘see’ HTML generated via AJAX Functions, you need to use he Jquery live function http://api.jquery.com/live/

    Convert your current click function to something like this

    $('a#main').live('click', function() {
         $(this).addClass("current"); 
                $(".toggleDiv").slideUp(600);
                    loadQuotes();
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple webview which loads a page. This page has a few
I have this page which has tabs. Content in say, tab 1 loads as
I have this page which has three peson searchs on them. Basically it's a
I have a page which has document.body.onload=function(){...} but this is suffering delays because the
This may sound a weird question, I have a page which has a link:
i have a form in which if the user enters the search query, its
I have a web page which loads in two different ways; user can click
I have a page which has a panel whcih contains various buttons to load
I have a UIWebView which loads an HTML page which has some links to
I have a user input page which loads different forms with ajax depending on

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.