Show Hello World Alert
<!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8"> <title></title> </head> <body> <script src="https://cdnjs.cloudflare.com/ajax/libs/extjs/4.2.1/ext-all.js"></script> <script type="text/javascript"> Ext.application({ name: 'MyApp', launch: function () { alert("Hello World"); } }); </script> </body> </html>
Show Hello World HTML
<!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8"> <title></title> </head> <body>The above code can also be written in a short hand way using xtype (preferred way)<script src="https://cdnjs.cloudflare.com/ajax/libs/extjs/4.2.1/ext-all.js"></script><script type="text/javascript"></script> </body> </html>var myComponent=Ext.create('Ext.Component',{ html: 'HelloWorld'}); Ext.application({ name: 'MyApp', launch: function () { Ext.create('Ext.container.Viewport', { items: [ myComponent ] }); } });
<!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8"> <title></title> </head> <body><script src="https://cdnjs.cloudflare.com/ajax/libs/extjs/4.2.1/ext-all.js"></script><script type="text/javascript"></script> </body> </html>Ext.application({ name: 'MyApp', launch: function () { Ext.create('Ext.container.Viewport', { items: [ { xtype: 'component', html: 'HelloWorld' } ] }); } });
No comments:
Post a Comment
Comments will appear once they have been approved by the moderator