homepage Welcome to WebmasterWorld Guest from 174.129.103.100
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

    
Removing spaces from an a href line
lostimewaiting




msg:4684179
 5:28 pm on Jul 1, 2014 (gmt 0)
Hey - I'm looking for a way to remove spaces from a <a href> tag.

I am wondering if there is anyway to code a link with spaces (or null identifiers) that will drop once the link is clicked - for example.. for more complicated reasons I cannot use www or .com in the <a href> link as it will not be read properly in the field it is being submitted.. I need to be able to write it something like:

<a href="ww w.mylink . com">

With spaces in such places or some other identifier - but when the link is clicked it needs to be read

www.mylink.com

without any spaces..

You have probably guessed that the original link would be read ww%20w.mylink%20.%20com I need the spaces removed but NOT replaced with %20.. how can I do this?

 

penders




msg:4684196
 6:23 pm on Jul 1, 2014 (gmt 0)

JavaScript will need to run when the element is clicked, or when the resulting page is loaded - can you run some (custom) JavaScript?! Note also, that you need "http://" at the start of the URL.

lucy24




msg:4684215
 7:34 pm on Jul 1, 2014 (gmt 0)

I think it would be useful to explain the backstory. There may be some alternative way of getting to the result you want. There's definitely nothing you can do in HTML alone.

the original link would be read ww%20w.mylink%20.%20com

This detail may in fact depend on the browser. Camino quietly eats any spaces in an URL; Safari doesn't.

lostimewaiting




msg:4687889
 12:50 pm on Jul 15, 2014 (gmt 0)

Maybe it is for the best - I wanted to use html to link to my guild's homepage via the in game chat in an online browser game... I figured out that I can use html to change colors and even make a link.. However the chat censors phrases like www and .com so I was needing to be able to write ww w and . com with spaces etc... I'm beginning to feel like their censors did not want this to occur which is why Im having so much trouble cheating it - so like I said maybe its for the best - we shouldn't aim to beat the censor in any game or chat...

penders




msg:4687914
 2:04 pm on Jul 15, 2014 (gmt 0)

I'm beginning to feel like their censors did not want this to occur which is why Im having so much trouble cheating it


Exactly. Spammers are constantly trying to post links to their products - so it is often something that is crippled in user submitted data. Even if you did manage to "cheat it", it is unlikely to benefit you SEO wise (if that was the intention?).

lostimewaiting




msg:4689481
 1:15 pm on Jul 21, 2014 (gmt 0)

-

[edited by: lostimewaiting at 1:16 pm (utc) on Jul 21, 2014]

lostimewaiting




msg:4689482
 1:15 pm on Jul 21, 2014 (gmt 0)

nah nothing that interesting (lol) I just wanted to be able to put a nice little recruitment message with a link to my gamer guild's home page - I'll give up on it - as I said we shouldn't aim to beat any censor they are likely there to protect someone or their assets.... best to help offer that protection than to be a hinderance I suppose =)

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / HTML
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved