| Page 1 of 1 | [ 3 posts ] |
|
I wrote a tabview( YUI3.3 ) content external HTML,but the problem is:how can I run the javascript in the HTML without dispather? Does YUI3 support this feature
Thank you. |
Marco AsbreukYUI Contributor
|
Hey Allan,
If you want to execute the script, you need to insert it as a node. Something like: Code: var head = Y.one('head'); var scriptnode = '<script>' + myscriptcode + '</script>'; head.appendChild(scriptnode); // removing script after being excuted scriptnode.remove(); However, the </script> will break your own code, thus you should use: Code: var SC = 'script'; var head = Y.one('head'); var scriptnode = '<' + SC + '>' + myscriptcode + '</' + SC + '>'; head.appendChild(scriptnode); // removing script after being excuted scriptnode.remove(); Next thing is that you probably don't know the script, so you will have to extract it from your external source. If you are at this stage, than I would suggest to use dispatcher indeed. This module is very robust well-tested and light-weight. Why don't you want to use it? Kind Regards, Marco. |
|
Yeah, why don't you want to use it?
Best Regards, Caridy |
| Page 1 of 1 | [ 3 posts ] |
| You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum |
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info
Powered by phpBB® Forum Software © phpBB Group