how to pass id from jsp to bootstrap modal delete confirmation ?
<p>I'm trying to pass an id from a table in a <code>jsp</code> page to a bootstrap modal of delete confirmation ..</p>

<p>this is my button :</p>

<pre><code>&lt;button class="btn btn-danger btn-xs" data-title="Delete" data-toggle="modal" data-target="#confirm-delete" data-delete ="${user.id}"&gt;
&lt;span class="glyphicon glyphicon-trash"&gt;&lt;/span&gt;
</code></pre>

<p></p>

<p>and this is the modal :</p>

<pre><code>&lt;div class="modal fade" id="confirm-delete" tabindex="-1"
        role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"&gt;

        &lt;div class="modal-dialog"&gt;
            &lt;div class="modal-content"&gt;
                &lt;div class="modal-header"&gt;
                    &lt;button type="button" class="close" data-dismiss="modal"
                        aria-hidden="true"&gt;×&lt;/button&gt;
                    &lt;h4 class="modal-title" id="myModalLabel"&gt;Confirm Delete&lt;/h4&gt;
                &lt;/div&gt;
                &lt;div class="modal-body"&gt;
                    &lt;p&gt;You are about to delete a User, this procedure is
                        irreversible.&lt;/p&gt;
                    &lt;p&gt;Do you want to proceed ?&lt;/p&gt;
                &lt;/div&gt;
                &lt;div class="modal-footer"&gt;
                    &lt;button type="button" class="btn btn-default" data-dismiss="modal"&gt;Cancel&lt;/button&gt;
                    &lt;button type="button" class="btn btn-danger btn-ok" id="delBtn"&gt;Delete&lt;/button&gt;
                &lt;/div&gt;
            &lt;/div&gt;
        &lt;/div&gt;
    &lt;/div&gt;
</code></pre>

<p>and this is a script that I've used to invoque <code>delete</code> url :</p>

<pre><code> $('#confirm-delete').on('show.bs.modal', function(e) {

$('#delBtn').click(function() {
$(document).ready(function() {

    var   deleteid = $(e.relatedTarget).data('delete');

    $.ajax({
        cache: false,
        type: 'POST',
       url:"&lt;c:url value='/supprimer/" + deleteid + "'/&gt;",
        data: ,
        success: function(data) 
        {
       }
    });

});
});
 });
</code></pre>

<p>this is the dispacher Controller :</p>

<pre><code>  @RequestMapping("/supprimer/{id}")
public String removeUser(@PathVariable("id") int id){

    this.userService.deleteData(id);
    return "redirect:/utilisateurs";
}
</code></pre>

<p>my work seems to be logic :/ but I don't know why this is not working ?</p>

<p>I tried this <code>script</code> too but it didn't work :</p>

<pre><code>     $('#confirm-delete').on('show.bs.modal', function(e) {
    var deleteid = $(e.relatedTarget).data('delete');
    alert(deleteid);

 $('#delBtn').attr('onClick', "location.href="&lt;c:url value='/supprimer/" + deleteid + "'/&gt;"");
 }); 
</code></pre>

<p>Any help please ? </p>