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)
  • API串接 (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
標籤
  • console
  • 8951
  • tim
  • ajax,
  • 706
  • -9328
  • unt
  • 5275
  • 7307
  • 8360
  • [t],
  • TLS1
  • Encode
  • 有潛在危險 Requ
  • index
  • reserve AP
  • web.conf
  • AD
  • 0 UNION AL
  • transactio
  • 壓縮
  • CROS
  • Chrome
  • 20
  • tuple
  • 8
  • aspnet ORD
  • DBCC
  • -7160
  • 解密
  • 134 order
  • user
  • certificat
  • sql 權限
  • [u2]
  • dbcontext
  • 414
  • 946
  • 390
  • window
  • en
  • 232
  • block
  • cell
  • pg2008
  • 6342121121
  • Config
  • rank
  • CK
  • 828
搜尋 innerhtml 結果:
[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
[程式提醒][JS][html] 判斷頁面上某物件是否存在的方式

//判斷頁面上某物件是否存在的方式~
var str = "Hello Morse";
if (document.getElementById('Create_Menu')){
    document.getElementById('Create_Menu').innerHTML = str;
}else{
}

相關文件
http://localhost:2874/WWW20/scripts/Merge/Create_Menu.js
More...
Doug, 2014/2/25 下午 03:26:56
[程式提醒][JS][html] jQuery .html(' long string...') 失敗問題

有時候會用html去取代物件裡的內容,但是當取代的文字過長的時候,很可能會沒有錯誤訊息,但是卻又無法正常顯示,尤其是IE8
var str = "過長的文字";
$(".asdasd").html();
此時我們最好使用以下的方式
var str = "過長的文字";
document.getElementById('Create_Menu').innerHTML = str;
就可以正常執行了
相關參考
http://localhost:2874/WWW20/scripts/Merge/Create_Menu.js


darren 補充:
調整一下標題,讓他較符合發文內容
More...
Doug, 2014/2/25 下午 03:23:27
innerText and textContent
javascript 雖然比較常用 innerHTML, 但偶爾會用到innerText,
可惜 innerText 遇到 FireFox 就不能用了, 因為 FireFox 要用 textContent
而IE卻不能用 textContent, 其他瀏覽器倒是兩種都可用

建議用 jQuery 的 text() 功能,就比較不會有問題

More...
darren, 2012/5/17 上午 11:27:27
~ Uwinfo ~