Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <a class="clicklink" href="/bookDetails" book-id="<%= ID =>"><%= title %></a>
- <script type="text/javascript">
- $(document).ready(function(){
- $(".clicklink").click(function() {
- var bookId = $(this).attr("book-id");
- // check what you get
- console.log("book id : " + bookId);
- $.ajax({
- type: 'post',
- contentType: "application/json; charset=UTF-8",
- data: JSON.stringify({ID:bookId}),
- url: 'http://localhost:3000/bookDetails',
- success: function(data){
- console.log('success');
- }
- });
- return false;
- });
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement