drop down menu works in all browsers except internet explorer

I have this code below where it is suppose to be able to display a list of modules in a drop down menu by using ajax to retrieve the modules from another page:

code given below

    $(document).ready( function(){

        jQuery.ajax({ 
        type: "post", 
        url:  "module.php", 
        success: function(response){ 
        jQuery('#modulesDrop').append(response); 
        } 
        }); 
    });

...

<?php

    $moduleHTML = "";  
    $moduleHTML .= '<select name="modules" id="modulesDrop">'.PHP_EOL; 
    $moduleHTML .= '<option value="">Please Select</option>'.PHP_EOL;  
    $moduleHTML .= '</select>'; 

?>

module.php page:

<?php

     // connect to the database
     include('connect.php');

     /* check connection */
     if (mysqli_connect_error()) {
    printf("Connect failed: %s\n", mysqli_connect_error());
    die();
    }

    $moduleactive = 1;

    $sql = "SELECT ModuleId, ModuleNo, ModuleName FROM Module WHERE ModuleActive = ? ORDER BY ModuleNo"; 


     $sqlstmt=$mysqli->prepare($sql);

     $sqlstmt->bind_param("i", $moduleactive);

     $sqlstmt->execute(); 

     $sqlstmt->bind_result($dbModuleId,$dbModuleNo,$dbModuleName);


    $moduleHTML  = "";  

     while($sqlstmt->fetch()) { 
         $moduleHTML .= sprintf('<option value="%1$s_%2$s_%3$s">%1$s - %2$s</option>'.PHP_EOL, $dbModuleNo, $dbModuleName, $dbModuleId);
    } 


    echo $moduleHTML; 

     $sqlstmt->execute(); 


    ?>

What I don't understand is that the drop down menu manages to display a list of modules in all major browsers except for internet explorer which just still displays the "Please Select" option. Why does the drop down menu not able to display a list in internet explorer?

UPDATE:

I am going to scrap the ajax method and just paste the main php code into the original script

Answers


You are better off just using php in your own script to retrieve the modules using the same script using php/mysqli in same script


Need Your Help

Resursive function calling in user created smarty functions in smarty plugin directory

php plugins recursion smarty user-defined-functions

I am trying to write a smarty function inside smarty plugin directory. It is a recursive function . It is working well in normal php files and will generate a drop down select box. Now I would like...

why is wrap content bigger than real pixel size?

android imageview wrap pixels

I am trying to understand something. A weird thing that I see is that when I put "wrap content" in the width and hight, the image is bigger than the the real px (pixel) size of the image which is

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.