css alter href
- Started
- Last post
- 3 Responses
- mikotondria3
I have a set of normal href links on a page, but I am grabbing this page with a script and piping through to another page with ajax... so of course I don't want them to behave exactly as they would were they in situ, rather I am wanting to maybe use some css to reassign the hrefs to be able to make them a js function, that will that be used to activate my page content ajax, like so:
Links on 'page' as:
< a href="another.location" >
I want to use some form of css before: content, etc, so that on my page within the dynamic div the links become:
< a href="javascript: doContent('another.location..Is this possible with css ?
Using a simple:
a:before {content: "doContent... just makes the clickable text have the doContent on. : /
- acescence0
i don't think that will work. before and after aren't supported in IE anyway. put a listener on all anchor clicks and deal with it when they click on the link. but that won't work if they right-click, but js won't either. or just mod the links with js, since you're grabbing the content with js anyway.
- mikotondria30
yes yes yes, process the links when I pipe them out to the page.
Excellent, sir - thank you.