[Proto-Scripty] Re: execution order in IE
If you need to garuntee that a variable,function or method exists i would always wait until the dom is ready or in each function that gets called test the function,variable or method exists else timeout untill it does Alex Mcauley http://www.thevacancymarket.com - Original Message - From: JoJo tokyot...@gmail.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Thursday, September 03, 2009 6:31 AM Subject: [Proto-Scripty] execution order in IE In my head, I'm loading several JS files. I'm expecting this to occur: 1) script1.js is loaded 2) script1.js runs - it creates an object 3) script2.js is loaded 4) script2.js runs - it creates a different object that depends on script1's object. 5) and so on This works perfectly in Firefox and Safari, but fails about 25% of the time in IE. I've heard that IE will load JS files in the correct order, but will not guarantee that they are executed in the same order. How can I restructure my code or use Prototype to fix my current code? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] clonePosition not behaving accurately on spans
Hello, I wrote the following HTML code: span id=1 input type=text value=Some text / /span span id=2 style=position: absolute input type=text value=Some text / /span And I would like to place span #2 on the same position as span #1. I tried to run the following command: $('2').clonePosition($('1')); However, span #2 is placed a little below span #1 (2 pixels or so). Does anyone know why this happens? Is there anyway to correct this? It's worth noticing that the method clonePosition works accurately if I replace the spans by divs (or any other block element). Thanks a lot, Tiago --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] element.DispatchEvent is not a function
Hi , I am getting a problem , i have added a js function on onchange event of a drop-down box , which calls Ajax.Updater , now whenever i call this function i get an error element.DispatchEvent is not a function in error console . please help Waiting for prompt reply Vaibhav --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Prototype 1.6.1 Released!
2009/9/2 Alex McAuley webmas...@thecarmarketplace.com: Nice work guys... now i have the mamoth task of updating everything with the new version!!!.. Alex Mcauley http://www.thevacancymarket.com - Original Message - From: T.J. Crowder t...@crowdersoftware.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Tuesday, September 01, 2009 10:23 PM Subject: [Proto-Scripty] Prototype 1.6.1 Released! In case anyone missed it: http://prototypejs.org/2009/9/1/prototype-1-6-1-released Kudos to the team! And separate kudos to Tobie Andrew, who now officially take up the reins: http://prototypejs.org/2009/9/1/core-team-update-andrew-and-tobie-take-the-reins Congrats! -- T.J. Crowder tj / crowder software / com www.crowdersoftware.com Alex, a complete lack of irony tags makes your comment quite ambiguous! -- - Richard Quadling Standing on the shoulders of some very clever giants! EE : http://www.experts-exchange.com/M_248814.html Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 ZOPA : http://uk.zopa.com/member/RQuadling --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Prototype 1.6.1 Released!
Dunno what any of that meant !! just seemed a complicated jumble of words to me! Alex Mcauley http://www.thevacancymarket.com - Original Message - From: Richard Quadling rquadl...@googlemail.com To: prototype-scriptaculous@googlegroups.com Sent: Thursday, September 03, 2009 12:39 PM Subject: [Proto-Scripty] Re: Prototype 1.6.1 Released! 2009/9/2 Alex McAuley webmas...@thecarmarketplace.com: Nice work guys... now i have the mamoth task of updating everything with the new version!!!.. Alex Mcauley http://www.thevacancymarket.com - Original Message - From: T.J. Crowder t...@crowdersoftware.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Tuesday, September 01, 2009 10:23 PM Subject: [Proto-Scripty] Prototype 1.6.1 Released! In case anyone missed it: http://prototypejs.org/2009/9/1/prototype-1-6-1-released Kudos to the team! And separate kudos to Tobie Andrew, who now officially take up the reins: http://prototypejs.org/2009/9/1/core-team-update-andrew-and-tobie-take-the-reins Congrats! -- T.J. Crowder tj / crowder software / com www.crowdersoftware.com Alex, a complete lack of irony tags makes your comment quite ambiguous! -- - Richard Quadling Standing on the shoulders of some very clever giants! EE : http://www.experts-exchange.com/M_248814.html Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 ZOPA : http://uk.zopa.com/member/RQuadling --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: onChange event when div content changed
On Sep 3, 12:07 am, Hipnotik pork...@gmail.com wrote: Hi How to call some action if content of the div element has changed? I'm talking about something like this: $(my-div).observe(change, function(e) { alert(hello); }); Expecting behavior: I have this div id=my-divsome text/div now I'm changing some text to some other text and alert(hello) should be fired. There is no change event specified for div elements, what you are looking for is provided by DOM mutation events: URL: http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-MutationEvent OK in Firefox, Opera, Safari and a few others, but not IE. Some help here: URL: http://www.howtocreate.co.uk/tutorials/javascript/domevents The best cross-browser strategy is to get the function that modifies the DOM to call the function you'd like to add as a DOMSubtreeModified listener. -- Rob --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: onChange event when div content changed
You could use prototype custom events. See example here: http://jsbin.com/ayiku But you will have to fire function manually after update or override default Element.update function to do it for you. Marko On Sep 2, 7:30 pm, Hipnotik pork...@gmail.com wrote: Thanks Walter! I would like to avoid of using PE and global variable to store current innerHTML. I thought that it will be quiet easy and any trick can help me... There is other way - hidden form field and prototype's observer. But this solution doesn't satisfy me too. Anyway, thanks. On 2 Wrz, 17:30, Walter Lee Davis wa...@wdstudio.com wrote: There's no reliable cross-browser event that gets fired when the content of a DIV (as opposed to a form element, say) changes. One thing you might try would be to have a PeriodicalExecuter running. Have it compare a global variable with the current innerHTML of that DIV, and if they don't match, fire the event and update the global variable. This may be more difficult than I am saying it here, it's often quite hard to get a PE to gather an external variable value more than once (at the moment the PE function is instantiated). Walter On Sep 2, 2009, at 10:07 AM, Hipnotik wrote: Hi How to call some action if content of the div element has changed? I'm talking about something like this: $(my-div).observe(change, function(e) { alert(hello); }); Expecting behavior: I have this div id=my-divsome text/div now I'm changing some text to some other text and alert(hello) should be fired. Thnaks for help. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: clonePosition not behaving accurately on spans
T.J., Thanks for the help, but I tried replacing the numbers with valid IDs and the result was the same... Tiago On Sep 3, 5:09 am, T.J. Crowder t...@crowdersoftware.com wrote: Hi, This probably isn't the answer, but FWIW, those IDs are invalid. IDs cannot start with a digit.[1] It'd be nice if correcting them happened to fix it, but I tend to doubt it. :-) [1]http://www.w3.org/TR/html401/types.html#type-name -- T.J. Crowder tj / crowder software / comwww.crowdersoftware.com On Sep 3, 3:24 am, Tiago tiago.torr...@gmail.com wrote: Hello, I wrote the following HTML code: span id=1 input type=text value=Some text / /span span id=2 style=position: absolute input type=text value=Some text / /span And I would like to place span #2 on the same position as span #1. I tried to run the following command: $('2').clonePosition($('1')); However, span #2 is placed a little below span #1 (2 pixels or so). Does anyone know why this happens? Is there anyway to correct this? It's worth noticing that the method clonePosition works accurately if I replace the spans by divs (or any other block element). Thanks a lot, Tiago --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: accessing DOM of iFrame
On Thursday 03 September 2009 06:51:19 kangax wrote: On Sep 2, 2:23 pm, Mojito tokyot...@gmail.com wrote: What's the Prototyped syntax equivalent of: window.frames['iFrameID'].document.getElementById ('elementInsideIFrame'); Current version of Prototype doesn't really support programmatic context extension (such as that of `window.frames['iframeID']` in your example). Instead, Prototype initialization for a given frame is usually accomplished by inserting script referencing prototype.js directly into that frame's document. Once loaded, parsed and executed, that script automatically extends frame's context with all of the prototype goodness. It's then possible to do something like - `window.frames['iframeID'].$$('...')`. Also, don't forget that most of the Prototype DOM abstractions do not play well with elements originating from different documents (since internally, Prototype practically always operates on original document - that which exists in a context where Prototype was initialized, not an actual document of an element). Yes, It gets really confusing sometimes. So... which document is this Node from? Is $ here the $ using the top frame's document or the iframe's document? Ok, so this node is from the other document, which also loads Prototype, but when I extended it with $ I added in functions which were scoped in this document so it breaks, but since Prototype extends Element in Firefox, if I hadn't have done that, it might have worked Some of this could be fixed if Prototype used element.ownerDocument instead of just document (implicitly, window.document) for the Element methods. Any support for this change? Jim -- Jim my wiki ajaxification thing: http://wikizzle.org my blog: http://jimhigson.blogspot.com/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Favicon disappearing in Firefox?
I had a similar issue with caching once with firefox.. i had to delete the whole cache and it reverted the favicon back to the one i chose. Alex Mcauley http://www.thevacancymarket.com - Original Message - From: Walter Lee Davis wa...@wdstudio.com To: prototype-scriptaculous@googlegroups.com Sent: Thursday, September 03, 2009 3:36 PM Subject: [Proto-Scripty] Favicon disappearing in Firefox? I am seeing something on a site I'm developing that I've never seen before. The favicon appears briefly, then (watching in Firebug) the various Ajax requests run, and as soon as they do, the favicon disappears. Nothing in my Ajax callbacks is set to modify the head of the main page, they merely replace the content of certain DIVs on the page. I am using Firefox 2, my client is using Firefox 3.5 and sees the same thing. Safari shows the favicon just fine. I have the following line in the HEAD of the page: link rel=shortcut icon href=/favicon.ico type=image/x-icon / and the file is at the specified location. Does this ring any bells for anyone? Thanks in advance, Walter --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Favicon disappearing in Firefox?
That's the odd thing. It was working, and now it's kinda working -- you see the favicon for a fraction of a second, then it disappears and is replaced with the generic globe. Walter On Sep 3, 2009, at 11:34 AM, Alex McAuley wrote: I had a similar issue with caching once with firefox.. i had to delete the whole cache and it reverted the favicon back to the one i chose. Alex Mcauley http://www.thevacancymarket.com - Original Message - From: Walter Lee Davis wa...@wdstudio.com To: prototype-scriptaculous@googlegroups.com Sent: Thursday, September 03, 2009 3:36 PM Subject: [Proto-Scripty] Favicon disappearing in Firefox? I am seeing something on a site I'm developing that I've never seen before. The favicon appears briefly, then (watching in Firebug) the various Ajax requests run, and as soon as they do, the favicon disappears. Nothing in my Ajax callbacks is set to modify the head of the main page, they merely replace the content of certain DIVs on the page. I am using Firefox 2, my client is using Firefox 3.5 and sees the same thing. Safari shows the favicon just fine. I have the following line in the HEAD of the page: link rel=shortcut icon href=/favicon.ico type=image/x-icon / and the file is at the specified location. Does this ring any bells for anyone? Thanks in advance, Walter --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Can I use Effect.toggle in a list box
Can I use Effect.toggle in an HTML list box? I want the toggle effect to display when an item in the list box is clicked. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: execution order in IE
See this article: http://proto-scripty.wikidot.com/prototype:how-to-load-scripts-dynamically On Thu, Sep 3, 2009 at 9:25 AM, JoJo tokyot...@gmail.com wrote: Instead of loading JS in the head, how do I do includes like virtually all other languages? Isn't Scriptaculous loading Effects.js and other files? How is it doing that? On Sep 2, 11:36 pm, Alex McAuley webmas...@thecarmarketplace.com wrote: If you need to garuntee that a variable,function or method exists i would always wait until the dom is ready or in each function that gets called test the function,variable or method exists else timeout untill it does Alex Mcauleyhttp://www.thevacancymarket.com - Original Message - From: JoJo tokyot...@gmail.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Thursday, September 03, 2009 6:31 AM Subject: [Proto-Scripty] execution order in IE In my head, I'm loading several JS files. I'm expecting this to occur: 1) script1.js is loaded 2) script1.js runs - it creates an object 3) script2.js is loaded 4) script2.js runs - it creates a different object that depends on script1's object. 5) and so on This works perfectly in Firefox and Safari, but fails about 25% of the time in IE. I've heard that IE will load JS files in the correct order, but will not guarantee that they are executed in the same order. How can I restructure my code or use Prototype to fix my current code? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: execution order in IE
^ great article! Now I have another question. Here is my new workflow in an attempt to execute files in the correct order across all browsers. It works in IE8, but not in IE7. In IE7 I get an error saying object expected on line 2 of main.js. This is not very descriptive; what does it mean? (1) include my global wrapper MYAPP.js: MYAPP = {class1: null, class2: null} (2) include Class1.js (no instantiation) (3) include Class2.js (no instantiation) (4) include main.js: Event.observe(window, 'load', function() { MYAPP.class1 = new MYAPP.Class1(); MYAPP.class2 = new MYAPP.Class2(); }); On Sep 3, 10:40 am, DJ Mangus d.man...@gmail.com wrote: See this article:http://proto-scripty.wikidot.com/prototype:how-to-load-scripts-dynami... On Thu, Sep 3, 2009 at 9:25 AM, JoJo tokyot...@gmail.com wrote: Instead of loading JS in the head, how do I do includes like virtually all other languages? Isn't Scriptaculous loading Effects.js and other files? How is it doing that? On Sep 2, 11:36 pm, Alex McAuley webmas...@thecarmarketplace.com wrote: If you need to garuntee that a variable,function or method exists i would always wait until the dom is ready or in each function that gets called test the function,variable or method exists else timeout untill it does Alex Mcauleyhttp://www.thevacancymarket.com - Original Message - From: JoJo tokyot...@gmail.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Thursday, September 03, 2009 6:31 AM Subject: [Proto-Scripty] execution order in IE In my head, I'm loading several JS files. I'm expecting this to occur: 1) script1.js is loaded 2) script1.js runs - it creates an object 3) script2.js is loaded 4) script2.js runs - it creates a different object that depends on script1's object. 5) and so on This works perfectly in Firefox and Safari, but fails about 25% of the time in IE. I've heard that IE will load JS files in the correct order, but will not guarantee that they are executed in the same order. How can I restructure my code or use Prototype to fix my current code? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: execution order in IE
Sometimes IE moans about the lack of a semi colon on the end of some Json'd code For example var foo ={bar:function(){alert('Hi');}} fails in some IE's (cant remember which one) but var foo ={bar:function(){alert('Hi');}; Works in every browser - i had to update some code to fix similar errors on my web desktop Alex Mcauley http://www.thevacancymarket.com - Original Message - From: JoJo tokyot...@gmail.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Thursday, September 03, 2009 7:40 PM Subject: [Proto-Scripty] Re: execution order in IE ^ great article! Now I have another question. Here is my new workflow in an attempt to execute files in the correct order across all browsers. It works in IE8, but not in IE7. In IE7 I get an error saying object expected on line 2 of main.js. This is not very descriptive; what does it mean? (1) include my global wrapper MYAPP.js: MYAPP = {class1: null, class2: null} (2) include Class1.js (no instantiation) (3) include Class2.js (no instantiation) (4) include main.js: Event.observe(window, 'load', function() { MYAPP.class1 = new MYAPP.Class1(); MYAPP.class2 = new MYAPP.Class2(); }); On Sep 3, 10:40 am, DJ Mangus d.man...@gmail.com wrote: See this article:http://proto-scripty.wikidot.com/prototype:how-to-load-scripts-dynami... On Thu, Sep 3, 2009 at 9:25 AM, JoJo tokyot...@gmail.com wrote: Instead of loading JS in the head, how do I do includes like virtually all other languages? Isn't Scriptaculous loading Effects.js and other files? How is it doing that? On Sep 2, 11:36 pm, Alex McAuley webmas...@thecarmarketplace.com wrote: If you need to garuntee that a variable,function or method exists i would always wait until the dom is ready or in each function that gets called test the function,variable or method exists else timeout untill it does Alex Mcauleyhttp://www.thevacancymarket.com - Original Message - From: JoJo tokyot...@gmail.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Thursday, September 03, 2009 6:31 AM Subject: [Proto-Scripty] execution order in IE In my head, I'm loading several JS files. I'm expecting this to occur: 1) script1.js is loaded 2) script1.js runs - it creates an object 3) script2.js is loaded 4) script2.js runs - it creates a different object that depends on script1's object. 5) and so on This works perfectly in Firefox and Safari, but fails about 25% of the time in IE. I've heard that IE will load JS files in the correct order, but will not guarantee that they are executed in the same order. How can I restructure my code or use Prototype to fix my current code? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] 2 ajax calls
In the onSuccess function of one ajax call I am trying to perform an Ajax.Updater to get an fill in another portion of the screen. The server side program is not getting called Using firebug it looks like the call still thinks it is complete from teh previous call. I've only been doing JavaScript a short time, so I may be wrong about that. Here is the function called by the onSuccess from teh previous Ajax.Request. function checkReturn(transport) { var data = transport.responseText.evalJSON(); if (data.GOOD == Y) { $('login').hide(); $('welcome').show(); $('username').insert({before: data.USER}); setCookie('PCAUSER',data.ASID,0); Ajax.Updater('menu', '/%libr%//SYG938', {method: 'post', parameters:{USER: data.ASID, PROGRAM: 'CBG001'} }); }else{ $('signin').enable(); } } --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: execution order in IE
I added a semicolon to the end of my global wrapper var: var MYAPP = {class1: null, class2: null}; But I still get the same order. I believe that since this is executable code, IE doesn't care if it creates it AFTER I try to use it. On Sep 3, 12:56 pm, Alex McAuley webmas...@thecarmarketplace.com wrote: Sometimes IE moans about the lack of a semi colon on the end of some Json'd code For example var foo ={bar:function(){alert('Hi');}} fails in some IE's (cant remember which one) but var foo ={bar:function(){alert('Hi');}; Works in every browser - i had to update some code to fix similar errors on my web desktop Alex Mcauleyhttp://www.thevacancymarket.com - Original Message - From: JoJo tokyot...@gmail.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Thursday, September 03, 2009 7:40 PM Subject: [Proto-Scripty] Re: execution order in IE ^ great article! Now I have another question. Here is my new workflow in an attempt to execute files in the correct order across all browsers. It works in IE8, but not in IE7. In IE7 I get an error saying object expected on line 2 of main.js. This is not very descriptive; what does it mean? (1) include my global wrapper MYAPP.js: MYAPP = {class1: null, class2: null} (2) include Class1.js (no instantiation) (3) include Class2.js (no instantiation) (4) include main.js: Event.observe(window, 'load', function() { MYAPP.class1 = new MYAPP.Class1(); MYAPP.class2 = new MYAPP.Class2(); }); On Sep 3, 10:40 am, DJ Mangus d.man...@gmail.com wrote: See this article:http://proto-scripty.wikidot.com/prototype:how-to-load-scripts-dynami... On Thu, Sep 3, 2009 at 9:25 AM, JoJo tokyot...@gmail.com wrote: Instead of loading JS in the head, how do I do includes like virtually all other languages? Isn't Scriptaculous loading Effects.js and other files? How is it doing that? On Sep 2, 11:36 pm, Alex McAuley webmas...@thecarmarketplace.com wrote: If you need to garuntee that a variable,function or method exists i would always wait until the dom is ready or in each function that gets called test the function,variable or method exists else timeout untill it does Alex Mcauleyhttp://www.thevacancymarket.com - Original Message - From: JoJo tokyot...@gmail.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Thursday, September 03, 2009 6:31 AM Subject: [Proto-Scripty] execution order in IE In my head, I'm loading several JS files. I'm expecting this to occur: 1) script1.js is loaded 2) script1.js runs - it creates an object 3) script2.js is loaded 4) script2.js runs - it creates a different object that depends on script1's object. 5) and so on This works perfectly in Firefox and Safari, but fails about 25% of the time in IE. I've heard that IE will load JS files in the correct order, but will not guarantee that they are executed in the same order. How can I restructure my code or use Prototype to fix my current code? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: 2 ajax calls
Sorry pulled this from a template /%libr%/ will actually get filled in with the correct path to that program on the server Ajax.Updater('menu', '/%libr%//SYG938', {method: 'post', parameters:{USER: data.ASID, PROGRAM: 'CBG001'} }); --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: onChange event when div content changed
@RobG I'm not sure that DOMSubtreeModified works in the IE. I tried to use it and I think it doesn't. @Marko That's the problem... I don't want to fire it manually. But thanks guys for help. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: accessing DOM of iFrame
On Sep 3, 11:42 am, Jim Higson j...@wikizzle.org wrote: On Thursday 03 September 2009 16:29:33 Jim Higson wrote: On Thursday 03 September 2009 06:51:19 kangax wrote: On Sep 2, 2:23 pm, Mojito tokyot...@gmail.com wrote: What's the Prototyped syntax equivalent of: window.frames['iFrameID'].document.getElementById ('elementInsideIFrame'); Current version of Prototype doesn't really support programmatic context extension (such as that of `window.frames['iframeID']` in your example). Instead, Prototype initialization for a given frame is usually accomplished by inserting script referencing prototype.js directly into that frame's document. Once loaded, parsed and executed, that script automatically extends frame's context with all of the prototype goodness. It's then possible to do something like - `window.frames['iframeID'].$$('...')`. Also, don't forget that most of the Prototype DOM abstractions do not play well with elements originating from different documents (since internally, Prototype practically always operates on original document - that which exists in a context where Prototype was initialized, not an actual document of an element). Yes, It gets really confusing sometimes. So... which document is this Node from? Is $ here the $ using the top frame's document or the iframe's document? Ok, so this node is from the other document, which also loads Prototype, but when I extended it with $ I added in functions which were scoped in this document so it breaks, but since Prototype extends Element in Firefox, if I hadn't have done that, it might have worked Some of this could be fixed if Prototype used element.ownerDocument instead of just document (implicitly, window.document) for the Element methods. Actually, I'm starting to think this isn't really so. Some cases would work but there are a *lot* of references to document in the Prototype source and in many cases there isn't an element to query for its ownerDocument. [...] Well, using `ownerDocument` of an element passed to a method should solve most of these problems. When method doesn't take an element, one possibility is to pass document reference as an optional argument to a method. For example, - $('foo', otherDocument); Unfortunately, things like these should really be accounted for from the beginning (when designing API of a library). Prototype didn't account for it in the beginning and made `$` a variadic function (which actually has its own problems, but that's unrelated to context issue :)). This design decision pretty much prevents document passing as long as `$` has to be backwards compatible. Another thing that can be employed is keeping publicly available current document reference somewhere on Prototype (e.g., `Prototype.document`); then, internally, always access document via that one single reference. This way, instead of: foo(/*...*/, someDocument); bar(/*...*/, someDocument); baz(/*...*/, someDocument); - user could do - Prototype.document = someDocument; foo(/*...*/); bar(/*...*/); baz(/*...*/); or maybe even: Prototype.withDocument(someDocument, function(){ foo(/*...*/); bar(/*...*/); baz(/*...*/); }); - where `withDocument` would set and unset certain document around callback (second argument) execution. Another problem with multiple contexts and Prototype is in its core architecture. The fact that Prototype needs certain native objects to be augmented makes it difficult to work with different contexts. For example, Prototype augments `document` with `fire` method during its initialization. It then, quite reasonable, assumes that `document.fire` is always present. Now, if some method utilizes `document.fire` (or, say, `Prototype.document.fire`), it's possible that `Prototype.document` references pure unmodified document and that this document has no `fire` at all. To work around that, Prototype has to always use something like `Event.fire(document, ...)` instead of `document.fire(...)` or, perhaps, augment document with certain methods before trying to use them (if they don't exist). -- kangax --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: clonePosition not behaving accurately on spans
This may not be Prototype's fault after all. I made a very simple test now. I compared the rendering of two pieces of HTML code separately: (1) span id=test input type=text value=Some text / /span (2) div id=test input type=text value=Some text / /div I measured both inputs with a pixel ruler and I realized their rendering is identical. Not a single pixel of difference. In both cases, the distance between the top of the browser window and the top of the input is 8 pixels. Then, I used a native method to obtain the position from the top: document.getElementById('test').offsetTop In case (1), the command returned 11 pixels. In case (2), the command returned 8 pixels. For some reason, the browser reports a wrong offsetTop when a span is used (even though the element is properly placed). Because Prototype's implementation of the clonePosition method relies on such values, the end result is inaccurate. Any thoughts why this happens? My tests were performed in Firefox 3.5.2. Thanks again, Tiago On 3 set, 10:39, Tiago tiago.torr...@gmail.com wrote: Alex, I think you're right. But I thought an element had to be absolutely positioned for clonePosition to work properly. In fact, I tried to turn span #2 into a relative element and the positioning was not even close. You said span #2 inherits the style, but the parent element, in my case, is just the body of the document. Should I place another span around the two spans? I'm not sure I follow you. Thanks! Tiago On Sep 3, 7:41 am, Alex McAuley webmas...@thecarmarketplace.com wrote: Its to do with the absolute positioning of Span 2 as it inherits the style... Alex Mcauleyhttp://www.thevacancymarket.com - Original Message - From: Tiago tiago.torr...@gmail.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Thursday, September 03, 2009 3:24 AM Subject: [Proto-Scripty] clonePosition not behaving accurately on spans Hello, I wrote the following HTML code: span id=1 input type=text value=Some text / /span span id=2 style=position: absolute input type=text value=Some text / /span And I would like to place span #2 on the same position as span #1. I tried to run the following command: $('2').clonePosition($('1')); However, span #2 is placed a little below span #1 (2 pixels or so). Does anyone know why this happens? Is there anyway to correct this? It's worth noticing that the method clonePosition works accurately if I replace the spans by divs (or any other block element). Thanks a lot, Tiago --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---