Connecting Tech Pros Worldwide Forums | Help | Site Map

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

ehm
Guest
 
Posts: n/a
#1: Jul 20 '05
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>

Martin Honnen
Guest
 
Posts: n/a
#2: Jul 20 '05

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




ehm wrote:
[color=blue]
> 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>[/color]

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/

ehm
Guest
 
Posts: n/a
#3: Jul 20 '05

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


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.
[color=blue]
> 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[/color]
Richard Cornford
Guest
 
Posts: n/a
#4: Jul 20 '05

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


"ehm" <kamehm@earthlink.net> wrote in message
news:26802d66.0402130809.5f553034@posting.google.c om...
<snip>[color=blue]
> 2. I noticed that Richard Cornford had had a similar
>problem awhile back.[/color]
<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.


Closed Thread