-
23 Apr 2007 8:56 AM #1
Prototype adapter does not allow executing script in dynamically loaded ContentPanels
Prototype adapter does not allow executing script in dynamically loaded ContentPanels
Well, I can confirm it
The Prototype adapter is borked in 1.0
Using the BorderLayout (I was using /ext-1.0/examples/layout/complex.html to test with), loading a ContentPanel dynamically with something like this:
(or any of the other methods I've tried) to load a page that looks like this:PHP Code:Ext.Element.get(id).getUpdateManager().update({url:"/ext-1.0/examples/layout/test.html", scripts:true});
Using the prototype adapter the script inside the < script> block will not run, but making no other changes to complex.html except for switching the prototype adapter for the YUI adapter the script inside the < script> block will run when loaded.HTML Code:<div class="navContent"> <p onclick="alert('wth! Inline script works fine...');">Now is the time for all good men to come to the aid of their country</p> <script type='text/javascript'> alert( "...but script in a <Script> tag does not run" ); </script> </div>
Here are the includes I am using for the adapters, paths verified 1,000 times and known to be good
yui
prototypeHTML Code:<script type="text/javascript" src="/ext-1.0/adapter/yui/yui-utilities.js"></script> <script type="text/javascript" src="/ext-1.0/adapter/yui/ext-yui-adapter.js"></script>
HTML Code:<script type="text/javascript" src="/ext-1.0/adapter/prototype/prototype.js"></script> <script type="text/javascript" src="/ext-1.0/adapter/prototype/scriptaculous.js?load=effects"></script><!--copied--> <script type="text/javascript" src="/ext-1.0/adapter/prototype/ext-prototype-adapter.js"></script>
.Last edited by RobbyRacoon; 23 Apr 2007 at 8:57 AM. Reason: formatting
-
23 Apr 2007 9:30 AM #2
Ugh... Apparently prototype itself is the problem, since even using something like this:
Results in all < script> blocks in the test.php file being stripped. What a pain!!!PHP Code:new Ajax.Updater('targetDivID', 'test.php', { method: 'get' });
According to the page at http://www.prototypejs.org/api/ajax/updater it is well known (and a conscious decision maybe?) that the script blocks are stripped from the Ajax response. Scroll down to About evalScripts and defining functions to see what I mean :/
.
-
24 Apr 2007 5:13 AM #3
I can't see a reason to use the prototype-adapter. From what I've heard, prototype is well dodgy. The YUI classes upon which the yui-adapter builds are very robust.
-
24 Apr 2007 7:06 AM #4
heh. Well, though I might agree with you now that I've gotten to this point, I had not had any problems with it long enough to get a pretty significant portion of my project done

So now I've refactored everything to use JQuery (path of least least divergence), and everything seems to be going well for the most part. I will look into YUI after I get this project done, since this current project is comparitively small in scope and is well under way.
Oh.... Yeah... by the way.....
Ext JS Rocks!
-
25 May 2007 11:12 AM #5
Wow... and I thought I was going crazy... I ran into this issue and fussed around every which way I could to try and get those scripts to run.
I just stripped out all the YUI code from my rails app a little while back and this mysteriously broke, I guess I'll have to put YUI or jQuery back in then
-
25 May 2007 1:42 PM #6
I saw this the other day, maybe you'll find it useful
http://yehudakatz.com/2007/05/17/jqu...resh-approach/
-
18 Jul 2007 4:30 PM #7
Comments and Thanks
Comments and Thanks
I have been experimenting with Ext for a little while now and trolling the forums for info. I am one who usually searches the ends of the earth before wasting someone's time with a question that has been asked and answered so many times before. And i also believe that you gotta get dirty and "read, read, read" to learn.
I must say that the level of support to the community and the value of this product is awe inspiring to say the least.
For my part though, I would have saved a lot of time if I would have found this thread a long time ago. I was using Prototype until now. My whole project depends upon the scripts being parsed in for Ajax loads. I really think there should be a sticky on this.
Again thanks very much for your hard work. I'm sure I will be a "REAL" supporter very soon.


Reply With Quote