简体   繁体   中英

Is there any way to redirect my page on given href link without loading

this is my html

<a href="http://127.1.1.0:8001/gembead/emstones.html?car=36">Car</a>

Basically i want to redirect to this page with parameter but i dont want my page to load. How can i do this. I am sure there will be a solution for this.

Try this (+info here ):

 function withoutLoading(url) { window.history.replaceState(null, null, url); }
 a { cursor: pointer; }
 <a onclick="withoutLoading('/gembead/emstones.html?car=36')">Car</a>

如果您想在不重新加载当前页面的情况下重定向到新链接,则必须在按钮或锚选项卡的 onclick 事件上使用window.hostory.push('url')window.hostory.replace('url') .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM