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胡椒木盆景从上盆制作到养护,... 74369
- 2明日花キララ:明日花绮罗年度... 54315
- 3明日花キララ(明日花绮罗)经... 31508
- 4五月天婷婷开心六月丁香:音乐... 20535
- 5兰花叶子扭的是什么兰 18746
- 6仙人球“水蜜桃”—又美又仙,... 18102
- 7十大致癌花卉排行榜,哪些花卉... 16697
- 8超简单,3个步骤带你学会毛线... 16124
- 9老师精选05—河北彩花(出道... 15651
- 10李晓明工笔牡丹(魏紫)《牡丹... 14969




