Webmaster Forum


Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Coding Forum Problems with your code? Let's hear about it.

Lionsanime Directory   Improve your ranking, submit to directories   V7N Directory

Reply
 
LinkBack Thread Tools Display Modes
Old 01-29-2007, 05:47 PM   #1 (permalink)
Contributing Member
 
Join Date: 05-02-04
Posts: 166
iTrader: 0 / 0%
thing2b is liked by many
Dynamically creating links in Javascript

What I am attempting to do is to convert all <span class="clickable"> tags into clickable links. It is odd that with all the SEO sites around, that nothing like this has been mentioned.

The original code I have is:
Code:
<span class="clickable">Link Text</span>
I am trying to get client-side javascript to convert this on the fly to:
Code:
<span class="clickable"><a href="/archive/link+text">Link Text</a></span>
With the url generated from the link text and put the javascript equivilent of the PHP functions "StrToLower" and "UrlEncode".

Any ideas on how to do this or pointers in the right direction will be worshipped...
__________________
Webmaster of http://pickbrains.com/
thing2b is offline  
Add Post to del.icio.us
Reply With Quote
Sponsored Links
SEO Hosting by HostGator  Advertise Here  Buy Blog Links
Old 01-30-2007, 08:51 AM   #2 (permalink)
v7n Mentor
 
Taltos's Avatar
 
Join Date: 11-22-06
Location: Phoenix, AZ
Posts: 1,788
iTrader: 0 / 0%
Latest Blog:
None

Taltos is a highly respected web proTaltos is a highly respected web proTaltos is a highly respected web proTaltos is a highly respected web proTaltos is a highly respected web proTaltos is a highly respected web proTaltos is a highly respected web proTaltos is a highly respected web proTaltos is a highly respected web proTaltos is a highly respected web proTaltos is a highly respected web pro
Send a message via Yahoo to Taltos
Can't you use "innerHTML" from javascript to do this. You should be able to use DOM to locate all the class you are looking for. Then use innerHTML to change to content of the anchor tag. Don't have time to cobble together code right now. Sorry.
__________________
Experimenting
Taltos is offline  
Add Post to del.icio.us
Reply With Quote
Old 01-30-2007, 11:57 AM   #3 (permalink)
Contributing Member
 
Izzmo's Avatar
 
Join Date: 11-01-03
Location: Kansas City
Posts: 1,007
iTrader: 0 / 0%
Latest Blog:
None

Izzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to behold
Send a message via ICQ to Izzmo Send a message via AIM to Izzmo Send a message via MSN to Izzmo Send a message via Yahoo to Izzmo
What's the point of doing this?

That is a very bad SEO practice btw since you will be conducting 0 outbound linkage, and well, no one will like you in the process.

Also, Google doesn't 'like' JavaScript, so it doesn't view it, and you may run into another problem with that all together.
__________________
~Izzmo
ZeroWeb Hosting & Design - Customizable hosting for every type of user!
Izzmo is offline  
Add Post to del.icio.us
Reply With Quote
Old 01-30-2007, 12:22 PM   #4 (permalink)
Contributing Member
 
Join Date: 05-02-04
Posts: 166
iTrader: 0 / 0%
thing2b is liked by many
Quote:
Originally Posted by Izzmo View Post
What's the point of doing this?

That is a very bad SEO practice btw since you will be conducting 0 outbound linkage, and well, no one will like you in the process.

Also, Google doesn't 'like' JavaScript, so it doesn't view it, and you may run into another problem with that all together.
No. This would only be a bad SEO practice if I was to apply it to all links.
Yes, I know Google does not read JavaScript. That is the whole idea.
Plus I want the links to disappear if someone has JavaScript turned off.
__________________
Webmaster of http://pickbrains.com/
thing2b is offline  
Add Post to del.icio.us
Reply With Quote
Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum

Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Does google see links in javascript? lucia Google Forum 7 07-10-2007 01:38 PM
how do i create a javascript code that allows me to add links kf9211 Coding Forum 18 01-26-2007 05:16 PM
Getting Rid of Javascript Links Basicskills Coding Forum 8 04-14-2006 04:01 PM
Using dynamically built links digitman SEO Forum 12 10-11-2004 08:56 AM
Creating links in phpBB?? spidersam Coding Forum 2 03-17-2004 09:11 AM


Sponsor Links
Get exposure! Get exposure! Find Scripts Web Hosting Directory Get exposure! SEO Blog


All times are GMT -7. The time now is 04:43 AM.
© Copyright 2008 V7 Inc