AJAX href ='#'浏览网址
This is a simplistic version of what I'm trying to do, but when you click on the link it redirects the page to the url + #, this is creating an additional navigation step when attempting to use the browser back button.
If I remove the href it doesn't work, if I change it to href='' then it refreshes the page every single time.
What is the proper way to handle this? I'm still attempting to learn jQuery / AJAX, so this may be a very basic question.
http://jsfiddle.net/bvp8xa5x/
HTML
<div id='updateMe'>Old Value</div>
<a href='#' id='test'>Test</a>
jQuery
$(function(){
$('#test').click(function(){
$.ajax({
type: "GET",
url: '',
success: function(data) {
$('#updateMe').html('New Value');
}
});
return false;
});
});
相关知识
a href=#1首版a a href=#1尾版a a href=#1A11版a
href=#|href=javascript:;|href=javascript:void(0)之用法区别,超级链接也能玩出花!
php login json,ajax + php + json = login
ajax实现在线投票,10分钟实现Ajax Vote投票、评分功能(Stars)
href=“JavaScript:;”是啥意思?
11个基于HTML/CSS/JS的情人节表白可爱小游戏、小动画【情人节主题征文】
javascript:void(0);用法及常见问题解析
Python爬虫基本流程梳理:构造请求头、发起请求、json格式数据解码转码、读写CSV文件——基于AJAX网页爬虫
兰州园艺学校网站网址主页
鲜花配送网上花店网址,51788鲜花
原文链接: AJAX href ='#'浏览网址 https://www.huajiangbk.com/newsview1293674.html
| 上一篇: Cmake编译文件若需要手动添加 | 下一篇: Focus on Flowers |
推荐分享

- 1明日花キララ:明日花绮罗年度... 24098
- 2明日花キララ(明日花绮罗)经... 14108
- 3家庭养花知识大全 家庭养花有... 9520
- 4家庭养花风水知识 家庭养花“... 9234
- 5兰花叶子扭的是什么兰 8805
- 6君子兰什么品种最名贵 十大名... 8180
- 7五月天婷婷开心六月丁香:音乐... 8123
- 8十大致癌花卉排行榜,哪些花卉... 7801
- 9秋天养花,掌握这5点养花知识... 7770
- 10【花卉知识 】养花须知:新手... 7372




