如何将当前URL添加到A HREF [英] How to add current url to A HREF

查看:96
本文介绍了如何将当前URL添加到A HREF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你可以帮助我,我有200页,我想添加一个自定义的Facebook分享按钮,但问题是我需要添加所有这些网址分享按钮。有没有办法自动将页面网址添加到下面的代码中,它说CURRENT URL GOES HERE。





 <   li     class   =  facebook >   <   a     href   =  http://www.facebook.com/share.php?u=CURRENT网址在这里    target   =  _ blank >  <   / a  >  <   /立 >  

解决方案

是的,你可以用更换功能的帮助。



查看演示 - [演示]替换Href锚点[ ^ ]了解它是如何完成的。



这里锚中的 CURRENT_URL_GOES_HERE 被CodeProject Url取代。


HI could you help me please I have like 200 pages and I want to add a custom facebook share button but the problem is I will need to add all those urls to share button. Is there a way to automatically add page url to the the code below wher it say "CURRENT URL GOES HERE".


<li class="facebook"><a href="http://www.facebook.com/share.php?u=CURRENT URL GOES HERE" target="_blank"> </a></li>

解决方案

Yes, you can do it with the help of replace function.

Check the demo - [Demo] Replace Href of Anchor[^] to know how it is done.

Here the "CURRENT_URL_GOES_HERE" inside the anchor gets replaced with the CodeProject Url.


这篇关于如何将当前URL添加到A HREF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