网页回退/返回后表单的原数据还显示(动态添加的数据也一样)

版权声明:本文为博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/XiangDeMei13/article/details/83769607
<HTML>
    <HEAD>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <META NAME="save" CONTENT="history">
        <STYLE>
            .saveHistory {
                behavior: url(#default#savehistory);
            }
        </STYLE>
        <script>
            function go(){
                location.href = "affirm.html";
            }
//动态向下拉列表添加值            
            function add(){
                var option = null;
                var first = document.getElementById("select");
                option = document.createElement("option");
                option.appendChild(document.createTextNode(document.getElementById("oPersistInput").value));
                option.vaule = document.getElementById("oPersistInput").value;
                option.selected = "selected";
                first.appendChild(option);
            }
        </script>
    </HEAD>
    <BODY>
        <FORM name=a>
            input1:<INPUT class="saveHistory" type="text" id="oPersistInput1">
            <br>
            <br>
            INput2:<INPUT class="saveHistory" type="text" id="oPersistInput">
            <br>
            <INPUT class="saveHistory" type="button" οnclick="add()" value="动态添加下拉列表的值">
            <br>
            选择: 
            <select class="saveHistory" id="select" name="select">
                <option value="">-----请选择----</option>
            </select>
            <br>
            <br>
            <input type="button" value="submit" οnclick="go()" value="submit">
			<hr>
			&lt;META NAME="save" CONTENT="snapshot"&gt;<br>
        &lt;STYLE&gt;<br>
            .saveSnapshot {<br>
                behavior: url(#default#savesnapshot);<br>
            }<br>
        &lt;/STYLE&gt;<br>
		 这种情况为清空
        </FORM>
    </BODY>
</HTML>

 这是输入的第一个页面,也是表单页面

affirm.html 写道
<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</HEAD>
<BODY>
<FORM>
要返回前面的表单页面,但数据不丢失
<br>
<input type=button value=Back οnclick=history.back()>
<br>
<input type=button value=Back οnclick=history.go(-1)>
</FORM>
</BODY>
</HTML>

 

展开阅读全文

springcloud zuul fallback 回退返回数据异常

05-22

我的eureka中注册了user服务 和 gateway-zuul-fallback 服务rn直接访问user服务localhost:8081/user/getUser?id=1 没问题rn通过zuul访问userlocalhost:8097/user/user/getUser?id=1 也没问题rnzuul服务yml配置:rn![图片说明](https://img-ask.csdn.net/upload/201805/22/1526957296_9037.png)rnfallbackConfigrn![图片说明](https://img-ask.csdn.net/upload/201805/22/1526957384_939838.png)rnrn我把 user服务挂掉,通过zuul代理访问报以下错误:(怎么返回的不是fallback error string)rn 2018-05-22 10:46:33.835 WARN 9020 --- [nio-8097-exec-9] o.s.c.n.z.filters.post.SendErrorFilter : Error during filteringrn com.netflix.zuul.exception.ZuulException: nullrn at org.springframework.cloud.netflix.zuul.util.ZuulRuntimeException.(ZuulRuntimeException.java:33) ~[spring-cloud-netflix-core-1.4.4.RELEASE.jar:1.4.4.RELEASE]rn at org.springframework.cloud.netflix.zuul.filters.route.RibbonRoutingFilter.run(RibbonRoutingFilter.java:119) ~[spring-cloud-netflix-core-1.4.4.RELEASE.jar:1.4.4.RELEASE]rn Caused by: java.lang.NullPointerException: nullrn at org.springframework.cloud.netflix.zuul.filters.route.RibbonRoutingFilter.forward(RibbonRoutingFilter.java:159) ~[spring-cloud-netflix-core-1.4.4.RELEASE.jar:1.4.4.RELEASE]rn at org.springframework.cloud.netflix.zuul.filters.route.RibbonRoutingFilter.run(RibbonRoutingFilter.java:111) ~[spring-cloud-netflix-core-1.4.4.RELEASE.jar:1.4.4.RELEASE]rn ... 66 common frames omittedrn 页面返回:rn rn "timestamp": 1526956683342,rn "status": 500,rn "error": "Internal Server Error",rn "exception": "com.netflix.zuul.exception.ZuulException",rn "message": "No message available"rn 问答

关于Ajax返回数据显示网页的问题

12-28

各位大侠,麻烦帮帮小弟啊!rnrn先说明下我的问题:rn 我想做一个仿Google Suggest的搜索框,输入keyWord时会返回一些数据,再显示到搜索框的下方的div中。rn 我已经成功获取的返回的数据,可是我不知道怎样将数据按照一定的格式显示到网页中,求求各位大侠帮帮忙。rnrn这是我js里面的代码rn[code=JScript]function search() rn var jqueryObj = $("#txtSearch");rn var searchStr = jqueryObj.val();rn $.get("SearchSuggest?search=" + searchStr, null, callback);rnrnrnfunction callback(data) rn var jqueryObj = $(data);rn var resultObj = $("#search_suggest");rn resultObj.empty();rn var str = data.split("\n");rn[/code]rnrn截两张图:rn输入“刘”字rn[img=http://hiphotos.baidu.com/595896577/pic/item/3aedbd46ad34598227d7c1df0cf431adcaef84d4.jpg][/img]rnrn用firebug查看:rn[img=http://hiphotos.baidu.com/595896577/pic/item/9422af19b051f819b46b2707dab44aed2f73e7e7.jpg][/img]rnrnrn服务器返回的数据是String类型的并且以"\n"做为分隔符。rn下面一段是servlet中的代码:rn[code=Java]vData = ss.search(search);rn StringBuffer buf = new StringBuffer();rn for (int i = 0; i < vData.size(); i++) rn String keyWord = (String) vData.get(i);rn buf.append(keyWord + "\n");rn rn System.out.println(buf.toString());rn[/code]rnrn输出的数据截图:[img=http://hiphotos.baidu.com/595896577/pic/item/971931f7e0fe99257c514d1d34a85edf8cb171d4.jpg][/img] 论坛

用inet post multipart/form-data表单后取得返回数据

05-28

[code=VB]rn Inet1.Execute Url, "POST", Value, strHeadrnrn Do Until Inet1.StillExecuting = Falsern superSleep 0.5rn Looprn'从缓冲区取得命令返回的内容rn lstReturn = Inet1.GetChunk(1024, icByteArray) '如果用icString类型会出错rn strAll = BytesToBstr(lstReturn, "gb2312")rn'==================================================rn'函数名:BytesToBstrrn'作 用:将获取的源码转换为中文rn'参 数:Body ------要转换的变量rn'参 数:Cset ------要转换的类型rn'==================================================rnPublic Function BytesToBstr(Body() As Byte, Cset As String) As StringrnDim Objstream As ADODB.StreamrnSet Objstream = New ADODB.StreamrnObjstream.Type = 1rnObjstream.Mode = 3rnObjstream.OpenrnObjstream.Write BodyrnObjstream.position = 0rnObjstream.Type = 2rnObjstream.CharSet = CsetrnBytesToBstr = Objstream.ReadTextrnObjstream.ClosernSet Objstream = NothingrnEnd Functionrnrn[/code]rn[我看了post的目标网页是gb2312,但是执行上面的代码后得到的strAll的值是一堆乱码:rn[size=10px]? ?ks诺烮U0&?F麗lc=V??籰慓匼侦n?鲮?3獹0?F(??敛浞q0茤_舶颁颦\?rC?!rn囋=Щg︾被??杤?忣缨汐?萦雉?簃鬣蠴鰈桭聿&韞n胛儝軝N▄0澽6碝唙頂博?d*亥讵?Z:烬YY扜m灰汵弿彠苹S??跊濦XYl?;m猦鍋飤?Q謙+'塾用毘蔇)耞 J欂rn鄈W:?Uu,'Z篗t籹h睟d├顁睲&?B钃rni;7掞晡v蒖趤eF?柀7疂?姣?=;粁n犴镃+?qf崛茚?框茐鵖??u嵛粼骞wo_緓崴c颩Ou^黖秚燐汐G??2伏胗7"l喆當IN>@&?砲 ? 嬆*榡橹邦畗奿)#?搶A?0dUZ橴爮康H荾麊FI?Z鍔b珁M$鍻鄫Myc啓d?梴jy$mc?揟??zz嫋瘱婴ㄚ啓辭メq傩SР]?I授 ]輛a?厍苟_SX駺歖q磞毆愒bN.X€業礈l贀Z盕 眪癶匭摂r瞆VF垥?嚦)?窃熸蛘?姄婈鞟㏕坁?&P綧胟眆AS,愪qS┤?n寓=?鮨蔜&?嘞埅鱆 ┰鏎?^9きAVuL1Qw~ 旓鬄ld鮅榇Q?s&?圧降坆F颀閶鏝?绝鷷w畖1w~yN€想:?]縬jv!\蟅F€禙??工娸珣捿氰暴 ?J詰Q???撵蚔&臡鳲?M-鯱攂D赣6*經??紼?A? 鲄猧fo臥K砄(?遥缕Bx漌rnFL*; ? 譽o诖Y轳!促廝y,bD攢`濄 tO&忧習J?l枹i 饋I搨b?亘? 嗢尀W姘?兞.h[?`("腄 ^雂\赽毷dR囹拰梆/@?庈聋*U?Z0楸鞇^U但?岯?Z!鰒rnZ桷稚E'?h[?[/size]rnrn我又把gb2312换成了utf-8,得到了另一堆乱码:rn[size=10px] =ks?IU0&Flc=V-*lG\n423G0?F("7q0?_\rC&!rn=g类+v5??9?mOlF&yn?N06Mv?4d*?+Z:YYGm?N?S9?@XYl/;meh~8Qt+'úD)_ JrnkW: Uu,'ZMtshBdrM&4Brni;7vR?eFrn7:>=;xnC+.qf??S/8uwo_xcMOu^_t?G/927"lIN>@&rnh rn *j??i)#A=0dUZUH]FI ZbyM$OMycdjy$Tmc(T(rnzz??oqS]=I ]vaX%?_SX@]qybN.XIl?ZF hQrZVF)??7AT^(&PMkfAS,qSn?=+lT&$ψJ @"^9AVuL1Qw~ ldIQs&z+RbFNw|1w~yN:.]qjv!\VFF$$?豩 1J?Q7rnV&uMO M-UbD6*" EA> ifoPKO(1?BxWrnFL;  uo?Y!?Py,bD` tO&J(lXi Ib?. ?W.h[2`("D ^d\bdR/@?*UZ0鱤Z^U.B Z!vrnZE'h[ [/size]rnrn怎样才能显示出正确的内容呢? 论坛

没有更多推荐了,返回首页