UWInfo Blog
發表新文章
[Join] | [忘記密碼] | [Login]
搜尋

搜尋意見
文章分類-#Author#
[所有文章分類]
所有文章分類
  • ASP.NET (48)
  • ASP.NET2.0 (15)
  • ASP.NET4.0 (34)
  • JavaScript (49)
  • jQuery (26)
  • FireFox (4)
  • UW系統設定 (3)
  • SQL (39)
  • SQL 2008 (25)
  • mirror (4)
  • SVN (4)
  • IE (9)
  • IIS (20)
  • IIS6 (1)
  • 閒聊 (7)
  • W3C (6)
  • 作業系統 (9)
  • C# (24)
  • CSS (12)
  • FileServer (1)
  • HTML 5 (11)
  • CKEditor (3)
  • UW.dll (13)
  • Visual Studio (16)
  • Browser (8)
  • SEO (1)
  • Google Apps (3)
  • 網站輔助系統 (4)
  • DNS (5)
  • SMTP (4)
  • 網管 (11)
  • 社群API (3)
  • SSL (4)
  • App_Inventor (1)
  • URLRewrite (2)
  • 開發工具 (6)
  • JSON (1)
  • Excel2007 (1)
  • 試題 (3)
  • LINQ (1)
  • bootstrap (0)
  • Vue (3)
  • IIS7 (3)
  • foodpanda (2)
  • 編碼 (2)
  • 資安 (3)
  • Sourcetree (1)
  • MAUI (1)
  • CMD (1)
  • my sql (1)
最新回應
  • Newtonsoft.Json.JsonConvert.DeserializeObject 失敗的情況
    test...more
  • dotnet ef dbcontext scaffold
    ...more
  • [ASP.NET] 利用 aspnet_regiis 加密 web.config
    ...more
  • IIS ARR (reverse proxy) 服務安裝
    ...more
  • [錯誤訊息] 請加入 ScriptResourceMapping 命名的 jquery (區分大小寫)
    ...more
  • 用 Javascript 跨網頁讀取 cookie (Cookie cross page, path of cookie)
    ...more
  • 線上客服 - MSN
    本人信箱被盜用以致資料外洩,是否可以請貴平台予以協助刪除該信箱之使用謝謝囉...more
  • 插入文字到游標或選取處
    aaaaa...more
  • IIS 配合 AD (Active Directory) 認証, 使用 .Net 6.0
    太感謝你了~~~你救了我被windows 認證卡了好幾天QQ...more
  • PostgreSQL 的 monitor trigger
    FOR EACH ROW 可能要改為 FOR EACH STATEMENT ...more
標籤
  • http 錯誤 40
  • blog
  • 8855-8767
  • SSL Lab
  • ajmynshnwb
  • 908
  • Data212112
  • datarow so
  • 老試
  • 28
  • html
  • formhelper
  • CS21211211
  • 7826-7738
  • Content-Di
  • 9247
  • SQL Availa
  • GbciaVFI
  • Rewrite
  • js UNION A
  • 220
  • sysconfig,
  • sql 變更
  • 背景
  • twzip
  • 遠端桌面服務
  • ms_descrip
  • 漢光
  • 驗證
  • asp
  • 還原
  • [t]
  • iframe
  • jQuery
  • vb.net
  • irhoS4P3
  • 1
  • mirror
  • 大榮
  • Pay介接
  • UrlResult
  • face
  • 三元
  • 708
  • @@tbkLE
  • 774
  • 532
  • orderby
  • windows
  • 長度
頁數 2 / 5 上一頁 下一頁
搜尋 結果:
C# 下拉選單AutoPostBack後Button點擊沒反應
改用javascript送出
<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>


相關專案: 光寶
More...
Reiko, 2015/6/29 下午 03:49:57
jQuery 之 event.originalEvent
有時候用 jQuery 使用 event 物件時,會發現有些特殊事件的 property 抓不到 (undefined)
例如
mousewheel --> event.wheelDelta 
drop --> event.dataTransfer
touchstart --> event.touches[0].pageX
原因是 jQuery 的 event 只會包裝一般的屬性,特別的屬性要使用 event.originalEvent 去抓
event.originalEvent 是瀏覽器原生的 event

