dongshie8450 2017-03-09 17:54
浏览 117

没有跟踪源网页的链接[重复]

This question already has an answer here:

I am working on a web with php (laravel 5.4) and I have to generate several links that the user clicking on them does not let you know that the click originated from my web page. The idea is that it seems that the user wrote the link directly in the browser, and that does not relate in any way that clicked from my website. how can I do it? Thanks for your help.

</div>
  • 写回答

1条回答 默认 最新

  • dpub33855 2017-03-09 18:04
    关注

    You can do that using javaScript. You need to define a function that accepts a url as parameter and calls the javascript window.open().

    Make a regular tag and in its href attribute pass javascript:void(0); so that the default link click action is stopped.

    Now define an attribute onClick and call your defined function here and pass the url you want to open.

    Please see the example below:

    <script type="text/javascript">
    function openURL(url)
    {
    window.open(url);
    }
    </script>
    <a href = "javascript:void(0);" onClick="openURL('http://google.com');">GOOGLE</a>

    </div>
    
    评论

报告相同问题?

悬赏问题

  • ¥20 win11修改中文用户名路径
  • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入
  • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计
  • ¥70 PlayWright在Java上连接CDP关联本地Chrome启动失败,貌似是Windows端口转发问题
  • ¥15 帮我写一个c++工程
  • ¥30 Eclipse官网打不开,官网首页进不去,显示无法访问此页面,求解决方法
  • ¥15 关于smbclient 库的使用
  • ¥15 微信小程序协议怎么写
  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害