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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T10:12:13+00:00 2026-06-17T10:12:13+00:00

I am seeing plenty of libraries and plugins for finding a search term in

  • 0

I am seeing plenty of libraries and plugins for finding a search term in a regular page, but they are not written to handle highlighting a string within ajax response content. E.g. many scripts I find do the call to the main function like for example:

`returnDataSearchTermHighlightified = highlight(searchString);`

(^^^ from the accepted answer at: Highlight search terms (select only leaf nodes))

…where that highlight() function’s missing second param is auto-populated with the entire HTML body of the page. But in my case I am not wanting to highlight keywords in the parent body, but in the ajax response content only (a div I populate in the parent body), and so I cannot do e.g. this:

returnDataSearchTermHighlightified = highlight(searchString);

…and if I try this:

...
var jqxhr = $.ajax(

        {
            type: 'POST',
            url: ajaxWorkerSourceUrl,
            data: form_data,
            timeout: 15000
        }
    )
    .success(function(returnData) {
        $("#ajaxSpinner").fadeOut('slow');
        searchString = 'example';
        returnDataSearchTermHighlightified = highlight(searchString, returnData);

…then the page seems to load my ajax response with no error, but that response content is empty!
Can anyone point me to fixing this? .. or even to a library or plugin designed to handle keyword highlighting in jquery ajax response content?

Thanks!

  • 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-06-17T10:12:15+00:00Added an answer on June 17, 2026 at 10:12 am

    It seems that function highlight(term, base) requires base to be of type Element or jQuery .

    Try

    .success(function(returnData) {
            $("#ajaxSpinner").fadeOut('slow');
            var searchString = 'example',
                base = $(returnData);
            highlight(searchString, base);
            base.appendTo(document.body); //whatever you were going to do..
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Seeing various locking related question and (almost) always finding the 'loop because of spurious
Seeing lots of SOAP/RDS stuff, but just want to dump some MySQL data and/or
I'm seeing a problem where a Queue is not backed up however the time
Forgive the title, I'm not really sure how to explain what I'm seeing. Sample
Seeing a checked expection in API is not rare, one of the most well
Seeing all the UNIX guys have memcache (PHP, Python, etc.), are the .NET libraries
Seeing as though I've now solved all of my LINQ problems I'm not working
I know that there have been plenty of topics describing this topic but I
Seeing some unexpected behavior with Python tonight. Why is the following printing out 'not
Seeing the following syntax error, but the urls.py file seems to be correct. What

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.