Href链接与OnClick事件 [英] Href link with OnClick event

查看:131
本文介绍了Href链接与OnClick事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个如下所示的链接 在单击该Twitter的位置时,我需要使用$ markme_ddesc中给出的消息打开Twitter页面,但是当我单击链接时,它只是移至twitter.com而不在新窗口中打开并显示该消息. /p>

i am having a link like below where on click of that twitter , i need to open the twitter page with the message given in $markme_ddesc but instead when i click on the link , it simply moves to twitter.com without opening in a new window and with the message..

<a style="text-decoration:none;" href="http://www.twitter.com" onclick="window.open(\'http://twitter.com/home/?status=\'+encodeURIComponent(location.href)+\'-'.$markme_ddesc.'\');return false;">

为什么呢?该如何解决呢?请帮助我.

Why so? how to resolve this?? Please help me..

推荐答案

尝试:

<a style="text-decoration:none;" href="http://www.twitter.com" onClick="window.open('http://twitter.com/home/?status=\'+encodeURIComponent(location.href)+\'-'.$markme_ddesc);return false;">

这篇关于Href链接与OnClick事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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