擅长:python、mysql、java
<p>从实数<a href="http://flask.pocoo.org/docs/0.11/patterns/jquery/" rel="nofollow">doc</a>:</p>
<blockquote>
<p>A simple method would be to add a script tag to our page that sets a global variable to the prefix to the root of the application. Something like this:</p>
</blockquote>
<pre><code><script type=text/javascript>
$SCRIPT_ROOT = {{ request.script_root|tojson|safe }};
</script>
</code></pre>
<p>对我来说,只添加这个标记而不添加<code>var =</code></p>