Search code examples
extjs3

Unable to view extjs script in browser


I am not able to view the extjs js code in my js page. The page is opened in browser with title whatever i gave in the title tag. But the script is not getting link in body. Could anyone please identify the error the below code. Please help me to identify the issue.

Platform using is netbeans 7.1 + Apache Tomcat 6 + extjs-3.2.1

index.jsp

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <link rel="stylesheet" type="text/css" href="JS/ext-3.2.1/resources/css/ext-all.css">
    <script type="text/javascript" src="JS/ext-3.2.1/ext-all.js"></script>
    <title>Extjs learning</title>
</head>
<body>
    <script type="text/javascript" src="JS/BorderLayout.js"></script>
</body>
</html>

BorderLayout.js

/* 
 * author : Bijoy Bahuleyan
 * date   :
 */

Ext.onReady(function(){    
Ext.QuickTips.init();    
Ext.container.Viewport({
    layout:  'border',
    id: 'mainbody',
    items: [
    {
        region: 'North',
        id: 'north',
        collapsible: true,
        title: 'North',
        html: 'North'
    },
    {
        region: 'south',
        id: 'south',
        collapsible: true,
        title: 'South',
        split: true,
        html: 'South'
    },
    {
        region: 'center',
        id: 'center',
        collapsible: true,
        title: 'Center',
        split: true,
        html: 'Center'
    },
    {
        region: 'east',
        id: 'east',
        collapsible: true,
        title: 'East',
        split: true,
        html: 'East'
    },
    {
        region: 'west',
        id: 'west',
        collapsible: true,
        title: 'West',`enter code here`
        split: true,
        html: 'West'
    }
    ],
    renderTo: Ext.getBody() 
});

The linking to the pages are correct, I cross checked several times

Thanks in advance !


Solution

  • If you are using that code exactly as it appears there, the line that says "title: 'West','enter code here'" will definitely break it. Remove the 'enter code here' or comment it out as //enter code here. It's near the bottom of your javascript example.

    If you're not using the code exactly as it appears, test it at jsfiddle.net. If it works, it's definitely your paths.