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
標籤
  • if
  • 80
  • Su
  • order by
  • aspnet_reg
  • Config
  • -7902
  • aspx
  • 58
  • Image
  • 專案
  • en
  • ti
  • IE
  • array
  • 5886
  • 548
  • MinValue
  • length
  • win
  • 8
  • 102
  • -5083
  • ORM
  • sca
  • [U2]
  • CK
  • blog
  • amazone
  • ip[t]
  • ad
  • 備份
  • @@Lkznu
  • 48
  • xml
  • 70
  • HTML 的上標字與
  • firefox OR
  • 鎖死
  • 0KeeTeam
  • WU
  • null
  • fortigate
  • 0
  • -5137 UNIO
  • line ORDER
  • QywKHDop
  • r0iMk5pz
  • 401.3
  • net
頁數 31 / 51 上一頁 下一頁
搜尋 . 結果:
facebook 網頁分享 Debug 模式
當我們網站裡的某個網址要分享到 facebook 時,
facebook 會主動到我們網頁擷取內容,然後存在cache裡
facebook 給開發人員一個頁面可以測試看看結果
https://developers.facebook.com/tools/debug/og/object/ 
可以貼上自己網站的某個網址 ex.
http://www.shopunt.com/eng/unreal-touch-mineral-powder-blush/p/1129/c/34
就可以看到 facebook 爬到的結果,如果上次爬的是很久以前,這個地方也可以重新爬一次

----------------------------------------------------------------
經由測試結果,發現這功能出現的圖片,跟實際上在網站裡點fb分享出現的內容還是有差異
想出現的圖片還是不能控制,根據[此文章]說明
要把 og: 所有屬性都加上才行
header 圖片部分最好再加上
<link href="圖片連結網址" rel="image_src" type="image/jpeg">

應該就能保證分享圖片是自己想要的。 --> 這有空再來測試好了
 
More...
darren, 2014/8/13 下午 07:32:59
Convert.ToInt32 vs Int32.Parse
Convert.ToInt32 vs Int32.Parse
這兩者的差別在於 Convert 物件可傳入的值型別比較多,也可以傳入 null (Nothing) => 0
Int32.Parse只接受 string, 遇到 null (Nothing) 會引發 exception
轉換效能上 Int32.Parse 較佳,但除非是很大量的運算,兩者之間差別微乎其微

若擔心傳入的字串不是數值 會引發錯誤
除了可以使用 try catch 包起來 也可以用 Int32.TryParse 來處理

若是遇到 DB 的資料要轉換 記得要判別是不是 DBNull
Dim intCount As Integer = If(Convert.IsDBNull(row("count")), 0, Convert.ToInt32(row("count")))

// C#
int intCount = Convert.IsDBNull(row("count")) ? 0 : Convert.ToInt32(row("count"));


 
More...
darren, 2014/8/11 下午 01:45:22
[JS]innerHTML、outerHTML
​

有的時候jquery會用到取代標籤的方式
<div id="testId">我是原本文字</div>



以下兩個都是innerHTML
document.getElementById('testId').innerHTML = "我是之後文字";
$('#testId').html("我是之後文字");





以下兩個都是outerHTML
document.getElementById('testId').outerHTML = "<div id="我是原本Id">我是原本文字</div>";
$('#testId').replaceWith("<div id="我是原本Id">我是原本文字</div>");






但是有時候~我們並不是要取代~而是想單純得到html含標籤的內容~
$('#testId').clone().wrap('<div>').parent().html()



 

More...
Doug, 2014/8/11 上午 10:50:29
.net 4.0 exception 潛在危險處理 - 自訂 RequestValidation
自從網站上了 net4.0 之後,網站會有為數不少的 "潛在危險" 的 exception
大都來自不友善的攻擊,想要測試網站的漏洞
網站做這層防護是好事,只是這個東西太敏感了,連簡單的冒號 & 符號都會跳 exception
更慘的是 Google Analytics 會在一些 user cookies 寫入xml文字 ( __utmz=... )
導致正常的 User 都不能正常瀏覽我們網站

