如何将我单击href链接的文本从一个年龄传递到JS中的另一个页面,并且该文本应该在Django代码中可用?

问题描述

这是用Django编写的代码。当我在链接显示结果上单击链接时,应保存href的文本链接(例如,以下代码在{{post.0}}中呈现的Redmi Note 5)并传递该文本{{pass.0 }},并将{{pass.1}}链接到另一个页面获取相同的文本,并将其用作标题。我该怎么办?

Page1.html

from cryptography.fernet import Fernet
key = Fernet.generate_key()
cipher_suite = Fernet(key)
string = input("string here")
string = bytes(string,'utf-8')
print(string)
cipher_text = cipher_suite.encrypt(string)
print(cipher_text) 
plain_text = cipher_suite.decrypt(cipher_text)
plain_text = plain_text.decode()
print(plain_text)

Page2.html

{% for post in product_names %}
    <a href="{{ post.1 }}" onclick="savefunc({{post.1}},{{post.0}})">{{ post.0 }}</p>
{% endfor %}

接受JS或Django中的建议。请帮助我。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...