|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Email parsing
I did a search but couldn't find it. There was a thread that had different options on "hiding" one's email from those "undesirables" by parsing it. The most simple one was:
<script type="javascript/text"> <!-- emailname = "spargoman" emailserver = "spargoman.com" document.write("<a href='mailto:" + emailname + "@" + emailserver + "'>"); document.write(emailname + "@" + emailserver); document.write("</a>"); //--> </script> But when put on the page, it doesn't display anything. Am I missing something here? Thanks -Jim |
|
#2
|
||||
|
||||
|
this line: <script type="javascript/text">
is wrong. replace it with this line: <script language="javascript"> |
|
#3
|
||||
|
||||
|
Quote:
Thanks, that did it. Is there a way to format the link? I'm linking to external CSS, but it doesn't seem to carry through to it. The default blue doesn't look good on the black background. Thanks again, -Jim |
|
#4
|
||||
|
||||
|
yep... simply add css class to the link:
document.write("<a class='mylink' href='mailto:" + emailname + "@" + emailserver + "'>"); and in the css file: .mylink {color: pink;} .mylink:visited {color: yellow;} .mylink:hover {color: purple;} ![]() |
|
#5
|
||||
|
||||
|
Quote:
Awesome....Thanks again. |
|
#6
|
||||
|
||||
|
Actually, <script type="text/javascript"> is correct (in the example above it was backwards). Adding language="Javascript" has been deprected. Not one of the forms on any of my pages has language= anything.
__________________
If you found a post of mine helpful, please click on the on my post to add to my reputation.
|
|
#7
|
||||
|
||||
|
well, I never used the type attribute, only language and it always worked for me, and on the other hand type=... didn't work ==> I concluded you must use the language attribute.
so in xhtml <script language="javascript"> won't be recognized as javascript code?? if so, it's really bad, not only for me... 90% of the code I see is like this. |
|
#8
|
||||
|
||||
|
The reason type= didn't work for OneRedLT4 is because they had javascript/text instead of text/javascript. Otherwise it works.
That is correct that in XHTML, language="Javascript" doesn't work anymore. It's just not needed. Also, I wouldn't consider it really bad because 99.9% of websites are not XHTML compliant anyway so those 99.9% of sites will have to update once the browsers officially stop supporting HTML which is supposed to happen in the next few years according to knowledgable sources. Usually if people are XHTML compliant they know to use the type attribute exclusively in the script tag. Removing the script attribute is a minor change in comparison to the change from HTML to XHTML 1.1 |
![]() |
| Viewing: ASP Free Forums > Programming > HTML, JavaScript And CSS Help > Email parsing |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|