一、ajax 请求 使用 iframe 替代方式:
jsp页面上加上:
<script type="text/javascript">
//触发函数
function test(param){
var testfrm=document.getElementById("testfrm");
//请求URL
testfrm.src="<%=basePath%>data/test.action?param="+param;
}
//回调函数
function testCallback(){
// 根据请求 URL输出的内容判断是否成功、做相应的操作。
}
</script>
<iframe src="" id="testfrm" name="testfrm" scrolling="no" ></iframe>
java 后台请求对应的方法中加入:
HttpServletResponse res=ServletActionContext.getResponse();res.setHeader("Content-type","text/html;charset=GBK");
res.setCharacterEncoding("GBK");
PrintWriter out=res.getWriter();
out.println("<script type=\"text/javascript\">");
out.println("parent.testCallback()");
out.println("</script>");
out.close();
二、验证码无法显示:Could not initialize class sun.awt.X1 解决方案
启动tomcat的用户无法访问 Linux下的XServer 服务
http://www.iteye.com/topic/665688
三、机顶盒标清95px 放四个汉字。
四、机顶盒标清弹出层光标焦点问题:
弹出子窗口时,隐藏父窗口上的焦点,然后使焦点放在子窗口上。
function testpopup(){
document.getElementById("parent_win_id").style.display="none";
document.getElementById("child_win_id").style.display="block";
document.getElementById('child_button_id').focus();
}
五、请求 URL 解析URL返回的JOSN内容:
public static JSONObject getHttpJson(String httpurl){
try{
URL url = new URL(httpurl);//远程url
URLConnection conn = url.openConnection();
conn.connect();
InputStream in = conn.getInputStream();
BufferedReader br = new BufferedReader(new InputStreamReader(in,"utf-8"));
StringBuffer buffer = new StringBuffer();
String temp = null;
while ((temp = br.readLine()) != null) {
buffer.append(temp);
}
JSONObject jobj = JSONObject.fromObject(buffer.toString());
return jobj;
}catch(IOException e){
e.printStackTrace();
}
return null;
}
六 、自测范围:
华为基本 V100R001C051B02D41 ipanel3.0(编号2)
大华120D 00000232 ipanel3.0(编号13)
杭摩120E(高清1.0) 10571136 ipanel3.0(编号21)
飞越C586C(高清2.0) 05710115 ipanel3.0(无)
九联机顶盒 也需要加入自测范围。