@font-face { src: url('.....woff')此時瀏覽器會使用 XHR 方存取字型檔案 因此會產生跨站問題 (CORS)
Access-Control-Allow-Origin: http://foo.example
當然,http://foo.example 可以改成 * (星號) 表示所有站台都可以存取
http://blog.zhusee.in/post/48857667691/jquery-deferred-object
deferred.done(callback) #=> 成功時執行
deferred.fail(callback) #=> 失敗時執行
deferred.progress(callback) #=> 還在跑,但是裡面的程式使用 `.notify` 方法通知進度
deferred.always(callback) #=> 無論成功或失敗都會執行
deferred.when(filters) #=> 在呼叫 callback 前先處理資料,後面解釋
當所有 Deferred 都完成後,註冊在 $.when()
下面的 callback 會拿到第一個 Deferred 物件傳給 callback 的參數
var d1 = $.Deferred(), d2 = $.Deferred(), w = $.when(d1, d2); w.done(function(msg) { console.log(msg) }); d1.resolve("Part A done"); d2.resolve("Part B done"); #=> "Part A done"
<textarea style="width:675px; height:60px" name="Description" id="Description">#Description#</textarea>
<script type="text/javascript">
CKEDITOR.replace('Description');
</script>
<textarea style="width:675px; height:60px" name="Description" id="Description">#Description#</textarea>
<script type="text/javascript">
$('#Description').ckeditor();
</script>
<asp:Button ID="BtnSubmit" runat="server" Text="修改" OnClick="BtnSubmit_Click" OnClientClick="return formSubmit('true');" />
<script type="text/javascript">
function formSubmit(val) {
if (val== "true")
{
form1.submit();
} else {
return false;
}
}
</script>
[IIS] IIS出現[無法從組件 'System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' 載入型別 'System.ServiceModel.Activation.HttpModule'。] 錯誤訊息排解
originalEvent
, which is the event object that the browser itself created. jQuery wraps this native event object with some useful methods and properties, but in some instances, you'll need to access the original event via event.originalEvent
for instance. This is especially useful for touch events on mobile devices and tablets.// 這是用滾輪放大縮小圖片 (此範例firefox不支援)
$("#imgProductBig").bind("mousewheel", function (ev) {
var delta = ev.originalEvent.wheelDelta > 0 ? 1 : -1;
if (delta > 0 && zoomValue < 150) {
zoomValue += 10;
}
else if (delta < 0 && zoomValue > 50) {
zoomValue -= 10;
}
$(this).css("zoom", zoomValue + '%');
return false;
});