This one if only for front end techs.
-- Sam 07:48 10/07/2014

标签属性和样式表属性冲突,以样式表为主
 why the <body class="tundra spring" background="getImage/backgroud"> desen't work on bigbang project?
dose it work to only for area inside body?------------No,no,no, it's just because when we use both style and background 属性 于同一个网页元素时,如果里面的内容重复(比如backgroundimage) 那么以Style里的为主。
-- Sam 05:48 30/07/2014
  1.  为什么filechoolse组件中的upload按钮和文件选择按钮不对齐?把文件选择空间<input type ="file"  style="height: 24px"  name="content" />变大点就好看了。
  2. 另外还发现报错森马文件上传相关的类找不到,pom.xml中更新common-upload.jar from 2.2 to 3就好了。
  3. <div class="headImgArea" background=".....中,不管.headImgArea中是否有定义background-image属性,都不会触发getImage请求事件。
  4. <body background=".....中,如果样式表中没有定义背景图片,则会触发请求图片的事件。
-- Sam 09:09 18/07/2014
这种写法导致使用现有的URL,仅仅替换其参数部分,
如:http://abc.com/public?path=abc 的页面中,点后指向http://abc.com/public?myparam=2
       <spring:url var="myurl" value="">
        <spring:param name="myparam" value="2" />
      </spring:url>
      <a href="${url_theme2}">link</a>

-- Sam 18:38 10/07/2014
 
IE的问题
  1. 发现IE访问时,圆角的css统统没有被支持。
  2. 发现IE访问是,菜单显示到了混动的图片的后面。
  3. IE访问瑞的设计的服务器上挂的spaviva时,圆角和菜单都很正常。
  4. 另外发现,公司的网站,阿比机器上的网站IE访问木有问题,其他网站,IE访问都有上述问题,所以我把其机器上的tomcat拿了过来,准备研究下。
  5. =====================================
  6. finally, it's because when IE open those page, it turn to to IE 7 mode automatically,  don't know the reason yet, while the work out is that we set in the meta part let the IE know that the page is work with IE10, then it do not turn to ie7 when open our pages. and it displaying well.
