1、URL (tomcat utf-8, 、 、IE8/9 )
js:var url = encodeURI( URL);
action: String username=req.getParameterMap().get(key).toString();
req.setAttribute("username", username);
: ${username}
2、 iframe js : parent.
3、IE console , :
$.extend({
infoOptions:{isAllowInfo : true}, //
info:function(str, opts){
var options = $.extend($.infoOptions, opts);
if(options.isAllowInfo && typeof console != 'undefined'){
if(console.info){
console.info(str);
} else if(console.debug){
console.debug(str);
} else {
// , IE8
}
}
}
});
:$.info(' '), console , console
4、js top、parent , a.jsp iframe b.jsp,b.jsp iframe c.jsp
b.jsp top=parent ,c.jsp top=parent.parent
5、web , :IE console.log, js , $.log("ddd"); , eval , , js 。。
$.extend({
'log': function(msg, showtime){
if(window.console && window.console.log){
if(showtime){
console.log(' :' + new Date());
}
console.log(msg);
}
},
'doajax': function(p){
$.ajax($.extend({
type: 'post',
dataType: 'json'
},p));
},
'getTopWin':function(window){
if(window.parent == window){
return window;
}
if(window.parent._popwin && window.parent._popwin.istopwin){
return window.parent;
}else{
return getTopWin(window.parent);
}
},
'eval':function(expstr){
try{
return eval(expstr);
}catch(e){
return undefined;
}
}
})
6、CSS hack , Internet Explorer 6,Internet Explorer 7,Mozilla Firefox , CSS , , 。 CSS, , ( CSS )