Thanh tien tr?nh Internet Explorer v?n ti?p t?c tng khi m?t hnh vi km theo ?ng ?c chn vo trong m?t trang

D?ch tiu ? D?ch tiu ?
ID c?a bi: 320731
Bung t?t c? | Thu g?n t?t c?

? Trang ny

TRI?U CH?NG

Khi b?n t? ?ng thm m?t ?i t?ng c ch?a m?t hnh vi nh km vo m?t trang Web, v cc hnh vi ph?i ?c t?i xu?ng, thanh ti?n ? trong Microsoft Internet Explorer ti?p t?c tng. Thanh tien tr?nh ti?p t?c cho th?y s? ti?n b? ngay c? sau khi cc hnh vi ?c n?p, v cc trang ?c k?t xu?t. Tuy nhin, hnh vi nh km ho?t ?ng m?t cch chnh xc m khng c b?t k? v?n ? b?t ng?.

NGUYN NHN

V?n ? ny c th? x?y ra khi M?i chuy?n thm trang ?c ch?n cho cc Ki?m tra cc phin b?n m?i hn c?a cc trang ?c lu tr? ty ch?n trong Internet Explorer.

? xem cc Ki?m tra cc phin b?n m?i hn c?a cc trang ?c lu tr? ty ch?n, h?y lm theo cc b?c sau:
  1. Trong Internet Explorer, nh?p vo Cng cu, sau b?m Tuy chon Internet.
  2. Trn cc T?ng qut tab, b?m vo Thit t d?i T?p Internet t?m th?i.
  3. Trong cc Thit t h?p tho?i, xem cc Ki?m tra cc phin b?n m?i hn c?a cc trang ?c lu tr? ty ch?n.

CCH GI?I QUY?T KHC

? lm vi?c xung quanh v?n ? ny, c nh?ng hnh ?ng sau y:
  • Trnh ?ng chn b?t k? v?t th? no c ch?a hnh vi km theo.
  • ?t tin nh?n vn b?n trong thanh tr?ng thi c?a Internet Explorer sau khi b?n thm cc ?i t?ng.

THNG TIN THM

V?n ? ny x?y ra n?u b?n t? ?ng thm m?t hnh vi km theo b?ng cch thay th? HTML bn trong c?a m?t ph?n t?, ch?ng h?n nh cc DIV y?u t?, b?ng cch s? d?ng cc createElement phng php ho?c cc insertAdjacentHTML phng php, ho?c b?ng cch t? ?ng thay ?i cc className b?t ?ng s?n c?a m?t ph?n t?.

Cac bc m phong hanh vi.

  1. Sao chp m?u m? sau y, v sau lu m?u m? vo m?t t?p tin ?c ?t tn Test.htm.
    <HTML>
        <HEAD>
            <STYLE>
                .UseBehavior
                {
                    behavior: url(behavior.htc);
                }
            </STYLE>
    
            <SCRIPT>
                function DoClick()
                {
                    SetTarget.innerHTML = "<DIV CLASS='UseBehavior'>Hello World</DIV>";
    		//Uncomment the following line to work around the problem.
                    //window.status="Finished";	
                }
            </SCRIPT>
        </HEAD>
    
        <BODY>
            <DIV ID="SetTarget">Click to try the test</DIV><BR>
            <BUTTON onClick="DoClick()">Click to insert the attached behavior.</BUTTON>
        </BODY>
    </HTML>
    					
  2. Sao chp m?u m? sau y, v sau lu m?u m? vo m?t t?p tin ?c ?t tn Behavior.htc. ? Behavior.htc vo cng m?t th m?c m t?p tin Test.htm c v? tr.
    <PUBLIC:COMPONENT>
    <PUBLIC:ATTACH EVENT="ondocumentready" ONEVENT="Element_DocumentReady()" />
    
    <SCRIPT language="JScript">
    function Element_DocumentReady()
    {
    	// This is almost an empty behavior.
    }
    </SCRIPT>
    </PUBLIC:COMPONENT>
    					
  3. M? t?p tin Test.htm, v sau nh?p vo Nh?n vo y ? chn nh km hnh vi.
Sau khi vn b?n thay ?i t? "Nh?n vo y ? th? cc bi ki?m tra" "Hello World", hnh vi ?c thm. Thanh ti?n ? t?i v th?i h?n.

THAM KH?O

? thm thng tin v? pht tri?n trang Web d?a trn cc gi?i php cho Internet Explorer, h?y truy c?p trang Web Microsoft Developer Network (MSDN) sau y:
B?n C?p Nh?t Internet Explorer
http://MSDN.Microsoft.com/IE/
B?ng cch s? d?ng DHTML hnh vi
http://MSDN.Microsoft.com/Library/Default.asp?URL=/workshop/author/behaviors/HOWTO/using.asp
B?ng cch s? d?ng cc thnh ph?n HTML ? th?c hi?n hnh vi DHTML trong k?ch b?n
http://MSDN.Microsoft.com/Library/Default.asp?URL=/workshop/author/behaviors/HOWTO/creating.asp

Thu?c tnh

ID c?a bi: 320731 - L?n xem xt sau cng: 27 Thang Tam 2011 - Xem xt l?i: 2.0
T? kha:
kbtshoot kbprb kbpending kbmt KB320731 KbMtvi
My d?ch
QUAN TRONG: Bi vi?t ny ?c d?ch b?ng ph?n m?m d?ch my c?a Microsoft ch? khng ph?i do con ng?i d?ch. Microsoft cung c?p cc bi vi?t do con ng?i d?ch v c? cc bi vi?t do my d?ch ? b?n c th? truy c?p vo t?t c? cc bi vi?t trong C s? Ki?n th?c c?a chng ti b?ng ngn ng? c?a b?n. Tuy nhin, bi vi?t do my d?ch khng ph?i lc no c?ng hon h?o. Lo?i bi vi?t ny c th? ch?a cc sai st v? t? v?ng, c php ho?c ng? php, gi?ng nh m?t ng?i n?c ngoi c th? m?c sai st khi ni ngn ng? c?a b?n. Microsoft khng ch?u trch nhi?m v? b?t k? s? thi?u chnh xc, sai st ho?c thi?t h?i no do vi?c d?ch sai n?i dung ho?c do ho?t ?ng s? d?ng c?a khch hng gy ra. Microsoft c?ng th?ng xuyn c?p nh?t ph?n m?m d?ch my ny.
Nh?p chu?t vo y ? xem b?n ti?ng Anh c?a bi vi?t ny:320731
Khc t Ni dung trong C s Kin thc Khng con c h tr
Bi vi?t ny ni v? cc s?n ph?m m Microsoft khng c?n h? tr? n?a. Do , bi vi?t ny ?c cung c?p "nguyn b?n" v s? khng ?c c?p nh?t.

Cung cp Phan hi

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com