hi,
why ajax didn't running passing var when put it on static js folder?
e.g.
/static/js/cart.js
jQuery(document).ready(function(){
jQuery('.add').click(function(){ajax('{{=URL('cart_callback',
vars = dict(id =
book.id,
action = 'add'))}}',
[],
'item{{=book.id}}')});
jQuery('.sub').click(function(){ajax('{{=URL('cart_callback',
vars = dict(id =
book.id,
action = 'sub'))}}',
[],
'item{{=book.id}}')});
});
but when i put on the views it'll run
e.g.
views/cart.html
<script>
jQuery(document).ready(function(){
jQuery('.add').click(function(){ajax('{{=URL('cart_callback',
vars = dict(id =
book.id,
action = 'add'))}}',
[],
'item{{=book.id}}')});
jQuery('.sub').click(function(){ajax('{{=URL('cart_callback',
vars = dict(id =
book.id,
action = 'sub'))}}',
[],
'item{{=book.id}}')});
});
</script>
did anyone knows how to solve this problem?
any help is appreciate, many thanks before