DarkLeafyGreen
DarkLeafyGreen

Reputation: 70416

How to pass the event interface?

I have following situation:

$('selector').live('click', openSite);

and open site takes the event like this

function openSite(e){
    e.preventDefault();
}

If I change my first line of code to

$('selector').live('click', function(e){

});

How do I call siteOpen within this code correctly? openSite(e) does not work.

Upvotes: 0

Views: 91

Answers (1)

amustill
amustill

Reputation: 5302

Have you double checked your code for any typos? Here's a working example of how you've described your desired functionality.

http://jsbin.com/ijufe4

Upvotes: 1

Related Questions