-- Sam 07:23 08/07/2014
Sitemesh的工作机制
1 加入SiteMesh.jar到工作路径
2 add a filter into web.xml
3 addd src/main/webapp into source path
4 under the folder src/main/webapp/WEB-INF, add a file with the name: decorators.xml.
5 in decorators.xml, there are patterns like:    
    <decorator name="player" page="player.jsp">
        <pattern>/player/*</pattern>
    </decorator>
6 in controller, after access will return a string indicating the jsp file name.
!! while, this files name will be matched in decorators.xml first, then select a file in decorator folder to decorate it.
eg. PlayerController return a string: "player/index"
decorators.xml match this patter and find the page player.jsp from folder decorators.
sitemash.jar will decorated the player/index.jsp with player.jsp, then return the final html to explorer.

-- Sam 06:57 08/07/2014
 为何传入到jsp页面的参数,都要转存到变量中才能使用?
我看到:
<spring:url value="${path}" var="form_url"/>
<form:form action="${form_url}" 
是好的。但是如果直接写
<form:form action="${path}" 
就报错说找不到对应的Controller了!
-- Sam 07:17 29/06/2014
 BootStrape
  1. the page was divided into 12 columns, and so do every divs, we can separate each div (inside a page or inside an other div) into another 12 columns....
  2. we can devide a page or a div into 12 columns, while sometimes I found that we can put only 11 object in a row.
  3. There could be only one setTimeout('myrefresh()',4000); if we write more than one, the last one will replace all the ones before it.
    1. the one we used to refresh webpage for now:
    2. <script language="JavaScript"> 
    3. function myrefresh(){  alert("to refresh!");
    4. if(hasNoValue()){
    5.       location.replace(location.href) //window.location.reload();  @NOTE:difference is that reload cause the notice dialog(data will be supply again.)
    6. }
    7. setTimeout('myrefresh()',4000);

    1. function hasNoValue(){
    2. var ofrm1 = document.getElementById("_content_id__iframe").document;  
    3.    if (ofrm1==undefined){ //for ff and chrome.
    4.        ofrm1 = document.getElementById("_content_id__iframe").contentWindow.document;
    5.        var ff = ofrm1.getElementById("dijitEditorBody").textContent;
    6.        if(ff.length == 0)
    7.         return true;
    8.        if(ff.length == 1)
    9.         return true;
    10.        return false;
    11.    }else{ //for ie.
    12. return false;  //var ie = document.frames["_content_id__iframe"].document.getElementById("dijitEditorBody").??;
    13.    } 
    14. }
    15. </script>
=======================other sricpts=========================
  1. How to add a javascript onto a Button:
    1. define the function: 
      1. <script type="text/javascript">
      2. function setValues() {
      3. $("#casinoId").val("123");
      4. ...
    2. define the button: <button onclick="setValues()">
-- Sam 06:41 29/06/2014
SpringRoo
  1. spring roo use jspx, it ask all tag closed, eg. if the <img src=".....> not closed with '/>', it will report strange error like dojo not defined and spring not defined..
  2.  I used the same roo script to create an other project--taostyle but found that the project can be visited in firefox, but throw exception when I try to visit with IE or chrome.
    and the readon: it's because I saved cookie in IE and chrome which make hte application to use a theme which do not exist in the new taostyle application, that's why the application can not find it. lucky enought that my firefox didn't save cookie so I can find some cloue. 
    After clear the cookies the IE and chrome works well.
    So, be careful with the cute cookies:)
-- Sam 06:35 29/06/2014
how to open the super cool firefox debugger? (not firebug)
ctrl+shift+k
-- Sam 13:30 08/05/2014
Java scripts:
  1. the xxx?  value1 : value2  must be included like (xxx ? value1 : value2)
  2. the &lt; is "<" , the &amp; is "and".
  3. a good way to debug is to add a status bar on page, then use document.getDocumdentById("bar").innerHTML = "message" to print debug info.
-- Sam 12:35 04/05/2014
don't uses:
  1. don't use "-" in variable name in jsp or jspx, use "_"instead!
  2. don't use"<*></*>" use ""<a><!-- required for FF3 and Opera --></a>" or "<li><!-- required for FF3 and Opera --></li>" or .... instead!!!
  3. don't use  $(document).ready(function(), use window.onload = function() instead, because if some thing go wrong, the document.read() will never be reached. PS. in jsp, if you use window.onload in html file, then the one in extended js file will never be reached.
  4. don't copy special characters into or from other application like Git Gui or SciTE... because the encoding way are different, copy to or from Notepad or FireFox firebug should be OK.
  5. don't use 'aria-hidden=" true"' to hide a div, because it doesn't work for IE, user style="DISPLAY: none" instead.
  6. be careful about the lines with  if(/msie/.test(borserInfo), because now IE are diffrent, the old code specially for IE might be not good any more, so most of the cases, we'll remove the special codes.
  7. when can not display a page, and report some strange chareacters and something like can not find error page, it's probably because the path property in an eliment can not be found from the from bean which was set to this form. 
  8. don't use "<---" or "--->", use "<--" or "-->". or it will cause unprodicable trouble:(
  9. don't use &nbsp; and something like that in jsp, use "!" directly, for continuoius space, use <c:out......>
  10. don't use "&" in property value like <a  title="Insert picture (or just drag & drop)" ..., the "&"  between drag and drop will cause trouble.
  11. don't use <script src="xxx/yyy/zzz.js"></script> or <script src="xxx/yyy/zzz.js"/>, use <script src="xxx/yyy/zzz.js"><!-- required for FF3 and Opera --></script> instead in jsp or jspx file. or it'll cause unreasonable error.
  12. don't use " \' " in jsp for font name, because it cause syntax error, the fond name can be used directly, without being ' 'ed
  13. when using tiles, don't use same name in layout package with the name in views, like   <definition extends="flashpage" name="flashpage">    <put-attribute name="body" value="/WEB-INF/views/flashpage.jspx"/>    </definition>  will cause exception.
-- Sam 18:59 13/12/2013

Please click here to login and add comments! || automatically refresh content every seconds