Computing.Net > Forums > Web Development > links javascript instead of html

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

links javascript instead of html

Reply to Message Icon

Name: mikag
Date: May 11, 2006 at 04:43:26 Pacific
OS: linux
CPU/Ram: Pentium
Product: AMD
Comment:

I would like to concentrate google's page rank in the index.php page of my site. That page has html links to the contact and about us pages. I don't want google rank going to those pages. I heard that spiders can't read javascripts and that would be perfect to 'hide' to the spider those outgoing links in the index.php while still being displayed to visitors in their Internet browsers.
Which simple javascript widget can I use for the links?
Thank you.



Sponsored Link
Ads by Google

Response Number 1
Name: Michael J (by mjdamato)
Date: May 11, 2006 at 11:37:30 Pacific
Reply:

Just use SPANs or DIV and include an onClick even like this:

<span onClick="document.location='http://www.yahoo.com';">Link</span>

Michael J


0

Response Number 2
Name: mikag
Date: May 12, 2006 at 06:19:38 Pacific
Reply:

Thanks, it works. My html 'a' css class has a hover version that changes the color of the 'Link' string. Can I simply do a <span class="a" onClick="...etc?
How can I make the cursor change from an arrow to a finger when hovering over the 'Link' text as the usual a href tags do?
Thanks again.


0

Response Number 3
Name: Michael J (by mjdamato)
Date: May 12, 2006 at 09:40:55 Pacific
Reply:

I think you mena that you have applied style to the 'a' elements. That is not the same as a class and youcan not do that.

You can create a specail class for those DIVs and SPANs to give it the same functionality that you have for your regulary hyperlinks (changes on hover and changes mouse pointer - the latter is not well supported on all browsers.) But, an easier solution would just to use the onClink event in your regularyhyperlinks instead of using DIVs and SPANs like so (Changed <> to [] for forum purposes):

[a href="#" onClick="document.location='http://www.yahoo.com';"]Link[/a]

You should also look into specific META tags on those pages which will tell search engines not to index them


Michael J


0

Response Number 4
Name: mikag
Date: May 14, 2006 at 11:02:17 Pacific
Reply:

Superb, thank you very much.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Web Development Forum Home


Sponsored links

Ads by Google


Results for: links javascript instead of html

linking javascript:launchVideo www.computing.net/answers/webdevel/linking-javascriptlaunchvideo/727.html

Use Javascript to insert html www.computing.net/answers/webdevel/use-javascript-to-insert-html/2333.html

Unwanted horizontal scrollbar www.computing.net/answers/webdevel/unwanted-horizontal-scrollbar/535.html