Tuesday, March 6, 2012

Problems with jQuery and Internet Explorer

I had a problem with jQuery when I opened Internet Explorer. I couldn't see Date Picker!


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
        <script type="text/javascript" src="js/datepicker-2.6.js"></script>
        <script type="text/javascript" src="js/jquery-1.7.min.js"></script>
        <title></title>
    </head>
    <body>
        <input id="date" name="date"/>(dd/mm/yyyy)
        <script type="text/javascript" >
            var dp0 = new DatePicker("#date",{format:"d/m/Y",displayWeekNumbers:true});
        </script>
    </body>
</html>


To correct the problem, you have to add the next statement: <meta http-equiv="X-UA-Compatible" content="IE=edge"/>



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
    <head>
        <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
        <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
        <script type="text/javascript" src="js/datepicker-2.6.js"></script>
        <script type="text/javascript" src="js/jquery-1.7.min.js"></script>
        <title></title>
    </head>
    <body>
        <input id="date" name="date"/>(dd/mm/yyyy)
        <script type="text/javascript" >
            var dp0 = new DatePicker("#date",{format:"d/m/Y",displayWeekNumbers:true});
        </script>
    </body>
</html>

No comments:

Post a Comment