user2247671
user2247671

Reputation: 243

Jquery propagation

I have a div on my webpage that I am populating with an AJAX call, I can reference elements in jquery already event.preventdefault() and that works great.

However I am trying to select an element now as apposed to having the page respond to the click event and I am getting a reference error, I believe this is due to propagation, I have no idea how a should construct my statement, to correct the problem. here is my function

//show signiture new tab  
$( "#main" ).on( "click", "#POD", function( event ){    
    event.preventDefault();
    window.open('images/DATACAPTURE/' + $("#signiture").attr("data-signiture", value)  + '.BMP', '_blank');                 
});    

it's doesn't like the #signiture I have an id with signiture and it has an attribute data-signiture

Upvotes: 0

Views: 67

Answers (1)

George
George

Reputation: 36784

You are using the setter version of attr() by passing a second parameter.

I think you mean to use the getter version:

$( "#main" ).on( "click", "#POD", function( event ){
    event.preventDefault();
    window.open('images/DATACAPTURE/' + $("#signiture").attr("data-signiture")  + '.BMP', '_blank');
});

Upvotes: 2

Related Questions