Hi folk I have had Prototype 1.4 working well for some time now. I recently upgraded to 1.5 because i wanted to take advantage of of the effects.js library from Scriptaculous. I got my effects working just fine but in return my older code based on v 1.4 stopped working. If i change back to 1.4 then my effects dont work. Any idea what is causing the conflict between the two versions. The code in particular that I''m trying to execute is a simple Ajax.updater class which appears to be the same in both scripts. Im using IE 7 Any help would be apprectiated --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs -~----------~----~----~----~------~----~------~--~---
Andrew Dupont
2006-Oct-23 17:48 UTC
Re: I upgraded to 1.5.0 and my old code stopped working
Can you post the relevant code? Cheers, Andrew rconnor wrote:> Hi folk > > I have had Prototype 1.4 working well for some time now. I recently > upgraded to 1.5 because i wanted to take advantage of of the effects.js > library from Scriptaculous. I got my effects working just fine but in > return my older code based on v 1.4 stopped working. If i change back > to 1.4 then my effects dont work. > > Any idea what is causing the conflict between the two versions. The > code in particular that I''m trying to execute is a simple Ajax.updater > class which appears to be the same in both scripts. > > Im using IE 7 > > Any help would be apprectiated--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs -~----------~----~----~----~------~----~------~--~---
This is an example of many pieces that have broken function loadmessagebody(docid) { var friendLoader = new Ajax.Updater(''messagebody'', ''/'' + strDbPath + ''/messagebody/'' + docid + ''?opendocument'' ); } --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs -~----------~----~----~----~------~----~------~--~---
Christophe Porteneuve
2006-Oct-24 09:40 UTC
Re: I upgraded to 1.5.0 and my old code stopped working
Hey there, rconnor a écrit :> This is an example of many pieces that have broken > > function loadmessagebody(docid) { > var friendLoader = new > Ajax.Updater(''messagebody'', ''/'' + strDbPath + ''/messagebody/'' + > docid + ''?opendocument'' ); > }Can you give us the code piece where you bind / invoke this loadmessagebody function? The issue might lie there, because I see nothing here that should make your code fail. -- Christophe Porteneuve aka TDD tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs -~----------~----~----~----~------~----~------~--~---
It''s in the onload event of my page Simply says loadmessagebody(document.forms[0].docid.value) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs -~----------~----~----~----~------~----~------~--~---
Christophe Porteneuve
2006-Oct-24 16:53 UTC
Re: I upgraded to 1.5.0 and my old code stopped working
Hey there, rconnor a écrit :> It''s in the onload event of my page > > Simply says loadmessagebody(document.forms[0].docid.value)This won''t work outside of IE, btw, since this is not DOM-based (your "docid" property, which is name- or id-derived). You might want to change your loadmessagebody to no arguments, then get the value from its code like this: var value = $F(''docid''); (Assuming your form field has an id attribute with value ''docid''. The name field won''t cut it). -- Christophe Porteneuve aka TDD tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs -~----------~----~----~----~------~----~------~--~---
Christophe Porteneuve wrote:> Hey there, > > rconnor a écrit : > > It''s in the onload event of my page > > > > Simply says loadmessagebody(document.forms[0].docid.value) > > This won''t work outside of IE, btw, since this is not DOM-based (your > "docid" property, which is name- or id-derived).Incorrect. The forms collection is a formal collection in the W3C DOM HTML specification: <URL: http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-1689064 > Dot property access to members of the form''s elements collection is supported in browsers at least since Navigator 3 and IE 4, probably earlier. While not explicitly mentioned in the W3C specification, it is a feature of the ECMAScript Language and therefore can be expected to work on all compliant browsers. You could have tested your premise with a few lines of code: <form action=""> <div><input type="text" name="docid" value="the doc id"></div> </form> <script type="text/javascript"> alert(document.forms[0].docid.value); </script>> You might want to change your loadmessagebody to no arguments, then get > the value from its code like this: > > var value = $F(''docid''); > > (Assuming your form field has an id attribute with value ''docid''. The > name field won''t cut it).How does hard-coding the value of the form control help the OP''s cause? When using forms, both $() and hence $F() have problems if id and name attributes share the same value. Using names for form controls is valid HTML and provides support for old browsers. -- Fred --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs -~----------~----~----~----~------~----~------~--~---
rconnor wrote:> Hi folk > > I have had Prototype 1.4 working well for some time now. I recently > upgraded to 1.5 because i wanted to take advantage of of the effects.js > library from Scriptaculous. I got my effects working just fine but in > return my older code based on v 1.4 stopped working. If i change back > to 1.4 then my effects dont work. > > Any idea what is causing the conflict between the two versions. The > code in particular that I''m trying to execute is a simple Ajax.updater > class which appears to be the same in both scripts. > > Im using IE 7 > > Any help would be apprectiatedStart using Firefox with the Firebug extension, at least for development, and you''ll likely find your problem very quickly. IE 7 is only marginally more standards compliant that IE 6 - it is primarily a security and feature update, standards compliance was low on the list of priorities. -- Fred --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs -~----------~----~----~----~------~----~------~--~---
Martin Bialasinski
2006-Nov-01 00:25 UTC
Re: I upgraded to 1.5.0 and my old code stopped working
On 11/1/06, Fred <ozfred-AFFH1GffN5hPR4JQBCEnsQ@public.gmane.org> wrote:> Incorrect. The forms collection is a formal collection in the W3C DOM > HTML specification:> alert(document.forms[0].docid.value);Not quite. HTMLFormElement does not have a "docid" property defined in the above mentioned specification. You have to go through its elements properties. document.forms[0].elements["docid"].value> When using forms, both $() and hence $F() have problems if id and name > attributes share the same value.Only in Internet Explorer and only there is more than one element involved in this "sharing", no?> Using names for form controls is valid HTML and provides support for > old browsers.The "name" attribute is required for all but submit and reset inputs. Bye, Martin --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs -~----------~----~----~----~------~----~------~--~---
Martin Bialasinski wrote:> On 11/1/06, Fred <ozfred-AFFH1GffN5hPR4JQBCEnsQ@public.gmane.org> wrote: > > > Incorrect. The forms collection is a formal collection in the W3C DOM > > HTML specification: > > > alert(document.forms[0].docid.value); > > Not quite. HTMLFormElement does not have a "docid" property defined in > the above mentioned specification.I didn''t say it did - please quote properly. If you remove material, indicate where it is removed. I think in this case you removed the link and kept some code that was posted several lines below it.> You have to go through its elements > properties. > > document.forms[0].elements["docid"].valueYou don''t *have* to, browsers will do it for you although there is nothing in any specification that says they must, hence my comment on dot property access. My response was in regard to the assertion that using dot property access would fail, you removed that from the context of the discussion. Using explicit references to collections is generally considered better practice, thank you for including it.> > When using forms, both $() and hence $F() have problems if id and name > > attributes share the same value. > > Only in Internet Explorer and only there is more than one element > involved in this "sharing", no?Yes. "More than one" in that one element has a name that is the same as the id of some other element. "Sharing" implies (rather strongly) more than one.> > Using names for form controls is valid HTML and provides support for > > old browsers. > > The "name" attribute is required for all but submit and reset inputs.According to the W3C specification, the name attribute is *required* for map and param elements only. Other elements use the name attribute for various purposes - e.g. form controls need a name to be successful, applets use a name to communicate, and so on. The W3C HTML specification includes an index of attributes: <URL: http://www.w3.org/TR/html4/index/attributes.html> -- Fred --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs -~----------~----~----~----~------~----~------~--~---
Martin Bialasinski
2006-Nov-01 08:51 UTC
Re: I upgraded to 1.5.0 and my old code stopped working
On 11/1/06, Fred <ozfred-AFFH1GffN5hPR4JQBCEnsQ@public.gmane.org> wrote:> I didn''t say it did - please quote properly.I am just saying that if one wants to go by the specs (and one should), it should be done properly. Thous the elements collection. I had no intention to imply anything else.> > > When using forms, both $() and hence $F() have problems if id and name > > > attributes share the same value. > > > > Only in Internet Explorer and only there is more than one element > > involved in this "sharing", no? > > Yes. "More than one" in that one element has a name that is the same > as the id of some other element. "Sharing" implies (rather strongly) > more than one.<input name="bar" id="bar"> looks to me like "id and name attributes share the same value", so I had to ask. English is not my native language. Cool down, mate.> According to the W3C specification, the name attribute is *required* > for map and param elements only. > <URL: http://www.w3.org/TR/html4/index/attributes.html>The DTD seems to disagree. http://www.w3.org/TR/html401/sgml/dtd.html <!-- attribute name required for all but submit and reset --> <!ELEMENT INPUT - O EMPTY -- form control --> I believe you cannot model the implication of the comment in the DTD, so they did not make the field #REQUIRED. The attributes page might be auto-generated from the DTD. Bye, Martin --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs -~----------~----~----~----~------~----~------~--~---
Martin Bialasinski wrote:> On 11/1/06, Fred <ozfred-AFFH1GffN5hPR4JQBCEnsQ@public.gmane.org> wrote:[...]> > According to the W3C specification, the name attribute is *required* > > for map and param elements only. > > <URL: http://www.w3.org/TR/html4/index/attributes.html> > > The DTD seems to disagree. http://www.w3.org/TR/html401/sgml/dtd.html > > <!-- attribute name required for all but submit and reset -->I assume that since it is in the area for forms, it refers to the fact that input elements need a value for the name attribute if they are to be successful.> <!ELEMENT INPUT - O EMPTY -- form control --> > > I believe you cannot model the implication of the comment in the DTD, > so they did not make the field #REQUIRED.That argument can''t be sustained when the map element described as: <!ELEMENT MAP - - ((%block;) | AREA)+ -- client-side image map --> <!ATTLIST MAP %attrs; -- %coreattrs, %i18n, %events -- name CDATA #REQUIRED -- for reference by usemap -- > which clearly indicates that the name attribute is required and that the condition can be accommodated in the DTD.> The attributes page might be > auto-generated from the DTD.Maybe, but that doesn''t make it wrong - I cited it as a convenient summary. For many elements, the name attribute is #IMPLIED, which means that the browser must include it, but the HTML does not have to supply a value. Therefore: <input> is perfectly valid HTML, however when generating a document, the browser must include a name attribute, even if it has no value. -- Fred --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs -~----------~----~----~----~------~----~------~--~---