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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T14:04:38+00:00 2026-06-07T14:04:38+00:00

I have a HTML file, which generates a web page. Users can enter some

  • 0

I have a HTML file, which generates a web page. Users can enter some comments on webgpage. To save the comments i am calling a perl script, using JQuery/ AJAX. which will add one row in DB.

Inside perl script after adding the record, i am again fetching the same record. Now i want to display that record in my page without refreshing the page. (i know we can do using append in jquery) My question is how to return that record from perl to HTML page, including HTML tags and all.

This is the portion where new records will be added.

<span class="requester"> 
    <span>**message**</span> 
    </br>
    <i> - **username**  </i>
    <button class="deleteResponse" id="id"> delete </button> 
    <hr>
 </span>

Message and username is the items i will be getting from MYSQL quesry.\

This is what i am using to display the data.

 $("#"+getpID+" textarea ").before(htmlcode).fadeIn();

and htmlcode is

var htmlcode = '<span class="requester"> <span>message</span> </br>     <i> - username 0 seconds ago </i> <button class="deleteResponse" id="id"> delete </button> <hr> </span>';

Instead of htmlcode i want data should be returned from perl script.
Any help will be appreciated. Thanks sapna

  • 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-07T14:04:41+00:00Added an answer on June 7, 2026 at 2:04 pm

    Your Perl script needs to print the data you want returned by your AJAX call. It’s basic CGI.

    #!/usr/bin/perl
    use strict;
    use warnings;
    use CGI;
    my $cgi = CGI->new;
    
    # do your database stuff here
    
    my $result = "HTML CODE"; # this is your result
    
    print $cgi->header('text/html');
    print $result;
    

    In your AJAX call, do something like this (which I party lifted from the jQuery doc):

    $.get('ajax/test.html', function(data) {
      $("#"+getpID+" textarea ").before(data).fadeIn();
      alert('Load was performed.');
    });
    

    Please note that I did not test this.

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

Sidebar

Related Questions

can anyone help? I have a simple html file which i am filling via
I have a file which is combination of PHP and HTML. How can i
I have a page which generates a html code in a text box. When
I have a PHP page which generates an HTML table. At the bottom of
I have an HTML file which is launching an app if I open it
I currently have a huge HTML file which doesn't have line breaks and just
I have a HTML file upload field from which I'm reading the file name
Let's say I'm including a file which contains html. The html have characters as
Afternoon, I am trying have an HTML file containing a frameset which contains two
I have a JSON file which contains HTML content. I want to load it

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.