Home  >  Article  >  Web Front-end  >  javascript父子通信_javascript技巧

javascript父子通信_javascript技巧

WBOY
WBOYOriginal
2016-05-16 19:12:591015browse




<script> <BR>Object.prototype.addChild=function(oName, obj) <BR>{ <BR> eval("var p=this."+oName+"= new Object()"); <BR> this[oName]=obj; <BR> this[oName].parent=this; <BR>} <BR></script>
效果演示:

[Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn