我正在使用jQuery动态地向我的页面添加脚本并且它可以工作,但是jQuery将"_ = TIMESTAMP"附加到URL,导致浏览器从不使用缓存.使用以下代码:
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml'>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
</head>
<body>
<script type="text/javascript">
$("head").append('<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.15/jquery-ui.min.js"></scr' + 'ipt>');
</script>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
我可以在firebug中看到所请求的URL是:
https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.15/jquery-ui.min.js?_=1313291978667
Run Code Online (Sandbox Code Playgroud)
有谁知道如何告诉jQuery不要这样做?
谢谢