It's also important to note that the event object contains a property called 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.

所以開發時當有些特殊屬性抓不到時,可以考慮用 event.originalEvent 去抓看看

    // 這是用滾輪放大縮小圖片 (此範例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;
    });


 
More...
darren, 2015/4/21 下午 12:03:35
throttle & debounce
又發現新說法

我們在 front-end 做 scroll event的監聽的時候很常會過度的觸發要執行的事情,因此導致效能不太佳,
我們需要的是固定頻率執行某個function , 這個原來叫 throttle

另外一種狀況像是autocomplete,不需要每一個keyup 都去ajax 去backend 抓資料回來,所以我們過去,
設一個變數去記住setTimeout 回傳回來的數字,如果下一次的keyup 發生在預設的時間內就去把 setTimeout清掉。
原來這種做法,有一個稱呼叫 debounce

不過jQuery 沒有內建這兩個function。這樣在複雜的 js 中增加易讀性。
More...
瞇瞇, 2015/4/6 下午 08:19:47
跨 domain iframe 網頁的 javascript 互通API
這是一個老問題,當開啟的網頁是另一網站時,javascript 是不能互通呼叫的 
因此 W3C 制訂的 HTML5 Web Message 規格,讓跨站網頁可以互通訊息
http://www.w3.org/TR/webmessaging/
https://html.spec.whatwg.org/multipage/comms.html#web-messaging

Can I Use 查詢發現幾乎所有瀏覽器都支援了, Good!
http://caniuse.com/#search=postMessage

Youtube 就依此標準做出工具,讓砍入 iframe Youtube 影音的網頁可以互動
例如上層網頁就可以控制 iframe 裡的影音的音量、暫停等
https://developers.google.com/youtube/iframe_api_reference
More...
darren, 2015/3/26 下午 03:25:24
適用於手機版網頁的 facebook feed 機制

對於PC版大尺吋的螢幕,當網站要 feed 資料到 facebook 時,可以使用 javascript SDK 的
FB.ui => method:'feed' 方式處理,參考位置。此方法會popup小視窗讓user可以分享資料出去。

但是遇到手機版網頁就有點麻煩,實測上手機版的 chrome 會出現轉不停的情況,無法分享;而iPhone則是另開新頁面處理,可以成功但是會多一個分頁。所以手機版網頁建議使用 redirect 方式處理分享機制,參考位置
​

    var fbUrl = "https://www.facebook.com/dialog/feed?" +
    "app_id=122465741241119&display=touch" +
    "&link=" + encodeURIComponent("http://www.shopunt.com/tch/FixPage.aspx?id=525") +
    "&picture=" + encodeURIComponent("http://www.shopunt.com/tch/event/2014-nail-enrollment/fb_200x200.jpg") +
    "&description=" + encodeURIComponent("市價不斐的光療DIY教學,UNT傾囊相授!10場巡迴免費教學,讓妳輕鬆掌握光療DIY訣竅,並搶先體驗秋冬最新流行色!現場打卡,再送時尚美甲工具組") +
    "&redirect_uri=" + encodeURIComponent("http://www.shopunt.com/tch/event/2014-nail-enrollment/Handler.ashx?fun=FBCallback");
​

當然以 redirect 處理與 javascript 方式處理是兩種不同的方式,redirect 方式的 callback 網址 (redirect_uri)要接收facebook 導回的 post_id , javascript 方式則是 callback function 處理 post_id

More...
darren, 2014/10/16 下午 03:48:04
讓 IE6-8 認識 CSS 的 Media Query
使用CSS Media Query可以實現響應式網頁設計(Responsive Web Design)
但是在眾多瀏覽器中唯有IE這個萬惡瀏覽器到 IE9 及之後的版本才支援 CSS Media Query,不過有辦法可以讓 IE6 到 IE8 支援 Media Query 語法,那就是 Respond.js。

要注意的地方是:respond.js要放在css下面(順序有關係)
例:

<link rel="stylesheet" type="text/css" href="style.css" media="screen" />

<script type="text/javascript" src="js/respond.min.js"></script>


Demo

下載地址:Respond.js
 
