简体   繁体   中英

how to pass a js value into the django url template tag

var c = "url chatloadchannel=" + String(channel)
fetch('% ' + c + ' %}')

how to pass this js value to the django

You will get Js value after the django-templating-engine has rendered everything. So there is no point in passing js value to the django url template tag as it will not going to be rendered. As an alternative you can use ajax.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM