cleverUtd
cleverUtd

Reputation: 301

Extjs can not work

I am learning Extjs and wrote a demo with Extjs4.2,but it didn't work

<html>
<head>
<title>A Simple JavaScript Function Example</title>

    <style type="text/css" href="css/ext-all.css"></style>
    <script type="text/javascript" src="js/ext.js"></script>
</head>

<body>
<script type="text/javascript">
Ext.application({
    name: 'HelloExt',
    launch: function(){
        Ext.create('Ext.container.Viewport', {
            layout: 'fit',
            items: [
                {
                    title: 'Hello Ext',
                    html : 'Hello! Welcome to Ext JS.'
                }
            ]
        });
    }
});
</script>
</body>

</html>

in chrome,it shows enter image description here

and corresponding place of "ext.js:18" is enter image description here

Upvotes: 1

Views: 102

Answers (1)

A1rPun
A1rPun

Reputation: 16857

Try replacing this line:
<script type="text/javascript" src="js/ext.js"></script>

To this:
<script type="text/javascript" src="js/ext-all.js"></script>

Another thing, try writing your application in a separate file. Inline scripts are a no-go.

Upvotes: 1

Related Questions