More...
nelson, 2014/9/26 上午 11:25:45
防止 event 往上傳的終極方法
作global結帳時發生IE8不能選信用卡到期日,
因為 IE8 只吃 evt.cancelBubble = true 才不會把click事件往上層傳
所以以下是終極不會有問題的寫法

                if (evt.stopPropagation) { evt.stopPropagation() }
                if (evt.preventDefault) { evt.preventDefault() }
                try { evt.cancelBubble = true } catch (e) { }
                try { evt.returnValue = false } catch (e) { }


evt就是傳進來的event

(補充一下) 這個適合用 window.addEventListener 方式綁事件才需使用,如果用jQuery綁事件直接return false;就有一樣的效果


範例:

       // 經由bike提示,發現這範例不好 jQuery 可以直接 return false;
       $("#gc-exp-month-select a").click(function (evt) {
            $("#gc-exp-month").val($(this).text());
            $("#span-gc-exp-month").text($(this).text());
            $(this).parent().hide();
            if (evt.stopPropagation) { evt.stopPropagation() }
            if (evt.preventDefault) { evt.preventDefault() }
            try { evt.cancelBubble = true } catch (e) { }
            try { evt.returnValue = false } catch (e) { }
           // 在 jQuery 裡上面四行 可以用一行 return false; 就可
        });

 
More...
darren, 2014/7/17 下午 04:29:34
form 的 reset 功能對 hidden field 無作用
一般正常來說 如果要網頁的表單(Form) 做資料清除的動作
只要下 reset() 指令就可
document.getElementById("form1").reset();

但是對於 hidden field
<input type='hidden' name='txtId' value='xxx' />

這個方法是沒有作用的 資料還是在

兩個方法解決:
1. reset 之後再各自去清掉 hidden field 的 value (有點笨)
2. 不要用 hidden field 改用 display:none 的 DIV 去包要隱藏的 field
 
More...
darren, 2014/7/10 上午 10:23:38
左邊 Menu 當scroll時固定位置的方法 js
這個活動頁左邊 menu 要固定位置 但是不能跑出框框外面
http://www.shopunt.com/tch/event/2014-naked-truth-cc-cream/

所以需要處理scroll物件


<div id="menuContainer">
  <div id="menu">
    <ul>
      <li>menu1</li>
      <li>menu2</li>
    </ul>
  </div>
  <div> ...長內容.... </div>
</div>

js
        var __ContainerHeight = 5000;
        var __ContainerTop = 160;
        var __MenuHeight = 550;
        var __FixedTop = 20;

        $(window).load(function () {

            __ContainerHeight = $("#menuContainer").height();
            __ContainerTop = $("#menuContainer").offset().top;
            __MenuHeight = $("#menu").height();

            $("#menu").css({ "top": __FixedTop + "px", "position": "absolute" });
            $(window).scroll(function () {
                var scrolls = $(this).scrollTop();
                //console.log(scrolls);
                if (scrolls < __ContainerTop) {
                    $("#menu").css({ "top": __FixedTop + "px", "position": "absolute" });
                }
                else if ((scrolls + __MenuHeight + __FixedTop) > (__ContainerHeight + __ContainerTop)) {
                    $("#menu").css({ "top": (__ContainerHeight - __MenuHeight) + "px", "position": "absolute" });
                }
                else {
                    $("#menu").css({ "top": __FixedTop + "px", "position": "fixed" });
                }
            });

        });

 
More...
darren, 2014/6/20 下午 02:03:01
網頁呼叫 Line 的說明
*** 分享按鈕的做法 ***
http://media.line.me/howto/zh-hant/

*** 讓其他人可以加入你成為好友,或已是好友可以直接傳訊息 **
- 請到個人資料找出"行動條碼",會有一組 QR Code
  QR Code 內容是 URL, 轉成文字就像是 http://line.me/ti/p/TLVcRv52Ps
  請另外用 QR Code 掃描軟體把他拍下來查看文字就可以得到 Url
- 網頁上只要用一般的連結方式 把這個 URL 放進去
 
<a href="http://line.me/ti/p/TLVcRv52Ps">連絡我</a>

 若 user 手機有安裝 Line App 就會叫起 Line 加入好友並可以傳訊息
 
More...
darren, 2014/5/23 下午 03:45:22
|< 12345 >|
頁數 2 / 5 上一頁 下一頁
~ Uwinfo ~