概述:基础知识仍是比较薄弱啊,今天在作项目都有点不记得了,仍是写下来以防万一吧html
<%@ page import="java.io.IOException" %>java
<%--ajax
Created by IntelliJ IDEA.浏览器
User: Administrator微信
Date: 15-1-19异步
Time: 上午11:31ide
To change this template use File | Settings | File Templates.this
--%>url
<%@ page contentType="text/html;charset=UTF-8" language="java" %>spa
<%
String header = (String)request.getAttribute("mpHeader");
String id = (String)request.getAttribute("id");
if(header.indexOf("MicroMessenger")==-1){//判断是不是微信浏览器
try {
response.sendRedirect("mp_ajax_vcf.html?id="+id);//若是是就异步跳转,若是不是就执行接下去
} catch (IOException e) {
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
}
}
%>
<html>
<head>
<title>通信录</title>
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable=no">
</head>
<body style="background:url(<%=request.getContextPath()%>/p_w_picpaths/weixintype.jpg) top right no-repeat rgba(0,0,0,.8);background-size: 290px;" >
//<%=request.getContextPath()%>获取项目根目录
</body>
</html>