Say I don't want Google to follow my links, or even notice them as links, will simply replacing the a href with an onclick location suffice?
Does Google still treat onclick location as a link? Or do they ignore it?
rel="nofollow" will do it. Google treats that right and won´t follow the link. But noticing isn´t suppressed with that solution. Perhaps don´t post it as a link... even JS will do a good job I think.
rel="nofollow" will prevent google from using it in their pagerank algorithm, but won't prevent them from following the link. To prevent them from accessing content on your site you should use robots.txt.
Related
I am using a local server for my applications and sometimes when I created a button or a link to another page in a new tab, it turns out to not working properly. It's not always like this, but sometimes, might sound silly. I give example below.
Let's say my application is **programmingworld** which exists in www folder, then in index.html file, I create a link for a button like this
Download Codes</div>
When I open it in a browser and click the button, sometimes it goes to http://localhost/programmingworld/www.google.co.uk where nothing is displayed on the page. It supposed to be www.google.co.uk in the new tab where I can see the google homepage.
Can you please tell me why?
You should write:
Download Codes</div>
If you didn't write http:// at the the beginning of the hyperlink, it will be search you your local directories or files.
To make sure that the link goes to where you intend and not where it goes try adding // or http://.
Example:
Google
or
Google
With // it will try http and https.
You're missing https:// before www.google.co.uk
So you're markup should look like this:
<a href="https://www.google.co.uk">
<div class="button" id="button=popup">Download Codes</div>
</a>
you can also do it like this (no https):
<a href="//google.co.uk">
<div class="button" id="button=popup">Download Codes</div>
</a>
Because you haven't included the protocol in your URL. it must start with either http:// or https://
Also, remove the div from inside the anchor tag.
Your question suggests that you need to do a little bit more testing on basic html.
I would most definitely suggest using https://
I've had similar problems such as that, and in order to fix them try adding https.
To link a page to itself (e.g. http://example.com/folder/ThisPage.html), we can simply create a href as such:
ThisPage.html:
Link
This works, but has the disadvantage of needing to be updated when the file name changes. For example, if the file name changes to ThatPage.html, our href needs to change accordingly to Link.
I'm looking for an alternative without that disadvantage. I've tried:
Link
Doesn't work as Link does, because it appends a "blank query part" (question mark) to the URL.
Link
Doesn't work as Link does, on some browsers (e.g. Opera).
How do we link a page to itself, without having to update the relevant portion when the name of the page changes?
Note: JavaScript not allowed.
Just use Link. Nobody cares about the question mark appended to the URL. It does the requirement and that is what counts right?
It's very simple, just leave the href="" blank. So that's how:
Click me to refresh page
But this is not necessarily a good idea, because the cache may not be cleared, and whatever you need it for, if the page has changed in the meantime the change may not appear despite the reload. Probably a better idea is the javascript code location.reload(); to take. But there are enough explanations on other sites, which is why I won't explain it here. You can of course also for example take a question mark (?), but this is unnecessary, actually not intended for it and can cause problems depending on the program.
Here is a short list of common hyperlinks:
Points to the root page
Link
Points to a file relative to the root page
Link
Points to a file relative to the current file
Link
Points to a file in the previous folder
Link
Points to a file in the second previous folder
Link
Points to a file in a folder below
Link
Points to the current file
Link
Points to a page with a different host but the same protocol
Link
I hope that my answer will help some people, because I found it via a search engine and saw that there is no correct answer. And it's my first answer here 😅
If you want it to go nowhere, you can use
link
But if you want it to reload the page, you'll have to go with JavaScript.
If you want to reload the page you could use the Meta refresh tag
http://www.w3.org/TR/WCAG20-TECHS/H76.html
If you want to reload the page, you really should take a look into javascript. It is the best way to do it.
Just do this:
This Very Site
Source: I saw this in the source code of Matthew Alger's website. Check it out for yourself!
Why not try ?
I looked some things up, and as it turns out, ./ refers to current directory.
You can just make a link to the same page.
Here ya go. Hope this is what you are looking for
Link
I have the following:
Overview
Review
When I am on the overview page I want to make it so that clicking the overview address link does nothing. Something like disable for a button. Is this possible for an address link?
This should do it:
Overview
Of interest may also be nofollow:
Overview
The easiest way to disable a link is probably to remove the href value.
If you are rendering this from MVC, simply don't include the <a> tag.
It's a little unclear what is best for what you're trying to do.
Add 'return false' to prevent linking:
Overview
Just use a # sign in the href like so: Overview
You could do this with a layer of javascript on top of each page: your JS script would run and check all the links on the page -- if the link is the same as the page you are on then simply "hijack" the anchor by adding an onclick event which does nothing and doesn't bubble up the event.
This was you still pump out from your server side all the links -- and the script would be the same for all the pages, thus allowing it to be cached by the browser and only loaded once (assuming you place it in an external .js file).
You can try <a class="inactive" href="#">Overview</a> and give it some CSS to show it's a different type of link.
I'm pretty sure that many people have thought of this, but for some reason I can't find it using Google and StackOverflow search.
I would like to make an invisible link (blacklisted by robots.txt) to a CGI or PHP page that will "trap" malicious bots and spiders. So far, I've tried:
Empty links in the body:
<a href='/trap'><!-- nothing --></a>
This works quite nicely most of the time, with two minor problems:
Problem: The link is part of the body of the document. Even though it is pretty much unclickable with a mouse, some visitors still inadvertently hit it while keyboard-navigating the site with Tab and Enter. Also, if they copy-paste the page into a word processor or e-mail software, for example, the trap link is copied along and sometimes even clickable (some software don't like empty <a> tags and copy the href as the contents of the tag).
Invisible blocks in the body:
<div style="display:none"><a href='/trap'><!-- nothing --></a></div>
This fixes the problem with keyboard navigation, at least in the browsers I tested. The link is effectively inaccessible from the normal display of the page, while still fully visible to most spider bots with their current level of intelligence.
Problem: The link is still part of the DOM. If the user copy-paste the contents of the page, it reappears.
Inside comment blocks:
<!-- <a href='/trap'>trap</a> -->
This effectively removes the link from the DOM of the page. Well, technically, the comment is still part of the DOM, but it achieves the desired effect that compliant user-agents won't generate the A element, so it is not an actual link.
Problem: Most spider bots nowadays are smart enough to parse (X)HTML and ignore comments. I've personally seen bots that use Internet Explorer COM/ActiveX objects to parse the (X)HTML and extract all links through XPath or Javascript. These types of bots are not tricked into following the trap hyperlink.
I was using method #3 until last night, when I was hit by a swarm of bots that seem to be really selective on which links they follow. Now I'm back to method #2, but I'm still looking for a more effective way.
Any suggestions, or another different solution that I missed?
Add it like you said:
<a id="trap" href='/trap'><!-- nothing --></a>
And then remove it with javascript/jQuery:
$('#trap').remove();
Spam bots won't execute the javascript and see the element, almost any browser will remove the element making it impossible to hit with tabbing to it
Edit: The easiest non-jQuery way would be:
<div id="trapParent"><a id="trap" href='/trap'><!-- nothing --></a></div>
And then remove it with javascript:
var parent = document.getElementById('trapParent');
var child = document.getElementById('trap');
parent.removeChild(child);
this solution seems to work well for me, luckily i have bookmarked it. I hope it helps you as well.
you can create a hidden link like this and put it at the very top left of your page and to prevent regular users from accessing it too easily you can use css to lay a logo image over this image.
<img src="images/pixel.gif" border="0" alt=" " width="1" height="1">
if you are interested in setting up how to blacklist the bots refer to this link for detailed explaination of howto.
http://www.webmasterworld.com/apache/3202976.htm
While i was inspecting facebook html code through with firebug in Chrome, i found this tag :
<a href="http://www.facebook.com/?ref=logo" title="Home" bitly="BITLY_PROCESSED"/>
What is the bitly attribute? Anyone has an idea?
:)
It gets added by the bit.ly plug-in (and perhaps some others) when it examines links (see http://bit.ly/pages/tools form more on that). If you don't have that plug-in yoruself, then it may be that someone somewhere along the line did.
bit.ly offers URL redirection service with real-time link tracking, or in other words URL shortener, so I am guessing you have it's plugin installed.