homepage Welcome to WebmasterWorld Guest from 50.17.176.149
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Subscribe and Support WebmasterWorld
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
Is it possible to simulate a user clicking on a href link?
FleaPit




msg:1488658
 11:37 am on Apr 26, 2003 (gmt 0)

I know about meta and java redirects, but is there any way of simulating a human user clicking on a href link automatically when the page loads? Sounds kinda of strange but I have tracking setup and it doesn't register meta or java redirects only actual clicks on href links.

Any suggestions please?

 

ShawnR




msg:1488659
 11:55 am on Apr 26, 2003 (gmt 0)

What do you mean by "java redirects"?

FleaPit




msg:1488660
 12:01 pm on Apr 26, 2003 (gmt 0)

sorry javascript

SethCall




msg:1488661
 3:04 pm on Apr 27, 2003 (gmt 0)

I am almost certain that DHTML does not support generating events. This would open up a whole slew of abuse problems...

what if it generated a Ctrl+alt+del keystroke? or just alt+f4? Or what if, you had a box pop up, that says "click here if you agree to download and load an ActiveX component", and then u generate the click...

An event must occur by hand.

I wuld say u have to chane the tracking system..,

DrDoc




msg:1488662
 5:58 pm on Apr 27, 2003 (gmt 0)

Ehm... What about this then?

...
<script type="text/javascript">
function clickedhref() {
location.href="whatever.html";
}
</script>
<body onload="clickedhref()">
<a href="whatever.html">Click me!</a>
...

DrDoc




msg:1488663
 6:02 pm on Apr 27, 2003 (gmt 0)

it doesn't register meta or java redirects

Why not?

bryndyment




msg:1488664
 6:08 pm on Apr 27, 2003 (gmt 0)

Re: DrDoc's post (whatever.html)... I think that's what he meant by a JavaScript redirect, which doesn't work in his situation.

gph




msg:1488665
 6:36 pm on Apr 27, 2003 (gmt 0)

This works in IE and of course Opera is along for the ride :)

document.getElementById('mylink').click()

gph




msg:1488666
 6:38 pm on Apr 27, 2003 (gmt 0)

SethCall just incase you didn't know. What I posted above only works on page elements.

DrDoc




msg:1488667
 9:25 pm on Apr 27, 2003 (gmt 0)

Well, usually, if a refresh or JavaScript redirect doesn't work, it's because parameters need to be passed with the URL. I can't think of any situation where the problem (whatever it may be) can't be solved.

So, as long as we know why a meta or JavaScript redirect doesn't work, then it should be possible to solve it.

ShawnR




msg:1488668
 10:35 pm on Apr 27, 2003 (gmt 0)

Seems to me this thread is branching into 2 topics: How to do a javascript 'redirect' and why they don't register in Fleapit's tracking s/w. The first problem can be solved, per posts 5 and 8. Re the second question: Fleapit, what trackig s/w are you using?

Shawn

FleaPit




msg:1488669
 8:34 pm on Apr 29, 2003 (gmt 0)

gph, you little beauty! document.getElementById('mylink').click() works absolutely spot on! You have saved me bucket load of work I can't thank you enough!

Just gotta love WebmasterWorld. Always someone out there who knows the answer :)

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved