File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes HTML, CSS and JavaScript and the fly likes Attaching advertisements on links,(a href) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Attaching advertisements on links,(a href)" Watch "Attaching advertisements on links,(a href)" New topic

Attaching advertisements on links,(a href)

JasmineS Saeid

Joined: Jan 10, 2006
Posts: 18
Hi all,

There are many site presently that have the effect as the one pasted below.

The page gets rendered normally at first and then after a little while some normal text gets converted to links (<a href> ?

Curious to know if this is achieved by parsing the entire document thr Javascript in the 2nd pass and then deciding on some server o/p on which words (normal text) to show links ???

Contributions on this topic would be appreciated

Jasmine .
Niki Nono
Ranch Hand

Joined: Mar 20, 2005
Posts: 256
i think you have misinterpreted the situation.
The link that you are talking about are a hrefs from the start itself.
Their styles are altered to give it the illusion of text and when you take the mouse over it it becomes underlined and becomes link.
For more information do a view source on the page and analyse how they have done it. It could be very informative to view the source of a page which you feel is working magically.

Life called,so here I am.<br />Cheers<br />Niki.:-)
Paul Clapham

Joined: Oct 14, 2005
Posts: 19973

I had to start up Internet Explorer to see what you were talking about. If you look at the source for the page you will see that those strangely-underlined things are not <a href="..."> links at all. And if you look at the little box that pops up when you mouse over one of them, you'll see at the bottom right corner "what's this?". I believe that was your question. Have you tried clicking on that?
JasmineS Saeid

Joined: Jan 10, 2006
Posts: 18
Yes Exactly Paul,

Thanks for ur efforts of viewing the site to get my point.
Now u see Paul, the text is a normal text as seen after doing a "view source".

But this text is getting changed to have a mouse over which displays a small pop up window with the Add content(link). on clicking this link the user is directed to the advertiser's web site.
Any idea how this is accomplished ?
Eric Pascarello

Joined: Nov 08, 2001
Posts: 15385
If you would have glanced at the code you would have see this

TADA the magic....

I agree. Here's the link:
subject: Attaching advertisements on links,(a href)
It's not a secret anymore!