Close   

Admin and announcement forums

    30 Mar 2008
Getting event object in inline onclick event  
kumar rakesh
create and manage free online surveys with unlimited responses
Online surveys are now basic requirement of everyone who want to review there products or to make studies about anything. But finding a solution who can provide esurveys efficiently is really a big pain. creating an online survey with inefficient tool as irritating and getting survey conducted with limitations on responses is even worse.
cont..
    30 Mar 2008
Getting event object in inline onclick event  
kumar rakesh
practice interviews and prepare for interviews
in todays changing world every one want to increase there salaries very quickly.
Changes your employer is an very efficient solution for this. But changing employer and company is not so easy.

cont..

Viewed 218 times
Total posts : 1

    12 Feb 2008
Getting event object in inline onclick event  
Ernie Kent
His other forums
Getting event object in inline onclick event
Yesterday i need to get event object for  onclick event and onclick event was written inline.
After investing an hour i got methods for that.
I'm writing here for all, who needs that.

<div onclick="javascript:sayMe(event);return false;">click me</a>

to get event object for inline events you have to pass <event> as an argument of the callback function for mozilla browswer and for ie event will be available as

window.event

so to make your function cross browser compatible you can add following code in your function

function xyz(e){
    var e = e ? e : window.event; // now here e is the event object
}


i'll continue with javascript events in my next posts
bye
03 Mar 2008
 
kumar rakesh
His other forums
A right example of the this post by earni is like this





<a href="javascript:sayMe(event);">Click on me</a>



<script language="javascript">

<!--

    function sayMe(e){

       var e = e?e:window.event;

    }

-->

</script>



this same function will also work for non inline onclick events



thanks
Login to participate in forums

Login to participate in forums
jump to :
Post reply on this forum

1

Comment on this forum
Name :
Email :
Comments :
Legends
Getting event object in inline onclick event Forums tagged Getting event object in inline onclick event Forums tagged. But locked for further reply
="Getting Forums locked. can not accept further replies Getting event object in inline onclick event General forum