解法有兩種:
1. 直接在 web.config 直接設定 不檢查
<system.web>
    <httpRuntime requestValidationMode="2.0" />
    <pages validateRequest="false" />
</system.web>

2. 自訂 RequestValidate (4.0以上才可以用)
請參考此文章 http://msdn.microsoft.com/en-us/library/system.web.util.requestvalidator(v=vs.100).aspx

後者比較算是正解 基本上處理掉 <script 我想 XSS 就解決一大半
 

More...
darren, 2014/7/22 上午 11:53:17
防止 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
youtube隨著螢幕大小自動調整寬高的方法
一般在崁入youtube影片時,影片的寬高是固定的

隨著螢幕大小自動調整寬高的方式:


CSS:
.video-container {
    position: relative;
    padding-bottom: 56.25%;
    overflow: hidden;
}
 
.video-container iframe,
.video-container object,
.video-container embed {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}


HTML:
<div class="video-container">
    <iframe src="http://www.youtube.com/embed/dFVxGRekRSg" frameborder="0" width="560" height="315"></iframe>
</div>
More...
nelson, 2014/7/8 下午 03:46:05
css3 calc() 功能介紹

calc()是CSS3的一個計算長度單位的新功能,能使用數學四則運算方式。

1. 使用“+”“-”“*”“/”四則運算;

2. 可以使用百分比、px、em、rem等單位;

3. 可以混合使用各種單位進行計算。

例:
.thing {
  width: 90%; /* fallback if needed */
  width: calc(100% - 10px);
  width: calc((100% - 12px) / 2);
  width: calc(100%/3 - 2*1em - 2*1px);
}

4. 使用時,"+" & "-" 兩邊需加空格(一定要加), "*" & "/"兩邊是不用加空格(要加也是可以)

5. 瀏覽器的支援:IE9+ , Firefox4.0+ , Chrome , Safari , iOS Safari6.0+ , Android Browser 4.4+
   寫法: width: -moz-calc((100% - 12px) / 2);
              width: -webkit-calc((100% - 12px) / 2);
              width: calc((100% - 12px) / 2);
 
More...
nelson, 2014/7/8 上午 10:23:38
背景圖大小在手機上的限制
在PC版網站上,由於記憶體很大,background-image的圖,沒有甚麼大小限制,但在手機網站上,由於各家手機記憶體不一,
以iPhone 3GS為例,記憶體只有256mb,所以apple有限制背景圖的大小,以下是原文出處連結
https://developer.apple.com/library/safari/documentation/AppleApplications/Reference/SafariWebContent/CreatingContentforSafarioniPhone/CreatingContentforSafarioniPhone.html

大致上來說,iPhone記憶體若是低於256mb 圖片最大不能超過3百萬畫素(長x寬的總像素),但實際上測試iPhone 3GS在ios6系統上,若是超過2百萬畫素,就會無法正常顯示,這是iPhone的bug。
More...
nelson, 2014/7/7 下午 03:35:27
縮小背景圖片方法
 .mobile-share_fb{ display:block; background:url("http://www.shopunt.com/css/mobile/images/mobile-s9398562778.png") no-repeat; background-position: 0 -1648px; height: 80px; width: 80px;} 

 .shrink-attr{ background-size: 152px 2104px; width: 40px; height: 40px; background-position: 0 -824px;} 

 .fb-test{ display:block; background:url("http://www.shopunt.com/images/logo_welcome.jpg") no-repeat; background-size:50% 50%; width: 105px; height: 105px;} 


 
 
 
 
More...
nelson, 2014/7/7 上午 11:58:02
|< …22232425262728293031… >|
頁數 31 / 51 上一頁 下一頁
~ Uwinfo ~