how use jquery in response of jquery-ajax?
hi friends.
i am using jquery and jquery-ajax in my sample. but face problem.
i 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.
i ask this question in
stackoverflow.combut their answer don't help me.