動(dòng)態(tài)加載Js代碼到Head標(biāo)簽中的腳本
來源:懂視網(wǎng)
責(zé)編:小采
時(shí)間:2020-11-27 22:44:43
動(dòng)態(tài)加載Js代碼到Head標(biāo)簽中的腳本
動(dòng)態(tài)加載Js代碼到Head標(biāo)簽中的腳本: 代碼如下:HtmlGenericControl Include2 = new HtmlGenericControl(script); Include2.Attributes.Add(type, text/javascript); Include2.InnerHtml = alert('JavaScript in Page Header')
導(dǎo)讀動(dòng)態(tài)加載Js代碼到Head標(biāo)簽中的腳本: 代碼如下:HtmlGenericControl Include2 = new HtmlGenericControl(script); Include2.Attributes.Add(type, text/javascript); Include2.InnerHtml = alert('JavaScript in Page Header')

代碼如下:
HtmlGenericControl Include2 = new HtmlGenericControl("script");
Include2.Attributes.Add("type", "text/javascript");
Include2.InnerHtml = "alert('JavaScript in Page Header');";
this.Page.Header.Controls.Add(Include2);
注, 或使用:
代碼如下:
Literal li = new Literal();
li.Text = "<script...</script>";
this.Page.Header.Controls.Add(li);
聲明:本網(wǎng)頁(yè)內(nèi)容旨在傳播知識(shí),若有侵權(quán)等問題請(qǐng)及時(shí)與本網(wǎng)聯(lián)系,我們將在第一時(shí)間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com
動(dòng)態(tài)加載Js代碼到Head標(biāo)簽中的腳本
動(dòng)態(tài)加載Js代碼到Head標(biāo)簽中的腳本: 代碼如下:HtmlGenericControl Include2 = new HtmlGenericControl(script); Include2.Attributes.Add(type, text/javascript); Include2.InnerHtml = alert('JavaScript in Page Header')