PDA

View Full Version : Inline javascript in html items of panel



bovello
20 Apr 2011, 7:36 AM
Hi,
I'm using a panel with cube animation, with two faces (face1, face2).
I'd like to insert also some javascript inline commands, but it seems not working properly.
Esample:


var customerPanel4Cube = new Ext.Panel({
fullscreen: false,
layout: 'card',
cardSwitchAnimation : {
type: 'cube',
direction: 'up',
duration: 400
},
width : 250,
height : 250,
items: [{
id: 'face1',
html: '<div><img src="img/cube_1.png"/img></div>'
},{
id: 'face2',
html: '<script>window.alert(\'test\')</script><img onclick="javascript:window.alert(\'test2\')" src="img/cube_2.png"/img>'
}],
...

As you can see I inserted in items 2 some html with inline and onEvent Javascript.
When I click on cube_2.png I can see popup window with "test2" text, but I can't see popup window with "test" text, expected on page loading.
Anyones know the reason?
thanks,

Marco