By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,607 Members | 1,983 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,607 IT Pros & Developers. It's quick & easy.

Problem with "@" symbol in anchor text...

P: n/a
ehm
I have encountered an issue that has me totally confused. I have a
page where the user clicks on a hyper-text link and is then directed
towards another page (passing additional variables, etc.). If the
anchor text does not contain the "@" symbol, clicking on the link
works in a normal fashion. However, if the anchor text is something
like "foo@test", then clicking on the text displays the full URL
(still goes to the correct link, but I don't want the URL displayed).
I've also tried substituting the "@" symbol with its decimal
equivalent, but no luck.

Essentially, in my case I am trying to pass additional variables
that will allow the user to navigate more freely within my WebLogic
application (these variables are not initially available to the
original URL, but are appended once the user clicks on the link). Any
help or input would be appreciated.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<BODY>

<A onClick="testFoo(this)" HREF="http://www.cnn.com">foo@test</A></TD>
<BR>
<BR>
<A onClick="testFoo(this)" HREF="http://www.cnn.com">footest</A></TD>
<BR>
<BR>

<SCRIPT>
function testFoo(selectedObject) {
selectedObject.href +=
"/2004/US/South/02/11/elderly.robber.ap/index.html";
} // testFoo
</SCRIPT>

</BODY>
</HTML>
Jul 20 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a


ehm wrote:
I have encountered an issue that has me totally confused. I have a
page where the user clicks on a hyper-text link and is then directed
towards another page (passing additional variables, etc.). If the
anchor text does not contain the "@" symbol, clicking on the link
works in a normal fashion. However, if the anchor text is something
like "foo@test", then clicking on the text displays the full URL
(still goes to the correct link, but I don't want the URL displayed).
I've also tried substituting the "@" symbol with its decimal
equivalent, but no luck.

Essentially, in my case I am trying to pass additional variables
that will allow the user to navigate more freely within my WebLogic
application (these variables are not initially available to the
original URL, but are appended once the user clicks on the link). Any
help or input would be appreciated.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<BODY>

<A onClick="testFoo(this)" HREF="http://www.cnn.com">foo@test</A></TD>
<BR>
<BR>
<A onClick="testFoo(this)" HREF="http://www.cnn.com">footest</A></TD>
<BR>
<BR>

<SCRIPT>
function testFoo(selectedObject) {
selectedObject.href +=
"/2004/US/South/02/11/elderly.robber.ap/index.html";
} // testFoo
</SCRIPT>


Strange, that strange bug has never occured to me, and now two different
people seem to post about it in two different newsgroups at about the
same time.
I have just suggested to use

function changeLink (link, newHref) {
var oldInnerText = link.innerText;
link.href = newHref;
if (link.innerText != oldInnerText) {
link.innerText = oldInnerText;
}
}

as a workaround for that IE problem, so
changeLink (selectObject,
"/2004/US/South/02/11/elderly.robber.ap/index.html");
should help

--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #2

P: n/a
ehm
Martin,

Thanks for the response. Your solution worked perfectly.

Regarding the double post, I have two separate accounts created at
two different times. I posted the original question on another
newsgroup on 6 Feb, but hadn't gotten any responses after 7 Feb. I
then posted on this newsgroup for three separate reasons:
1. Second set of eyes.
2. I noticed that Richard Cornford had had a similar problem awhile
back.
3. I had waited four days for a response on the other newsgroup
without any other responses.

Sorry for the breach of newsgroup etiquette, but I thought that I
had waited lnog enough for a response from the other group. Once
again, thanks for the help.
Strange, that strange bug has never occured to me, and now two different
people seem to post about it in two different newsgroups at about the
same time.
I have just suggested to use

function changeLink (link, newHref) {
var oldInnerText = link.innerText;
link.href = newHref;
if (link.innerText != oldInnerText) {
link.innerText = oldInnerText;
}
}

as a workaround for that IE problem, so
changeLink (selectObject,
"/2004/US/South/02/11/elderly.robber.ap/index.html");
should help

Jul 20 '05 #3

P: n/a
"ehm" <ka****@earthlink.net> wrote in message
news:26**************************@posting.google.c om...
<snip>
2. I noticed that Richard Cornford had had a similar
problem awhile back.

<snip>

It wasn't my problem, I was trying to help someone else who had a
similar (probably the same) problem. But at the time I couldn't
re-produced it and the OP then stopped providing feed-back so it was
unresolved.

Richard.
Jul 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.