Use the My97datepicker date plugin in the JSP the reason for not displaying the date selection box on the page __js

Source: Internet
Author: User
Recently, a project in my need to use a date plugin to show the time, online search, and finally decided to use My97datepicker, color good-looking, layout is also very reasonable, but the use of the time encountered many problems, the biggest problem there are two: In the JSP file can not import JS file (My97datepicker plug-in only need to introduce wdatepicker.js this file on OK) can import JS file, However, you cannot import another JS file that wdatepicker.js references: Calendar.js and other static resources that are required (such as some CSS files and pictures, etc.)
Solution: For the first question, do not say more, in the "SPRINGMVC access to static resources 404 Problem" This article said very clearly, the following I focus on the second question
After I import the Wdatepicker.js file, run the project, in Firefox browser can see the Wdatepicker.js file was successfully imported, but it relied on the Calendar.js file has not been imported, and some other static resources have not been imported, which makes me baffled, I even thought is wdatepicker.js file to calendar.js file introduction Way is not right, I actually have such a period of time in pondering how to change the code of Wdatepicker.js, come to really is too ashamed of ...
I will not change the code, mainly novice do not know how to change, and then I thought that this is the difference between JSP and HTML, because the Internet to see people say that HTML is a relative path, and JSP go is the server path (from a complete URL to request JS resources), So I just want to try to see if I can show the date selection box on HTML, the result ... And, of course, failed.
Then there was no way, the first flash of the brain (why it was the first flash). Because there is a second flash, their own JS file import does not go in that I use someone else's chant, so I found a site on the Internet the Date plugin link (here is the link to the Wdatepicker.js), although this can be used, but this is not good ah, My project has to rely on other people's projects, feeling very uncomfortable, so I began to ponder ...
Then I really have no way, I can not get out to see other people's Bar, so I copy from colleagues there a copy of his project, reference .... Overwrite overwrite ... But no, finally I have to configure what all make the same or not, in the heart that desolate ah ...
Fortunately despair, in desolate time I found a very strange place, that is when others introduce JS file is so written: <script src= "xxxxxx" &GT;&LT;/SCRIPT&GT; and mine is so written: <script src = "xxxxxx"/> So my second flash of light came, anyway, do not know how to solve the dead horse as a live horse medicine Bai, I put my <script/> script all changed to <script ></script> this form, God , unexpectedly became ...... I had a two-day problem, and it was such a small format problem.

Although the problem solved, but the reason I am not clear, I hope to have a master to answer


Related Article

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.