View Full Version : TabPanel's problem,the scripts don't work in IE,Help!

20 May 2007, 8:04 PM
TabPanel's problem,the scripts don't work in IE,Help!
For a sample test,change the EXT/examples/tabs/tabs.html 。
get EXT/examples/tabs/tabs-example.js file,and seek this code:

var tab2 = jtabs.addTab('jtabs-2', "Ajax Tab 1");
var updater = tab2.getUpdateManager();
updater.loadScripts=true; //this code is add by myself,for test scripts's working
tab2.on('activate', updater.refresh, updater, true);

and add this code in ajax1.html

<script type="text/javascript">

It's work in FF,but can't work in IE6,
who can help me?

21 May 2007, 12:07 AM
is there any particular reason for the <!-- -> comments as they serve no function whatsoever? if you remove them does that help?

21 May 2007, 12:57 AM
thank u,I test this code like u said,the js code work will.but if the html has css,It can't work.
may I create a tabpanel use iframe,and how?

21 May 2007, 1:02 AM
is it only IE that is not recognising the CSS? It is never something I had tried though I know that FF interprets CSS. Could you post a bit more of an example?

21 May 2007, 1:49 AM
I try to use code like this:

//repeat create Tab

var iframe = jtabs.el.createChild({tag: 'iframe', border:0,frameborder: 0, src: Item.URL});
var tab2 = jtabs.addTab(iframe, Item.name);

var updater = tab2.getUpdateManager();
updater.loadScripts=true; //这句很重要!!!!
tab2.on('activate', updater.refresh, updater, true);


but,it's still no work!not only ie ,but also ff
the tab's html code like this:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>Hello World Dialog Example</title>
<link rel="stylesheet" type="text/css" href="../../resources/css/ext-all.css" />
<link rel="stylesheet" type="text/css" href="../../../sbui.css"/>

<script type="text/javascript" src="../../adapter/yui/yui-utilities.js"></script>
<script type="text/javascript" src="../../adapter/yui/ext-yui-adapter.js"></script>

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

<script language="javascript">
var selCompare= new (function(){

Ext.onReady(selCompare.init, selCompare, true);



the error like this:
Ext is not defined
[Break on this error] Ext.onReady(selCompare.init, selCompare, true);

it's seem that the js file can't load in iframe,
how to soluate it?

21 May 2007, 2:05 AM
iframes don't need an UpdateManager, there's no "loadScripts". They are semi-independent browser windows.

21 May 2007, 2:22 AM
just to recap back to the original problem:
TabPanel's problem,the scripts don't work in IE,Help!
You could not get the javascript working in the loaded page but now that works.
However I assume that in the page you were trying to load into a tab had some CSS in it that did not seem to work when the page was loaded and for that reason you are now looking at iFrames.
Is the CSS just not making the changes you expect or does it conflict with some existing styles?
If you are loading this into a panel of the main document, is it possible to include the CSS as part of the "top level" page and hence avoid the need for the iFrame?

21 May 2007, 2:49 AM
CSS is ignored when content is dynamically loaded. It must go in the top level page.

21 May 2007, 3:15 AM
ok, I think this is a bit of a grey area for browsers. FF seems to load the css as I had a problem that took me ages to track down where a page was generating an exception in tomcat. As this was being loaded by ajax somewhere else on the page, the CSS styles included on thaterror page suddenly changed the layout of my existing page! ( I think I was using innerHTML but I cannot remember to be exact)

that said - bottom line, don't load CSS dynamically!