how to send and receive a variable from php to popup using jquery on same page without load the page -


how receive data php popup menu using jquery?

<a href="#?da=<?php echo $fetch['da_ref'] ?>" class="big-link" data-reveal-id="mymodal" data-animation="fade" style="text-decoration: none"><?php echo $fetch['da_ref'];?></a> 

perhaps can use method of retrieving variable's value within pop-up same way attributes tag. analyse script , see happening data-... attributes.

as far can see, should add new attribute tag, similar data-variable="value".

a small snippet of code using jquery, following

the html:

<div>     <a href="#" class="big-link" data-reveal-id="mymodal" data-variable="variable value " data-animation="fade">click me</a> </div> 

the css:

a { display: inline-block; padding: 10px; color: #333; text-decoration: none; border: 1px solid #333; } 

the javascript:

$(document).ready(function() {     $(".big-link").on("click", function() {         var variable = $(this).attr("data-variable");         $(this).parent().append(variable);     }); }); 

you can try on http://jsfiddle.net/.


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -