Html or Javascript Links?

Namecheap AuctionsNamecheap Auctions
SpaceshipSpaceship
SpaceshipSpaceship
Watch

Ookie

Established Member
Impact
13
Hey,

Just wondering which you guys prefer when coding menus?

location.href='site'

and link the whole div

or ahref

and just link the text?
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
You'll sometimes run into people who have javascript disabled. If your menu is completely JS, you can go with the location.href. However, I'm fairly sure it's still considered good practice (especially if you're doing any strict work) to use <a> tags. The latter is my personal preference.


Bruce
 
0
•••
Depends on what you are doing. When you are opening something in a new window, I would go with javascript. XHTML doesn't support the target part of a link tag.
 
0
•••
Always avoid javascript and use HTML links when possible.
This is for SEO purposes too.
It's difficult for the search engines to traverse JS links.
 
0
•••
Always avoid javascript and use HTML links when possible.
This is for SEO purposes too.
It's difficult for the search engines to traverse JS links.

Not when you have a sitemap as well as the google sitemap. There are pros and cons to each. And always make sure you have a backup for when people don't have javascript enabled. I would agree that static links would be best for the most part though.
 
0
•••
Appraise.net

We're social

Escrow.com
Spaceship
Escrowly
CryptoExchange.com
Domain Recover

NamePros updates

Parking: find your domains by pasting a list
You can now paste a list of domain names into the search box at the top of the Parking menu. Put one name on each line. Your domain list...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back