Javascript Flask中的动态哈希链接

Javascript Flask中的动态哈希链接,javascript,python,flask,jinja2,Javascript,Python,Flask,Jinja2,好的,我在服务器端有以下代码: @app.route('/physical_graph') @login_required def physical_graph(): # Some code return generate_graph_view() 如果单击圆形图标,我们将获得链接/physical\u graph\35physical.circular: <a class="icon" href="/physical_graph#physical.circular"

好的,我在服务器端有以下代码:

@app.route('/physical_graph') 
@login_required 
def physical_graph():
    # Some code
    return generate_graph_view()
如果单击圆形图标,我们将获得链接/physical\u graph\35physical.circular:

<a class="icon" href="/physical_graph#physical.circular">
    <img src="{{url_for('static',filename='images/circular64x64.png')}}" 
         id="circular_icon" width="32" height="32" title="Circular layout"/>
</a>

我的问题是:我如何告诉Flask散列后面是什么字符串?我需要这个,因为注释中的代码依赖于这个字符串。我尝试将app.route声明为:

@app.route('/physical_graph#<some_string>')
@app.route('/physical#u graph#'))
但是没有成功——它给了我错误404


有没有办法做到这一点?

在ajaxify时,需要将physical.circle传递给服务器。首先是对
图标的使用的评论:

<!-- notice i change from icon -> graphIcon icon is too general  -->
<!--a stylist would be angry at you for using icon -->
<a class="graphIcon" href="/physical_graph#physical.circular"> .. </a>


你不能把#留在客户端,你为什么要用hash?与查询参数?或者更好一些rest-sytax
/graph/physical.circle
我需要散列,因为我正在对应用程序进行ajax加密,所以一旦单击某个图标,就可以异步发送和检索数据。到目前为止,它是/graph/physical.circle,但这会加载整个新页面,这就是我需要哈希的原因。所以,不可能用散列链接这样做?Tnx,作为提示,但我是初学者,我想问你,你是否可以告诉我在哪里放置此代码,以及如何在服务器端代码中访问此代码?不,当我打印时,它会给我“无”。我猜它会给我一个空字符串,所以这段代码不会返回任何内容。还有什么其他的办法可以解决这个问题吗?(顺便说一句,ajax代码中的括号中有一些错误,我尝试使用固定括号)没有指定,所以我猜是“GET”。我应该试试“POST”吗?让我们一起来
jQuery("#circular_icon").click(function() {
   $.ajax({
         url:'/physical_graph', 
         data:{
               'graph_type': 'physical_graph.circular'
         },
         'success':function(data){
             //your function goes here. 
         }
   })
} );
@app.route('/physical_graph') 
@login_required 
def physical_graph():
  _type = request.args.get('graph_type')