用hack\9直接寫ie8的樣式html
用prototype新寫了方法html5
if (!Array.prototype.indexOf){
Array.prototype.indexOf = function(elt){
var len = this.length || 0
var from = Number(arguments[1]) || 0
from = (from < 0) ? Math.ceil(from) : Math.floor(from)
if (from < 0) from += len
for (; from < len; from++) {
if (from in this && this[from] === elt) {
return from
}
}
return -1
}
}
if (!String.prototype.trim){
String.prototype.trim = function(elt){
return $.trim(this)
}
}
複製代碼
<meta http-equiv="X-UA-Compatible" content="IE=edge">
複製代碼
var uploader = WebUploader.create({
auto: true,// 選完文件後,是否自動上傳。
// swf文件路徑
swf: '../../js/plugin/webuploader/Uploader.swf',
paste: document.body,
// 文件接收服務端。
server: serverUrl+"files/upload",
formData:postData,
...
複製代碼
提及來很簡單啊,可是實踐的時候一條條辦法也是很辛苦的啦nginx