my js external script contains the following code
$(document).ready(function() {
$('[id^="comment"]').click(function(e) {
$(this).prop('disabled', true);
if ($(this).val() == 'Save') {
var $thisClicked = $(this);
$.ajax({
type: "POST",
url:"/comment/create/",
success: function(data) {
$thisClicked.after(data);
$(".form").slideDown(200);
}
});
} else {
var $thisClicked = $(this);
$.ajax({
type: "POST",
url:"/comment/delete/",
success: function(data) {
$thisClicked.prop('disabled', false);
}
});
}
});
});
my question is what variable should I use to point to the right directory in Yii and how to pass , variables.
I trying to do the equivalent of
url: "<?php echo Yii::app()->createUrl('comment/create', array('post_id' => $data['id'], 'user_id'=> Yii::app()->user->id)); ?>",
Thank you for your help.