2016-04-19

Summarize and sort out the things that you have recently come into contact with, so that you can check it yourself.
1. The html5 tag can customize the attribute data-XX
must start with data-, XX represents more than two letters
Solved problem
<a id="demo" href="" onclick=doAdd(id,status)/>
If status is set by The struts2 tag is obtained, if the result is Null, the result may doAdd(id,)
will produce such an error, of course, it can be replaced by "" with additional judgment, but it is troublesome.
Use the data-XX attribute to store the data you want to store, and just take it out when you use it.
2. The entity class stores utc seconds. How to display it on the page as yyyy-MM-dd HH:mm:ss format. For
example , the type of updateTime Long that stores utc seconds
can define a getter named updateTimeStr() in the entity class. Do the corresponding conversion in the get method to
return string, and you can use the corresponding bean property name on the page.
3. Project requirements: Add an avatar on the page, click the avatar frame itself, you can choose to upload the file.
The idea seen on the Internet is: the onclick event of <img> simulates the click event that triggers <input type="file"/>
and then assigns the path of the file to img, so that the avatar is echoed. But in IE10, it is not allowed to
trigger , but it is ok on IE11 and Google Chrome.
4. There are two ways to select the option of the drop-down selection
4.1.
4.2. If it is not selected at the beginning, the option exists in the drop-down list. You can select the drop-down selection and
make its value equal to the value of the option.
5. If some data is not wanted by the user to modify on the modification page, and disabled is set ,
  you can remove the disabled attribute before the form submit action.
6. The parameters passed in the method called at the onclick time of the page tag cannot contain '\', which is not regarded as the transfer character in js. If it is the most resource path in windows, it should be uniformly replaced with '/' before returning to the page. The
browser reports an error Message as follows:





Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326992037&siteId=291194637
04