creating anchor tag with ajax onclick, simulating visited state

A

Andy

Hi,

I have an iframe in my page that holds internal documents. I am able
to create links from one page to another in that iframe, by using the
document.createElement('a') function, and then I set 'href' and/or
'onclick'.

The problem is that the browser does not go to an href page when the
tag is clicked but calls an ajax function that loads a page from my
database into the iframe. I tested the visited state of such a tag,
and it never changed to visited color after clicking and causing the
javascript function of the dynamic tag to execute. I even tried
creating a unique href, but unused, while having an onclick attribute,
but that didn't help.

Is there any way I can get the browser to remember the visited state
for such an anchor tag which does not actually load a page from a url?

Andy
 
E

Evertjan.

Andy wrote on 27 okt 2009 in comp.lang.javascript:
Is there any way I can get the browser to remember the visited state
for such an anchor tag which does not actually load a page from a url?

No.

If the href='' is not used, the browser is not interested.
 
T

Thomas 'PointedEars' Lahn

Andy said:
I have an iframe in my page that holds internal documents. I am able
to create links from one page to another in that iframe, by using the
document.createElement('a') function, and then I set 'href' and/or
'onclick'.

The problem is that the browser does not go to an href page when the
tag is clicked but calls an ajax function that loads a page from my
database into the iframe. I tested the visited state of such a tag,
and it never changed to visited color after clicking and causing the
javascript function of the dynamic tag to execute. I even tried
creating a unique href, but unused, while having an onclick attribute,
but that didn't help.

Is there any way I can get the browser to remember the visited state
for such an anchor tag which does not actually load a page from a url?

Maybe. You will need to define a bit of the terminology you are using
first, so your message can be translated to the specified and thus
universally understood terminology:

- page
- internal document
- call an ajax function
- load a page from a database into the iframe
- tag
- javascript function of the dynamic tag
- unique href, but unused
- remember the visited state
- anchor tag
- load a page from a url

See also <http://jibbering.com/faq/#posting>


PointedEars
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,565
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top