For details about the calendar control my97datepicker, "unable to open the site, terminated operation" appears under IE6"

Source: Internet
Author: User

Today, I tested the project and found that the project failed to be opened on the next page of IE6, prompting "unable to open the site, terminated operation". I tested the project and found an error caused by the calendar control my97datepicker, so I read the introduction of my97datepicker, but it was fruitless. Finally, I accidentally tried Baidu and found a solution:

1, my97datepicker official: http://www.my97.net
2. Solution to "unable to open site, terminated operation" appears in IE6 ():

The my97datepicker JS date control is indeed excellent, but the display on IE6 has the biggest size problem. The first is the problem of IE6 itself. IE6 does not support Chinese CSS annotations. therefore, if the CSS file contains Chinese comments, the CSS in this part will become invalid.

The only two CSS files in my97datepicker have Chinese comments, so it is best to reference this date control.

When this control is called in the frame, the system always finds that the site cannot be opened and the operation has been terminated ?" The message box is also available on the official website. The solution is as follows:
1. When using IE6, if a base target tag exists, it must be set after the date control is loaded
That is, <script language = "JavaScript" type = "text/JavaScript" src = "../my97datepicker/wdatepicker. js"> </SCRIPT>
<Base target = "_ Self"/> (place the header <base href = "<% = basepath %>"> under wdatepacker. js you reference)
2. Add defer = "Defer" to the <SCRIPT> label"
3. Put <SCRIPT> behind the page <body>
4. Put <SCRIPT> behind the page 5. This is an absolutely effective method, but will lose the feature that spans IFRAME. Change $ crossframe in wdatepicker. js to false.

In addition, if you directly enter a date in IE6, the displayed input will appear from right to left. The displayed order of the input date is disordered. This problem occurs generally because the text box has the readonly attribute, remove this property to restore normal!

Usage:
<SCRIPT type = "text/JavaScript" src = "/my97datepicker/wdatepicker. js"> </SCRIPT>

Then <input class = "wdate" type = "text" name = "memberbirth" onclick = "wdatepicker ()"/>

When class = "wdate" is added, there will be a small date icon on the left in the text box. Of course, you can also leave it empty.

3. Key configuration for my97datepicker:
Http://www.my97.net/dp/demo/resource/3.asp
For example: datefmt -- string: 'yyyy-mm-dd' date display format. You can refer to the custom format. You can change it to 'yyyy-mm-dd hh: mm: ss'

4. record a simple call method:
Add the following between Add call: <input id = "starttime" name = "starttime" value = "<% = starttime1 = NULL? "": Starttime1 %> "type =" text "class =" wdate "style =" width: 160px "onclick =" wdatepicker (); "/>

5. record a JS that dynamically displays the time on the current page:
// Add web time

<SCRIPT>
Function testdate (){
VaR date = new date ();
VaR result = date. getfullyear () + "-" + (date. getmonth () + 1) + "-" + date. getdate () + "" + date. gethours () + ":" + date. getminutes () + ":" + date. getseconds ();
Document. getelementbyid ("mydate"). innerhtml = result;
};
Setinterval ("testdate ()", 1000 );
</SCRIPT>

For details about the calendar control my97datepicker, "unable to open the site, terminated operation" appears under IE6"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.