Created
May 31, 2012 18:47
-
-
Save scooler/2845351 to your computer and use it in GitHub Desktop.
Stoping popup out to parent
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script> | |
<script src="rails.js" type="text/javascript" ></script> | |
<script type="text/javascript"> | |
$( function(){ | |
$(".parent").click(function(){ | |
alert("Parent clicked"); | |
}); | |
//this is only thing that will be called before | |
$(".parent a").click(function(e){ | |
$.rails.handleRemote($(this)); | |
e.stopImmediatePropagation(); | |
e.preventDefault(); | |
}) | |
}); | |
</script> | |
</head> | |
<body> | |
<div class="parent"> | |
<a data-method="delete" data-remote="true" href="http://localhost:3000/test">Click me</a> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for this! Got me out of a jam.