Can i get variable if my button from other file.. example page 1 (a.php):
<a href="#" class="mybutton">Button</a>
and page 2 (b.php):
$(document).ready(function() {
$('a.php .mybutton').click(function() {
alert("ok");
});
});
Can i get variable if my button from other file.. example page 1 (a.php):
<a href="#" class="mybutton">Button</a>
and page 2 (b.php):
$(document).ready(function() {
$('a.php .mybutton').click(function() {
alert("ok");
});
});
If you put your function in an external js file then you can fire it from any page. then it wont be a click function but a regular js function. Refernce the js file at the bottom of any page where you want to use the function.