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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T14:50:43+00:00 2026-06-15T14:50:43+00:00

i use jquery-ajax and have three file. my file is : jquery-1.8.3.min.js index.html res.html

  • 0

i use jquery-ajax and have three file.
my file is :

jquery-1.8.3.min.js

index.html

res.html

jquery-1.8.3.min.js file is main of jquery file.
index.html code is :

<html>
    <head>
        <script type="text/javascript" src="jquery-1.8.3.min.js"></script>
        <script type="text/javascript">
            $(document).ready(function(){
                $.ajax({url:'res.html',type:"POST",data:'',success:function(result){
                        $("#responsediv").html(result);
                    }
                });
            });
            $(document).ready(function(){
                $('#state_id').change(function(){
                    alert($(this).val());
                });
            });
        </script>
    </head>
    <body>
        <div id="responsediv">

        </div>
    </body>
</html>

and res.html code is :

<select id="state_id" name="state_id">
    <option value="1">first</option>
    <option value="2">second</option>
    <option value="3">third</option>
    <option value="4">forth</option>
</select>

i don’t know why this code not runnig.

$(document).ready(function(){
    $('#state_id').change(function(){
        alert($(this).val());
    });
});

this is sample and simple code . i check this on another project and face this problem.
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-15T14:50:44+00:00Added an answer on June 15, 2026 at 2:50 pm

    I think this should be here:

    <script type="text/javascript">
            $(document).ready(function(){
                $.ajax({url:'res.html',type:"POST",data:'',success:function(result){
                        $("#responsediv").html(result);
                    }
                });
                $(document).on('change', '#country_id', function(){
                    alert($(this).val());
                });
            });
    </script>
    

    note:

    you don't need two doc ready handlers.
    

    try this and see if this helps.

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

Sidebar

Related Questions

I have a small jQuery plugin that I use for form AJAX validation. There
I have an asp.net user control on which I want to use jquery ajax.
I have many forms that use AJAX (w/ jQuery) for validation and data submission.
While debugging jQuery apps that use AJAX, I often have the need to see
I have the following jQuery code below I am trying to use (I know
I am using a jQuery Ajax control from this site http://abeautifulsite.net/2008/03/jquery-file-tree/ I have it
I have the following HTML page: sample_page.html: <h1>sample html page</h1> <script type=text/javascript src=sample_page.js/> The
I am trying to use jquery ajax to get data from a php file.
I'm trying to use jquery.Ajax to post data to an ASP.NET MVC2 action method
Assume we use jQuery.ajax() to POST data with two parameters, game_id and player_id .

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.