function publish_article(){
var title=$("#id_title").val();
var column_id=$("#which_column").val();
var body=$("#id_body").val();
$.ajax({
url:"{% url 'article:article_post' %}",
type:"POST",
data:{"title":title,"column_id":column_id,"body":body},
success:function (e) {
e=JSON.parse(e);
if(e["e"]=="1"){
layer.msg("successful.");
location.href="{% url 'article:article_detail' id=e["id"] slug=e["slug"] %}";
}else if(e["e"]=="2"){
layer.msg("sorry.");
}else{
layer.msg("项目名称必须写,不能空");
}
},
});
}
这是我的Django的页面下的javascript代码;
location.href="{% url 'article:article_detail' id=e["id"] slug=e["slug"] %}";这里拿不到e这个变量!!!!!怎么破????求教各位大神