hyperlink

Best practice: How to track outbound links?

心已入冬 提交于 2020-01-29 05:12:12
问题 How do you track outbound links for your web site, since the request is logged on the destination server, not yours? 回答1: You can add a quick JQuery script to the page that will track external links and can either redirect them to a file on your server that will track the link and then forward to it, or add an ajax request that will submit on click for external links, and track them that way. See here: http://www.prodevtips.com/2008/08/19/tracking-clicks-with-jquery-and-google-analytics/ and

Best practice: How to track outbound links?

我与影子孤独终老i 提交于 2020-01-29 05:12:09
问题 How do you track outbound links for your web site, since the request is logged on the destination server, not yours? 回答1: You can add a quick JQuery script to the page that will track external links and can either redirect them to a file on your server that will track the link and then forward to it, or add an ajax request that will submit on click for external links, and track them that way. See here: http://www.prodevtips.com/2008/08/19/tracking-clicks-with-jquery-and-google-analytics/ and

How do I run PHP code when a user clicks on a link?

南笙酒味 提交于 2020-01-26 08:48:35
问题 I want to have a page run some PHP code when a user clicks on a link, without redirecting them. Is this possible with <a href=""></a> or with the javascript onclick event? 回答1: Yeah, you'd need to have a javascript function triggered by an onclick that does an AJAX load of a page and then returns false, that way they won't be redirected in the browser. You could use the following in jQuery, if that's acceptable for your project: <script type="text/javascript" src="jquery.min.js"></script>

How do I run PHP code when a user clicks on a link?

跟風遠走 提交于 2020-01-26 08:47:35
问题 I want to have a page run some PHP code when a user clicks on a link, without redirecting them. Is this possible with <a href=""></a> or with the javascript onclick event? 回答1: Yeah, you'd need to have a javascript function triggered by an onclick that does an AJAX load of a page and then returns false, that way they won't be redirected in the browser. You could use the following in jQuery, if that's acceptable for your project: <script type="text/javascript" src="jquery.min.js"></script>

Convert plain text URLs into HTML hyperlinks in PHP

折月煮酒 提交于 2020-01-26 08:46:54
问题 I have a simple commenting system where people can submit hyperlinks inside the plain text field. When I display these records back from the database and into the web page, what RegExp in PHP can I use to convert these links into HTML-type anchor links? I don't want the algorithm to do this with any other kind of link, just http and https. 回答1: Here is an other solution, This will catch all http/https/www and convert to clickable links. $url = '~(?:(https?)://([^\s<]+)|(www\.[^\s<]+?\.[^\s<]+

Dynamically change iframe's content

南楼画角 提交于 2020-01-25 20:03:51
问题 I have an iframe tag and I want to dynamically change it using jquery animation. So for example the iframe sits on the home page, and if i click the about link, it will load the about.html and when its ready it will slide it down using animation. I have the basic logic for it but then came about this problem: When I refresh the page it loads back the content of the index.html page, and what I want is that when I refresh it, it still keeps the contents of about.html. <a href="about.html"

Dynamically change iframe's content

大城市里の小女人 提交于 2020-01-25 20:00:39
问题 I have an iframe tag and I want to dynamically change it using jquery animation. So for example the iframe sits on the home page, and if i click the about link, it will load the about.html and when its ready it will slide it down using animation. I have the basic logic for it but then came about this problem: When I refresh the page it loads back the content of the index.html page, and what I want is that when I refresh it, it still keeps the contents of about.html. <a href="about.html"

How to open a link referencing to a file system

对着背影说爱祢 提交于 2020-01-25 12:55:46
问题 How i will open the following link <a href=file:///blablabla/folder>Open folder</a> It is not opening on clicking the anchor. I mean to say that if we want to access shared folder. Like from \192.168.10.1\XYZ, then. 回答1: Are you specifying an absolute path? For example, the following will work fine in Windows: <a href="file:///C:\MyFolder">Open folder</a> Note also that you missed the quotes around the folder path. 回答2: The file: <a href=file:///tmp>Open folder</a> works fine for me under

Browser automatically adds <a>-Tag without JavaScript

安稳与你 提交于 2020-01-25 11:46:07
问题 I just ran into a problem on a bit bigger site than in the example below which caused me to investigate for several hours until I found the cause of the bug. My problem was, that the Browser automatically spawned <a> -Tags for no reason. Let's say I've some HTML code that looks like this: <a href="#">Link<a/> <!-- Some code-magic; after a while you have something like: --> <div>Not a link</div> Of course the problem is pretty obvious in this case. But if the page is a bit more complex and you

how to make asp.net hyperlink to stop encoding the urls?

有些话、适合烂在心里 提交于 2020-01-25 09:57:05
问题 I have got a BulletedList with DisplayMode="HyperLink" . <asp:BulletedList runat="server" DisplayMode="HyperLink" ID="LevelsList"></asp:BulletedList> I add items to the list with this code: LevelsList.Items.Add(new ListItem(curSubPage.PageName, curSubPage.shortURL)); The URL links contain Hebrew strings and they get encoded: The markup the the asp.net generates is something like that: <a href="%d7%91%d7%a0%d7%99%d7%99%d7%aa_%d7%90%d7%a4%d7%9c%d7%99%d7%a7%d7%a6%d7%99%d7%95%d7%aa_%d7%90%d7%99