$('#upload').click(function(){
$('#main .right').html("{% extends 'a.html' %}")
})
but this is error ,
how to make this code running .
thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Do you mean
{% include %}? I can’t see what purpose putting anextendsinside a script block would serve.If you’re actually templating into that
{% ... %}block successfully, then you’re including a load of HTML content. HTML content usually has lots of newlines and"characters in it, both of which will immediately terminate the JavaScript string literal inside thehtml()call and cause a big old syntax error. (Other characters that will cause trouble include\and</.)If you wanted this to work, you’d need to take the output of the
a.htmltemplate and encode it using JavaScript string literal rules. For a normal string this would be done using theescapejsfilter in Django or thejsonlibrary in general. However I don’t think there’s any way to do filtering on the output of an{% include %}command.How about including the HTML in a hidden part of the document and showing/hiding it from script?