.js files, even if linked in Django templates are not processed by template
engine. To output value from context to file, this file should be an output
from template engine.
You have three ways to solve your problem:
Make your myjs.js file generated by template processor. It’s most difficult and
But I'm getting one error
On Tue 25 Feb, 2020, 5:59 PM Naveen Arora,
wrote:
> Hi, this is simple just enclose {{name}} into " " as "{{name}}" for your
> part.
>
> Thanks
>
> On Tuesday, 25 February 2020 15:56:05 UTC+5:30, Soumen Khatua wrote:
>>
>> Hi Folks,
>>
>> I'm sending some context data i
Hi, this is simple just enclose {{name}} into " " as "{{name}}" for your
part.
Thanks
On Tuesday, 25 February 2020 15:56:05 UTC+5:30, Soumen Khatua wrote:
>
> Hi Folks,
>
> I'm sending some context data into html like
> name = 'soumen'
> return render(request,'xyz.html', context = {'name':name}
Hi!
The context is a dictionary mapping template variable names to Python
objects.
from https://docs.djangoproject.com/en/3.0/intro/tutorial03/
May be you need to test with a dict nor string directly.
I haven't test a direct variable.
Try not using JS, first resolve dict context in html , then J
Hi Folks,
I'm sending some context data into html like
name = 'soumen'
return render(request,'xyz.html', context = {'name':name})
inside myjs.js(js script has been integrated to html):
---
var my_name = {{name}};
I'm getting an erro
5 matches
Mail list logo