<a class="del" href="#" data-yano="1250453286" data-pdno="04360003">
<img src="/TC/template/Shopping/images/del.png" alt="">
</a>
$("#select").append($("<option></option>").attr("value", "值").text("文字"));
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"
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;
});
原寫法 (UNTDB 是 Linked Server的 Name)
mySQL = "Select count(*) as Cnt from [UNTDB].[ShopUNT]..[V_Order_Main] ....
新寫法
mySQL = "Select count(*) as Cnt from [ShopUNT]..[V_Order_Main] ....
mySQL = "Select * from Openquery([UNTDB],'" + mySQL.Replace("'", "''") + "')";
<link rel="stylesheet" type="text/css" href="style.css" media="screen" />
<script type="text/javascript" src="js/respond.min.js"></script>