Click to See Complete Forum and Search --> : JavaScript Links Showing in Status Bar


Pyrocandy
07-09-2003, 11:01 AM
I was just wondering if someone could help me. I am working on a clients site and I am using JavaScript Links throughout. For search engine reasons we would like to keep the javascript links however my client would like the links to appear exactly has html ones.

This includes having the url appear in the status bar. Currently we have

<A href=# class=navlinksbot onclick="window.location='http://www.google.com';">Google.com</A>

Does anyone know what code I add to make the URL appear in the status bar?

Thanks

Moe

Vladdy
07-09-2003, 11:06 AM
So your site would be pretty much useless to everyone without javascript? :rolleyes:
... onmouseover="window.status = 'text'"....

cyborg
07-09-2003, 11:11 AM
if they don't have javascript, they don't deserve to see the website :D

Vladdy
07-09-2003, 11:15 AM
Originally posted by cyborg
if they don't have javascript, they don't deserve to see the website :D
I would rephrase it as:
If you do not have knowledge of the subject, you don't deserve the right to voice your opinion :D :D

Pyrocandy
07-09-2003, 11:15 AM
The main navigation is readable by those without Javascript enables however some of the other links we would like to have Javascript.

Vladdy: I tried the "onnmouseover="window.status..." stuff and it doesn't work because of the 'href=#' code. That part is needed so the stylesheet takes effect.

Any other ideas?

Thanks

Moe

Vladdy
07-09-2003, 11:59 AM
Ok, I got you now...
Since you are using javascript to load the page, why do you need the <a> element at all (other than IE hover effect)?
Use <span class="jslink" onclick="..." onmouseover="...">
and if you need hover effect for IE add the class change with onmouseover/onmouseout....

Now, can you expain to me WHY are you doing it at all, I do not understand what the problem with search engines may be....

Pyrocandy
07-09-2003, 12:05 PM
As you may or may not most search engines cannot spider javascript links. In order to keep them from seeing outgoing links and therefore reducing relevancy of the page we use javascript links. It is nice solution.

The only problem is how do we get it to appear exactly as it would before. Including underlining, cursor changing and url in status bar.

As I'm not an experience javascript programmer (yet), i was using a stylesheet to do the underline and cursor change.

Could you show me how to do the span thingy??

Thanks so much for your help

Moe

Vladdy
07-09-2003, 12:54 PM
There is nothing nice about this solution, as it creates more problems than it solves.

If you want to prevent search engine robots from indexing certain files, use robots.txt or appropriate meta tags:
http://www.w3.org/TR/html401/appendix/notes.html#h-B.4.1

span is a generic inline element. Define one class with the same properties as you anchor element:
a, span.jslink
{ /*style definition here*/
}
to make the contents of span element with class set to "jslink" appear the same as your anchor elements.