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

  • Home
  • SEARCH
  • 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 6062871
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:06:03+00:00 2026-05-23T09:06:03+00:00

Here is the html and jQuery part: <html> <head> <script type=text/javascript src=jquery-1.3.2.js></script> </head> <body>

  • 0

Here is the html and jQuery part:

<html>
  <head>
    <script type="text/javascript" src="jquery-1.3.2.js"></script>
  </head>

  <body>      
   <script type="text/javascript">

    $('document').ready(function(){

       $('#submit').click(function(){

          var username=$('#user').val();

          $.post('http://localhost:8080/verify/comment.php',
                 {
                   user:username
                 },
                 function(return_data)
                 {
                   alert(return_data);
                 }
           );
       });

   });
  </script>

   Username:<input type="text" id="user"/>
   <input type="button" id="submit" value="submit"/>

 </body>
</html>

comment.php

 <?php    
    echo 'welcome';
 ?>

It displays an empty alert message.. I can’t get the value “welcome” in alert message……..
Any suggestion…….?

  • 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-23T09:06:03+00:00Added an answer on May 23, 2026 at 9:06 am

    Ohhh… my eyes just went crazy rolling by looking at this code. So many things you are doing wrong… Where to start?

    1. Current jQuery version is 1.6, not 1.3.2.
    2. Your HTML is not valid. You don’t have a form element.
    3. You don’t listen for a click event on the submit button, but for a submit event on the form.

    This should be working for you:

    <html>
        <head>
        </head>
        <body>
            <script type="text/javascript" src="jquery-1.3.2.js"></script>
            <script type="text/javascript">
                $(document).ready(function(){
                    $('#login').submit(function(e){
                        // prevent form submit, so we can do a manual one
                        e.preventDefault();
    
                        var username = $('#user').val();
                        $.post('http://localhost:8080/verify/comment.php', {user:username}, function(return_data){
                            alert(return_data.message);
                        }, 'json');
                    });
                });
            </script>
            <form id="login" action="" method="post">
                <label for="user">Username:</label>
                <input type="text" id="user"/>
                <input type="button" id="submit" value="submit"/>
            </form>
        </body>
    </html>
    

    Here is your PHP, which echos a json_encode()d string, for context (notice how we accessed returned_data.message on the above code:

    <?php
    $return_data = array(
        'message' => 'Welcome'
    );
    echo json_encode($return_data);
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is the entire page: <html> <head> <script type=text/javascript src=/jquery.js></script> <script type=text/javascript src=/json2.js></script> <script
here is my case: <html> <body> <head> ... <script> $(function(){ $('.do-tip').qtip({ content: 'This is
i want to enable facebox jquery using javascript. here in normal html <a href=stairs.jpg
My HTML: <div id="parent"> <div id="child">cx</div> </div> When I use jQuery $('#parent').mouseout(function(){ //something here
Here is the problematic part of my code, run inside .each(function(){ }); $('img','<div>'+ed.selection.getContent({format: 'html'})+'</div>').each(function(){
I am doing an AJAX call that returns some HTML and jQuery: <div id='selected'>Here
here is link to an example: http://techchorus.net/demos/jquery/hiding-input-elements-in-a-div.html It actally disables few elements on click
I have this html code that i want to edit with jQuery. Here is
I have some content sliding here. http://www.smallsharptools.com/downloads/jQuery/Slider/slider.html The HTML structure is simple. There is
I have a stupid problem. An jQuery.ajax request return me a full HTML text

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.