最近在做wap2.0的手机wap,写返回上一页的时候,开始是用history.go(-1);
发现在手机上只有部分机器可以比如windows mobile 而在别的机器如nokia和ophone手机
上这些就不太好用了,经过左思右想终于想到了个山寨方法来解决这个流氓问题了...
不直接用手机的返回功能,而是通过读取 referrer 上得到上一页的链接来实现手机返回上一页功能
代码如下:
JavaScript CODE
- /*返回上一页*/
- function return_prepage()
- {
- if(window.document.referrer==""||window.document.referrer==window.location.href)
- {
- window.location.href="{dede:type}[field:typelink /]{/dede:type}";
- }else
- {
- window.location.href=window.document.referrer;
- }
- }
在需要用的地方直接调用;
<a onclick="javascript:return_prepage();"></a>
相关推荐
Network Component Version 7.15.0(see revision history for detalls) -added functions netARp ClearCache and netDp ClearCache to clear the ARP or NDP cache at runtime -improved dynamic memory debuaging....
在做一个Web项目时遇到一个需求,当页面没有前驱历史记录时(就是当前为新弹出的页面,没法做goback操作即history.go(-1)),点击返回按钮时直接关闭页面,否则就退回到前一页。 遇到的问题就是如何判断 是否有...
使用FCKeditor编辑文章,出于某种原因提交失败,此时浏览器执行返回动作,FckEditor编辑框内显示html代码。
donjayamanne.githistory-0.6.3.vsix eamodio.gitlens-10.2.1.vsix johnstoncode.svn-scm-2.10.6.vsix keybindings.json Microsoft.VisualStudio.IntelliCode.vsix MS-CEINTL.vscode-language-pack-zh-...
TTC-From.Yao.to.Mao-.5000.Years.of.Chinese.History-Part.II
Javascript 返回上一页: 1. history.go(-1), 返回两个页面: history.go(-2); 2. history.back(). 3. window.history.forward()返回下一页 4. window.history.go(返回第几页,也可以使用访问过的URL) 例: 复制代码 ...
[A.History.of.Algebraic.and.Differential.Topology.1900-1960].Dieudonne.J.djvu
python库,解压后可用。 资源全名:foliantcontrib.history-1.0.8-py3-none-any.whl
资源来自pypi官网。 资源全名:foliantcontrib.history-1.0.8-py3-none-any.whl
返回上一页并刷新返回上一页,我们经常用history.go(-1)//返回上一页(括号中写-2代表返回上两页) history.back()//返回上一页这个我很久之前的一篇文章中也提及了!但是有时候有这样的 ... 返回上一页并...
1 Name 2 Description 3 Author 4 Vendor (Vendor Code) 5 Current Version 6 Supported Devices / PCI IDs 7 Acceptance Level 8 Dependencies and Restrictions 9 Package Properties 10 History 11 ...
1.第一位X * X defines Android version: 0 for Android 表示Android5.0以下版本 4 and 7 for Android >=5.0 // 4和7表示Android5.0及以上 8 for Android TV // 8表示Android电视应用 2.第二位Y * Y defines CPU ...
connect-history-api-fallback, 返回到使用 HTML 5历史记录API的应用程序的回退到 index.html connect-history-api-fallback通过指定索引页面向代理请求请求中间件,这对于使用HTML5历史API的单页应用程序。...
- IMPROVED: GoWrapper now supports multiple materials. - FIXED: Correct cleanup action for RemovePackage. 3.0.0 From this version, we change package data format to binary. Editor version 3.9.0 with '...
增值包中包含以下文件: sfx\7z.sfx - 自释放模块(Windows 版本) sfx\7zPacked.sfx - 自释放模块(Windows 版本,... doc\History.txt - 7-Zip 历史 doc\License.txt - 许可信息 doc\readme.txt - 软件自述文档
javascript-history.go()和History.back()的区分_.docx
hacker-history.pdf hacker-history.pdf
资源来自pypi官网。 资源全名:django_simple_history-1.8.0-py2.py3-none-any.whl
1. Javascript 返回上一页history.go(-1), 返回两个页面: history.go(-2);2. history.back().3. window.history.forward()返回下一页4. window.history.go(返回第几页,也可以使用访问过的URL) 例:向上一页</a>...