Hello phalcon community. I want to know the solution how to execute volt syntax in js file . if attach javascript syntax in file like index.volt it's work fine
example. I have index.volt in this file. I write javascript like this
$('#price_card').val('');
$('#support_card').val('');
$('#package_card').val('');
$('#description_card').val('');
$('#groupCardId').val('');
$('#groupCardPath').val('');
$('#groupCardId').val(groupId);
$('#showPreviewBtn').empty();
$('.chk_box').attr('checked', false);
$.uniform.update('.chk_box');
var html = '';
var path = '{{url()}}';
$.ajax({
url: '{{url("groupusers/card")}}',
type: 'GET',
data: {value: groupId},
dataType:'json',
})
.done(function(res) {
if(res != 'new'){
var path = '{{url("groupusers/previewcard/'+groupId+'")}}';
var btn = '<a href="'+path+'" class="btn btn-warning" target="_blank" id="previewCard">Preview</a>';
$('#showPreviewBtn').html(btn);
$('#price_card').val(res.card_price);
$('#support_card').val(res.card_support);
$('#package_card').val(res.card_package);
$('#description_card').val(res.card_description );
$("input[name='check_btn'][value='" + res.card_path + "']").attr('checked', true);
}
});
it can work when I write in index.volt but I try to save this script to script.js and attach in to index.volt it can't interpreter variable
var path = '{{url()}}';
Please give me an introduction or solution to resolv this problem. thank you p.s. sorry for my bad english