Topic
3 replies Latest Post - ‏2014-09-20T11:56:05Z by jitupkp
RalphPorter
RalphPorter
3 Posts
ACCEPTED ANSWER

Pinned topic Ajax Jquery category selector works in Firefox but not IE

‏2011-08-17T20:49:57Z |
I am new to Ajax and Jquery.

I have written some code for a category selector.
It functions correctly in Firefox, but does not work in IE.
Any help would be appreciated.

You can try it at www.findasale.com/c1.php

HTML source code follows

<html> <head> <title>category selector</title> <script type="text/javascript" src="scripts/jquery.min.js"></script> <style type="text/css"> select { width: 560;} </style> </head> <body bgcolor="FFFFBB"> <table bgcolor="FFFFBB">

<script type='text/javascript'> $(document).ready(function() { $(".category0").change(function() { var id=$(this).val(); var dataString = 'id='+ id; $.ajax ({ type: "POST", url: "ajaxCategory.php", data: dataString, cache: false, success: function(html) { $(".subcategory0").html(html); } }); }); $(".subcategory0").change(function() { var pid=$(this).val(); var dataString = 'pid='+ pid; $.ajax ({ type: "POST", url: "ajaxCategory.php", data: dataString, cache: false, success: function(html) { $(".category0").html(html); } }); dataString = 'id='+ pid; $.ajax ({ type: "POST", url: "ajaxCategory.php", data: dataString, cache: false, success: function(html) { $(".subcategory0").html(html); } }); }); }); </script> <table> <tr> </td> <tr> <th align=right>Category: </td><td> <select name='category[0]' class='category0'> <option selected='selected'>Select Category</option>

</select> <select style='width: 150px' name='subCategory[0]' class='subCategory0'> <option selected='selected'></option> </select> </th> </tr> </table> <script type='text/javascript'> var dataString = 'pid=0'; $.ajax ({ type: 'POST', url: 'ajaxCategory.php', data: dataString, cache: false, success: function(html) { $('.category0').html(html); } }); dataString = 'id=0'; $.ajax ({ type: 'POST', url: 'ajaxCategory.php', data: dataString, cache: false, success: function(html) { $('.subCategory0').html(html); } }); </script>

</body> </html>
Thank you,

Ralph Porter
Updated on 2011-08-25T18:23:23Z at 2011-08-25T18:23:23Z by RalphPorter
  • RalphPorter
    RalphPorter
    3 Posts
    ACCEPTED ANSWER

    Re: Ajax Jquery category selector works in Firefox but not IE

    ‏2011-08-24T20:10:47Z  in response to RalphPorter
    I have added a page at www.findasale.com/categoryTest.html

    This page has links to download the source code to reproduce this problem.
    • RalphPorter
      RalphPorter
      3 Posts
      ACCEPTED ANSWER

      Re: Ajax Jquery category selector works in Firefox but not IE

      ‏2011-08-25T18:23:23Z  in response to RalphPorter
      I found the issue. It was a problem with the class name in the select statement.
      It had an upper case character in it that was not in the ajax code.
  • jitupkp
    jitupkp
    104 Posts
    ACCEPTED ANSWER

    Re: Ajax Jquery category selector works in Firefox but not IE

    ‏2014-09-20T11:56:05Z  in response to RalphPorter

    see more

    http://techgurulab.com/course/ajax-quiz-online/