來源:互聯網
上載者:User
關鍵字
javascript
php
css
html5
正常啟動並執行結果:
aobj.href="abcdefghi";aobj.target="_blank";aobj.style.backgroundColor='yellow';aobj.style.float= "left"; aobj.style.overflow="hidden";aobj.appendChild(img);
用了with之後不能啟動並執行結果:
wiht(aobj){href="abcdefghi";target="_blank";style.backgroundColor='yellow';style.float= "left"; style.overflow="hidden";appendChild(img);}
哪裡有問題,還望指教!
直接幫我改了我再摸索吧,謝謝了!
回複內容:
正常啟動並執行結果:
aobj.href="abcdefghi";aobj.target="_blank";aobj.style.backgroundColor='yellow';aobj.style.float= "left"; aobj.style.overflow="hidden";aobj.appendChild(img);
用了with之後不能啟動並執行結果:
wiht(aobj){href="abcdefghi";target="_blank";style.backgroundColor='yellow';style.float= "left"; style.overflow="hidden";appendChild(img);}
哪裡有問題,還望指教!
直接幫我改了我再摸索吧,謝謝了!
wiht拼字錯誤
aobj = { href: null, target: null, style: {}, appendChild: null};with(aobj) { href="abcdefghi"; target="_blank"; style.backgroundColor='yellow'; style.float= "left"; style.overflow="hidden"; appendChild(img);}
with裡面用不了沒定義的屬性