Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function save_bookmark_to_product() {
- var product_id= $("#hidden_bookmarks_to_product").val()
- var product_bookmark_info= $("#product_bookmark_info").val()
- var is_featured= $("#is_featured").is(':checked')
- var href= " base_url products/save_bookmark_to_product"
- jQuery.ajax({
- url: href,
- type: 'POST',
- data: { product_id : product_id, info : product_bookmark_info, is_featured : ( is_featured ? 'Y' : 'N' ), logged_user_id : ' LoggedUserId ', csrf_token_name : ' csrf_token_hash ' },
- dataType: 'json',
- success: function(result) {
- if (result.ErrorCode != 0) {
- alert( result.ErrorMessage )
- }
- if (result.ErrorCode == 0) {
- location.reload();
- }
- }
- });
- }
- dataType: 'json',
- success: function(result) {
- if (result.ErrorCode != 0) {
- alert( result.ErrorMessage )
- }
- if (result.ErrorCode == 0) {
- location.reload();
- }
- }
- });
- }
- var base_url= ' base_url '
- var logged_user_id = ' LoggedUserId '
- var csrf_token_name = ' csrf_token_name '
- var csrf_token_hash= ' csrf_token_hash '
- $(function() {
- ...
- alert( "frontend_app.jsbase_url:"+base_url + " logged_user_id::"+logged_user_id+" csrf_token_hash::"+csrf_token_hash) — ВЫВОДЯТСЯ ПРАВИЛЬНЫЕ ЗНАЧЕНИЯ
- fancyBoxInit()
- if ( parseInt(logged_user_id) > 0 ) {
- getCartSummary()
- }
- });
- function save_bookmark_to_product() {
- var product_id= $("#hidden_bookmarks_to_product").val()
- var product_bookmark_info= $("#product_bookmark_info").val()
- var is_featured= $("#is_featured").is(':checked')
- var href= " base_url products/save_bookmark_to_product"
- alert( "csrf_token_hash::"+csrf_token_hash ) // ВЫВОДИТ csrf_token_hash::41033b3370643982ad5a33cc7e630a7d
- jQuery.ajax({
- url: href,
- type: 'POST',
- data: { product_id : product_id, info : product_bookmark_info, is_featured : ( is_featured ? 'Y' : 'N' ), logged_user_id : logged_user_id, csrf_token_name : csrf_token_hash },
- dataType: 'json',
- success: function(result) {
- if (result.ErrorCode != 0) {
- alert( result.ErrorMessage )
- }
- if (result.ErrorCode == 0) {
- location.reload();
- }
- }
- });
- }
- An Error Was Encountered
- The action you have requested is not allowed.
- csrf_token_hash.toString()
- }
- if (result.ErrorCode == 0) {
- location.reload();
- }
Add Comment
Please, Sign In to add comment