訪問地址
localhost:8080將.html改為.jsp
加頭
<!DOCTYPE html>
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<html>
修改css/js/img地址碴巾,善用Ctrl+F
- 返回上一頁
<a href="javascript:window.history.go(-1);"></a>
- 參數(shù)在網(wǎng)頁間傳遞
表單
<form action="2.html" id="form">
<input id="i_choice" name="choice" value="0"/>
</form>
<div class="botton">
<a href="javascript:;" class="over">下一頁</a>
</div>
隱藏表單昌犹,點擊事件
$("#form").hide();
$(".botton a").click(function(){
$("#form").submit();
});
獲取參數(shù)
function GetString(choice){//獲取url參數(shù)
var reg=new RegExp("(^|&)"+choice+"=([^&]*)(&|$)");
var r=window.location.search.substr(1).match(reg);
if(r!=null)return unescape(r[2]);return null;
}
$("#i_choice").attr("value",GetString("choice"));
- 手機號碼驗證排霉、提交
var phoneNum=$(".phone input").val();
var phoneNumReg = /(^[0-9]{3,4}\-[0-9]{7}$)|(^[0-9]{7}$)|(^[0-9]{3,4}[0-9]{7}$)|(^0{0,1}13[0-9]{9}$)/;
if(!phoneNumReg.test(phoneNum)){
alert("手機號碼格式錯誤");
return;
}
$.ajax({
url:" ",
data: ,
success : function(json){
if(json.invokerResult.success){
var content=json.invokerResult.content;
if(content.isSuccess){
alert("提交成功");
try{
AndroidJsObject.printStr("提交成功");
}catch(e){
console.log(e);
}
location.reload();
}
else{
alert(content.msg);
}
}
else{
alert("提交失敗锤灿,請稍后重試");
try{
AndroidJsObject.printStr("提交失敗囱井,請稍后重試");
}catch(e){
console.log(e);
}
}
}
});
- 360瀏覽器兼容
<meta name="renderer" content="webkit"> <!--360極速模式-->
修改host局域網(wǎng)訪問
springmoutain.com:8080產(chǎn)品→設(shè)計→前端→開發(fā)→測試