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 (40)
  • SQL 2008 (25)
  • mirror (4)
  • SVN (4)
  • IE (9)
  • IIS (22)
  • 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 (3)
  • 開發工具 (6)
  • JSON (1)
  • Excel2007 (1)
  • 試題 (3)
  • LINQ (1)
  • bootstrap (0)
  • Vue (3)
  • IIS7 (3)
  • foodpanda (2)
  • 編碼 (2)
  • 資安 (4)
  • Sourcetree (1)
  • MAUI (1)
  • CMD (1)
  • my sql (1)
  • API串接 (1)
  • EF MODEL (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
標籤
  • aspx[t]
  • validation
  • 5986
  • http 錯誤 40
  • E6x8D1Kh
  • nelson
  • cross
  • C
  • web
  • 140
  • ip21211211
  • SqlCacheTa
  • join
  • textwriter
  • sp_scan03N
  • line pay??
  • 死結
  • AutoPostBa
  • a
  • HTTP 錯誤 40
  • shopee
  • qe8ye3bj
  • EnuM
  • 6361
  • -4288
  • josn
  • Json.NET
  • Content-Di
  • ctcn
  • 5168
  • 12
  • VS
  • egs
  • 666
  • SVG
  • 578
  • 1569
  • 318
  • firefox OR
  • sqld
  • 846
  • -4737 UNIO
  • SmtpClient
  • 136
  • sp_
  • MTk1My0xOT
  • 1489
  • -5229
  • 403 - forb
  • 0
搜尋 js, 結果:
網站字型檔跨站CORS問題處理
因為想把同一網站下的靜態檔用另一個 domain  處理
但是 css 如果有設定下載字型檔 .ttf or .woff
就會出現 CORS 問題,其他 js, css,圖片就能正常

為了解決CORS的問題,其實只要 Response Header 要設定  Access-Control-Allow-Origin: *
或是設定特定網站 Access-Control-Allow-Origin: https://www.s3.com.tw

後來發現 IIS 網站可以設定 web.config 設定 response header 解決
當然要先裝一下 urlrewrite 2.0 才可以使用
只針對 font 類型的靜態檔

<configuration>
<system.webServer>
    <rewrite>
     <outboundRules>
        <rule name="Add CORS header for fonts" preCondition="IsFontFile">
         <match serverVariable="RESPONSE_Access-Control-Allow-Origin" pattern=".*" />
         <action type="Rewrite" value="*" />
        </rule>
        <preConditions>
         <preCondition name="IsFontFile">
            <add input="{REQUEST_URI}" pattern="\.woff2$|\.woff$|\.ttf$|\.eot$|\.otf$" />
         </preCondition>
        </preConditions>
     </outboundRules>
    </rewrite>
</system.webServer>
</configuration>

{REQUEST_URI} 也可以改為 {PATH_INFO}
More...
darren, 2026/3/4 下午 05:02:35
Name Contains

<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-latest.js"></script>
</head>
<body>
<input name="man-news" />

<input name="milkman" />
<input name="letterman2" />
<input name="newmilk" />
<script>$('input[name*="man"]').val('has man in it!');</script>

</body>
</html>

More...
Reiko, 2012/4/13 下午 07:31:28
~ Uwinfo ~