PDA

View Full Version : Exception thrown and not caught



edwardking
6 Aug 2010, 4:30 AM
I run following code,it raise javascript error,code is follows:


<link href="ext/resources/css/ext-all.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="ext/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="ext/ext-all.js"></script>
<script type="text/javascript">
Ext.onReady(function(){
var viewport=new Ext.Viewport({
layout:'border',
items:[
new Ext.BoxComponent({
region:'north',
height:32,
autoEl:{
tag:'img',
src:'images/test.jpg'
}
})
]
})
})
</script>
<body>
<div id='img'>OK</div>
<div></div>
</body>


Error is follows:

Char:164635
Error:Exception thrown and not caught

Why raise javascript error? How to correct above code?

Thanks

Condor
6 Aug 2010, 4:33 AM
1. Use ext-all-debug.js instead of ext-all.js when developing!
2. You can't create a border layout without a center region. You should be using 'fit' layout.