问题描述
使用Dojo1.5测试一下DateTextBox,代码如下:<html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><title>DateTextbox</title><style type="text/css" src = "../dojo/resources/dojo.css"</style> <style type="text/css" src = "../dijit/themes/tundra/tundra.css"</style> <script type="text/javascript" src="../dojo/dojo.js" djConfig="parseOnLoad: true, isDebug: false"></script><script>dojo.require("dijit.form.DateTextBox");</script></head><body class="tundra"><form name="form1"><div name="date2" id="date2" dojoType="dijit.form.DateTextBox" /></form></body></html>IE8中出现的结果如下图。(两个输入框,其中一个带X,点击下面一个,到处都是本应该在日期选择框中出现的字符)Dojo一定要在服务器下才能运行吗?没有这个要求啊
解决方案
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html > <head> <style type="text/css"> body, html { font-family:helvetica,arial,sans-serif; font-size:90%; } </style> <script src="../dojo/dojo.js" djConfig="parseOnLoad: true"> </script> <script type="text/javascript"> dojo.require("dijit.form.DateTextBox"); </script> <link rel="stylesheet" type="text/css" href="../dijit/themes/claro/claro.css" /> </head> <body class=" claro "> <input type="text" name="date1" id="date1" value="2005-12-30" dojoType="dijit.form.DateTextBox" required="true" /> <label for="date1"> Drop down Date box. Click inside to display the calendar. </label> <!-- NOTE: the following script tag is not intended for usage in real world!! it is part of the CodeGlass and you should just remove it when you use the code --> <script type="text/javascript"> dojo.addOnLoad(function() { if (document.pub) { document.pub(); } }); </script> </body></html>