Skip to content

Instantly share code, notes, and snippets.

@scooler
Created May 31, 2012 18:47
Show Gist options
  • Save scooler/2845351 to your computer and use it in GitHub Desktop.
Save scooler/2845351 to your computer and use it in GitHub Desktop.
Stoping popup out to parent
<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>
@jpellizzari
Copy link

Thanks for this! Got me out of a jam.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment