Anyone know how we create a ajax link when we click any href link or input / button, it's work in ajax?
带有jQuery的html中的Ajax链接
- 写回答
- 好问题 0 提建议
- 关注问题
- 邀请回答
-
1条回答 默认 最新
weixin_33712881 2018-07-06 01:48关注You have to
event.preventDefault()in your event handler to prevent the browser from trying to browse to the link. Other than that it should be business as usual.$(document).on("click", "a,input,button", function(event){ event.preventDefault(); $.ajax(...); });解决 无用评论 打赏 举报