[英]Is it possible to save a local file to a different location in the same computer using javascript?
[英]Exact same JavaScript codes not works on local computer
我已經在JSFiddle上進行了測試,沒有問題
這是服務器上托管的文件: http : //users3.jabry.com/apasajja/37/file.html
它運作完美。 圖像每秒加載一次。
但是,當在本地計算機上運行時,即使代碼相同,它也無法按預期工作。 圖像不會每秒加載一次。
您可以擁有相同的副本: http : //users3.jabry.com/apasajja/37/file.zip
嘗試這樣的事情
從這里改變
<script type='text/javascript' src='//code.jquery.com/jquery-1.10.1.js'></script>
至
<script type='text/javascript' src='http://code.jquery.com/jquery-1.10.1.js'></script>
您沒有提到DOCTYPE,而html嘗試了這一功能。
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-2.1.1.js"> </script>
<script type='text/javascript' src='script.js'></script>
<style type="text/css">
#mr3{
height:200px
}
</style>
</head>
<body>
<div id="mr3" style="background:url(http://users3.jabry.com/apasajja /37/banner1.jpg)"> </div>
</body>
</html>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.