What i\'m trying to do is to pass the data-id value to an external link via JQuery ajax. The modal will show up but the data-id attribute is not sending to the external link
Dont mix onclick
attributes with event handlers, its messy and can cause errors (such as mistaking the scope of this
, which i believe is you main issue here).
If you are using jquery make use of it:
First add a class to the links you want to attach the event to, here i use the class showme
:
Show Me
Then attach to the click event on those links:
To access the variable in php:
$uid = $_GET['id']; //NOT $_GET['uid'] as you mention in a comment