[Proto-Scripty] IE8 Invalid argument @ setStyle function
Hi, i have a problem when working with iGoogle style drag and drop portlets on ie8 my code runs with no problems on FF, Chrome, Safari and IE7 But on IE8 the widgets do not work when dropped and give the error Invalid argument.. i digged alot and knew that the problem is in the function setStyle [the else part] plz 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: JSON - which chars not accepted?
Hi, If I send a JSON { 'str': 'pThis is a line with \n linefeed/p' } I do get... You haven't mentioned what language you're using to write out the string (PHP, Python, JavaScript, C#, Java, etc.), but my suspicion is that you're accidentally outputting an actual newline (character x0A) rather than the valid JSON[1] syntax for it (\n), because in most languages, the backslash is an escape character and to actually output \n you'd have to type \\n. For instance (pure JavaScript example): var s; s = '{foo: This is a \n test.}'; alert(s.isJSON()); // alerts false, the string is not valid JSON s = '{foo: This is a \\n test.}'; alert(s.isJSON()); // alerts true, the string is valid JSON The JSON going to the browser (which you can probably inspect with Firebug or the MS Dev Toolbar or whatever you're using) must contain an actual backslash followed by the letter n, *not* a literal newline. [1] http://json.org HTH, -- T.J. Crowder Independent Software Consultant tj / crowder software / com www.crowdersoftware.com On Nov 10, 9:31 pm, Manfred Rebentisch mrebenti...@comparat.de wrote: I have a question to this prototype function: function isJSON() { var str = this; if (str.blank()) return false; str = this.replace(/\\./g, '@').replace(/[^\\\n\r]*/g, ''); return (/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(str); } If I send a JSON { 'str': 'pThis is a line with \n linefeed/p' } I do get an error. The same is, if the JSON is encoded to { 'str': 'pThis is a line with %0A linefeed/p' }. I need to delete the linefeed or I need to replace to 'br /'. I do not understand the regular expression above, because I want avoid to use other chars, which results in errors. Manfred --http://www.comparat.dehttp://www.athesios.dehttp://twitter.com/COMPARAT --~--~-~--~~~---~--~~ 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: handler is undefined prototype.js handler.call(element, event) create wrapper
On Nov 9, 8:55 pm, jaikumar jaikumar.arju...@gmail.com wrote: Hi , I am getting handler is undefined error in prototype.js Fire Bug pointing to this method in prototype.js handler.call(element, event) create wrapper. Can any one help me to solve this bug. Probably not, without more information. If you asked me to guess, I would guess that you are passing a non- existent function to 'observe'. If you asked me to guess further, I would guess that you might be writing a function call instead of a function, so: myelement.observe('click', myFunction); sets 'myFunction' as the click handler for myelement, but myelement.observe('click', myFunction()); //!!Almost always wrong!! calls myFunction and sets the result (which is almost certainly not a function) as the handler. But I may be in completely the wrong area, since you haven't told us anything about what you are doing. --~--~-~--~~~---~--~~ 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: JSON - which chars not accepted?
Hello I use C/C++ with Apache module I do send \\n or br / from server to the browser. But my question was: which chars need to be escaped too? I can see \r, \f and \t. But the other RegExp rule I do not understand. Manfred --~--~-~--~~~---~--~~ 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] Prototype 1.6.0.3, IE: Object doesn't support this property or method, typeof Element=unknown
I used prototype 1.5.0rc2 and the testing tool Selenium 1.0 in a web application. When I updated prototype to 1.6.0.3, everything still works in FF 3.5 and 3.0, but in IE I get strange error javascript messages: The code which fails is Element.extent in the function $(). The error message is Object doesn't support this property or method. When I try to inspect Element in the debugger, I get the same error as above. When I evaluate typeof Element, I get unknown (not undefined). All the other prototype object are defined however: Prototype, Ajax have all the type object. The interesting thing is, that Element was defined when the browser opens the page with the selenium command open. But after typing something in an entry field or any other action, Element is set to this strange non-object. Any suggestions? --~--~-~--~~~---~--~~ 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.0.3, IE: Object doesn't support this property or method, typeof Element=unknown
Just an addition: this error occurs happens in IE6. Everything works in IE7, IE8, FF3.0. FF3.5. --~--~-~--~~~---~--~~ 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] prototype 1.6.1, IE6: Object doesn't support this property or method, typeof Element=unknown
Hi, I used prototype 1.5.0rc2 and the testing tool Selenium 1.0 in a web application. When I updated prototype to 1.6.1, everything still works in FF 3.0, FF 3.5, IE7, IE8, but in IE6 I get strange javascript error messages: The code which fails is Element.extent in the function $(). The error message is Object doesn't support this property or method. When I try to inspect Element in the debugger, I get the same error as above. When I evaluate typeof Element, I get unknown (not undefined). All the other prototype object are defined however: Prototype, Ajax have all the type object or function. The interesting thing is, that Element was defined when the browser opens the page with the selenium command open. But after typing something in an entry field or any other action, Element is set to this strange non-object. Any suggestions? Regards Carsten --~--~-~--~~~---~--~~ 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: Does $A('.classname').invoke('setValue',...) work on checkboxes?
i agree on that. setValue has its purpose pretty much in the name. Set the value of a control. For checkboxes, setChecked (bool) (also applying to radios?) would have made a lot more sense. i suppose in the meantime there's Element.writeAttribute ({value:foo}); However, i raise caution on that because i've had inconsistent results in the past where the DOM recognizes the attribute as changed, but the browser did not update the visual display of the value (text inputs at the time), and submitted the original value. It was as though the input tag's value attribute and the control's value property were different entities. The only way i found to address it was $ ('element').value = foo; which obviously kills the elegance of chaining methods, but seems to address both entities, and is how Form.Element.Serializers returns other values. -joe t. On Nov 10, 12:30 pm, Szymon Wilkołazki wilkola...@gmail.com wrote: Hi, I found where is the problem. I assumed, that the Form.Element.setValue method sets the value of an element. In case of checkboxes that is not true. The method changes the state of checked/unchecked instead, and leaves the value attribute unchanged. The example might be found here: http://tsalarioth.art.pl/~sw/setValueTest.html As you can see, if you click on the button set value of checkbox to: with empty input, the checkbox is unchecked. If the value is not empty, then checkbox will be checked. I do not understand why this behaviour was chosen, but I understand that it can't be changed now, as it would break backward compatibility. Anyway I think the setValue method needs better documentation, as it is now a little bit misleading. I will open a lighthouse DOC ticket for this. Best regards, SWilk --~--~-~--~~~---~--~~ 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: JSON - which chars not accepted?
Hi ok, please read, what I mean. My code actually runs perfectly. In the past I have had problems with the newline and found, that isJSON() checks the string coming from server. Thats fine. I only want, that I did not run into new problems later, and want to understand, what isJSON() does. So I do not understand the regular expression until now: str = this.replace(/\\./g, '@').replace(/[^\\\n\r]*/g, ''); return (/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(str); I there a documentation to this function? I would like to read something like this: isJSON does not accept \n chars and @ chars in a string. It is for security and that is fine. But it is not fine, if my customer find a problem later. Thank you in advance Manfred --~--~-~--~~~---~--~~ 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] formatting list item content in Ajax.Autocompleter
One of the reasons I like the Google Suggest powered autocomplete function at Google Finance (http://finance.google.com) is because the drop choice choices appear in a tabular format with 2 columns. The left column contains the ticker symbol and the right column contains the company name. I am trying to emulate a similar effect but with 4 columns. Without thinking about customization, my first attempt involves trying to return data that looks like this from the server side ul lispan style=width:50px;1/spanspan style=width: 150px;Jane/spanspan style=width:150px;Doe/spanspan style=width:250px;Director/span/li lispan style=width:50px;2/spanspan style=width: 150px;John/spanspan style=width:150px;Doe/spanspan style=width:250px;Manager/span/li lispan style=width:50px;3/spanspan style=width: 150px;Peter/spanspan style=width:150px;Trent/spanspan style=width:250px;Developer/span/li /ul In a regular HTML page, this has a tabular look to it. But when this content gets loaded in the autocompleter's DIV element, it gets treated just like HTML whitespace. Am I missing something here, or are there better ways of doing this? Thanks! Ashwin --~--~-~--~~~---~--~~ 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: formatting list item content in Ajax.Autocompleter
Hi Ashwin, How about floating the span elements? I have similar list and I use float. Add a class to your span elements. In CSS, assign a width and float them left or right as per your requirement. HTH. Yogesh Ashwin wrote: One of the reasons I like the Google Suggest powered autocomplete function at Google Finance (http://finance.google.com) is because the drop choice choices appear in a tabular format with 2 columns. The left column contains the ticker symbol and the right column contains the company name. I am trying to emulate a similar effect but with 4 columns. Without thinking about customization, my first attempt involves trying to return data that looks like this from the server side ul lispan style=width:50px;1/spanspan style=width: 150px;Jane/spanspan style=width:150px;Doe/spanspan style=width:250px;Director/span/li lispan style=width:50px;2/spanspan style=width: 150px;John/spanspan style=width:150px;Doe/spanspan style=width:250px;Manager/span/li lispan style=width:50px;3/spanspan style=width: 150px;Peter/spanspan style=width:150px;Trent/spanspan style=width:250px;Developer/span/li /ul In a regular HTML page, this has a tabular look to it. But when this content gets loaded in the autocompleter's DIV element, it gets treated just like HTML whitespace. Am I missing something here, or are there better ways of doing this? Thanks! Ashwin --~--~-~--~~~---~--~~ 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: formatting list item content in Ajax.Autocompleter
Hi Yogesh, You gave me some food for thought! I added float:left; and width: 300px; attributes to all the span tags just to see how that turns out. When I do that, the span elements are outside the enclosing li elements, one below the other. I am no CSS expert, so I could be messing up somehow in that area. Can you send me a relevant snippet of the CSS that you employ for this effect? Thanks, Ashwin On Nov 11, 12:59 pm, Yogesh Agashe yogesh.aga...@gmail.com wrote: Hi Ashwin, How about floating the span elements? I have similar list and I use float. Add a class to your span elements. In CSS, assign a width and float them left or right as per your requirement. HTH. Yogesh Ashwin wrote: One of the reasons I like the Google Suggest powered autocomplete function at Google Finance (http://finance.google.com) is because the drop choice choices appear in a tabular format with 2 columns. The left column contains the ticker symbol and the right column contains the company name. I am trying to emulate a similar effect but with 4 columns. Without thinking about customization, my first attempt involves trying to return data that looks like this from the server side ul lispan style=width:50px;1/spanspan style=width: 150px;Jane/spanspan style=width:150px;Doe/spanspan style=width:250px;Director/span/li lispan style=width:50px;2/spanspan style=width: 150px;John/spanspan style=width:150px;Doe/spanspan style=width:250px;Manager/span/li lispan style=width:50px;3/spanspan style=width: 150px;Peter/spanspan style=width:150px;Trent/spanspan style=width:250px;Developer/span/li /ul In a regular HTML page, this has a tabular look to it. But when this content gets loaded in the autocompleter's DIV element, it gets treated just like HTML whitespace. Am I missing something here, or are there better ways of doing this? Thanks! Ashwin- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ 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: formatting list item content in Ajax.Autocompleter
I have a list with 3 columns. This is the code. You just modify it a little bit for your page. li Name span class='citystateinlist'City,State/span span class='dateinlist'Date/span /li .dateinlist{ float: right; width: 80px; } .citystateinlist{ float: right; width: 150px; } Ashwin wrote: Hi Yogesh, You gave me some food for thought! I added float:left; and width: 300px; attributes to all the span tags just to see how that turns out. When I do that, the span elements are outside the enclosing li elements, one below the other. I am no CSS expert, so I could be messing up somehow in that area. Can you send me a relevant snippet of the CSS that you employ for this effect? Thanks, Ashwin On Nov 11, 12:59pm, Yogesh Agashe yogesh.aga...@gmail.com wrote: Hi Ashwin, How about floating the span elements? I have similar list and I use float. Add a class to your span elements. In CSS, assign a width and float them left or right as per your requirement. HTH. Yogesh Ashwin wrote: One of the reasons I like the Google Suggest powered autocomplete function at Google Finance (http://finance.google.com) is because the drop choice choices appear in a tabular format with 2 columns. The left column contains the ticker symbol and the right column contains the company name. I am trying to emulate a similar effect but with 4 columns. Without thinking about customization, my first attempt involves trying to return data that looks like this from the server side ul lispan style="width:50px;"1/spanspan style="width: 150px;"Jane/spanspan style="width:150px;"Doe/spanspan style="width:250px;"Director/span/li lispan style="width:50px;"2/spanspan style="width: 150px;"John/spanspan style="width:150px;"Doe/spanspan style="width:250px;"Manager/span/li lispan style="width:50px;"3/spanspan style="width: 150px;"Peter/spanspan style="width:150px;"Trent/spanspan style="width:250px;"Developer/span/li /ul In a regular HTML page, this has a tabular look to it. But when this content gets loaded in the autocompleter's DIV element, it gets treated just like HTML whitespace. Am I missing something here, or are there better ways of doing this? Thanks! Ashwin- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ 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: formatting list item content in Ajax.Autocompleter
In addition to your snippet, I had to add the following CSS attributes to the LI element: position: relative; overflow: auto; and slightly increased the width of the container UL element. It is now showing up as expected. Thanks for your help! Ashwin On Nov 11, 2:15 pm, Yogesh Agashe yogesh.aga...@gmail.com wrote: I have a list with 3 columns. This is the code. You just modify it a little bit for your page. li Name span class='citystateinlist'City,State/span span class='dateinlist'Date/span /li .dateinlist{ float: right; width: 80px; } .citystateinlist{ float: right; width: 150px; } Ashwin wrote:Hi Yogesh, You gave me some food for thought! I added float:left; and width: 300px; attributes to all the span tags just to see how that turns out. When I do that, the span elements are outside the enclosing li elements, one below the other. I am no CSS expert, so I could be messing up somehow in that area. Can you send me a relevant snippet of the CSS that you employ for this effect? Thanks, Ashwin On Nov 11, 12:59 pm, Yogesh Agasheyogesh.aga...@gmail.comwrote:Hi Ashwin, How about floating the span elements? I have similar list and I use float. Add a class to your span elements. In CSS, assign a width and float them left or right as per your requirement. HTH. Yogesh Ashwin wrote:One of the reasons I like the Google Suggest powered autocomplete function at Google Finance (http://finance.google.com) is because the drop choice choices appear in a tabular format with 2 columns. The left column contains the ticker symbol and the right column contains the company name. I am trying to emulate a similar effect but with 4 columns. Without thinking about customization, my first attempt involves trying to return data that looks like this from the server sideul lispan style=width:50px;1/spanspan style=width: 150px;Jane/spanspan style=width:150px;Doe/spanspan style=width:250px;Director/span/li lispan style=width:50px;2/spanspan style=width: 150px;John/spanspan style=width:150px;Doe/spanspan style=width:250px;Manager/span/li lispan style=width:50px;3/spanspan style=width: 150px;Peter/spanspan style=width:150px;Trent/spanspan style=width:250px;Developer/span/li /ulIn a regular HTML page, this has a tabular look to it. But when this content gets loaded in the autocompleter's DIV element, it gets treated just like HTML whitespace.Am I missing something here, or are there better ways of doing this?Thanks!Ashwin- Hide quoted text -- Show quoted text - --~--~-~--~~~---~--~~ 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: formatting list item content in Ajax.Autocompleter
Sure, glad that I was able to help you ! Yogesh Ashwin wrote: In addition to your snippet, I had to add the following CSS attributes to the LI element: position: relative; overflow: auto; and slightly increased the width of the container UL element. It is now showing up as expected. Thanks for your help! Ashwin On Nov 11, 2:15pm, Yogesh Agashe yogesh.aga...@gmail.com wrote: I have a list with 3 columns. This is the code. You just modify it a little bit for your page. li Name span class='citystateinlist'City,State/span span class='dateinlist'Date/span /li .dateinlist{ float: right; width: 80px; } .citystateinlist{ float: right; width: 150px; } Ashwin wrote:Hi Yogesh, You gave me some food for thought! I added float:left; and width: 300px; attributes to all the span tags just to see how that turns out. When I do that, the span elements are outside the enclosing li elements, one below the other. I am no CSS expert, so I could be messing up somehow in that area. Can you send me a relevant snippet of the CSS that you employ for this effect? Thanks, Ashwin On Nov 11, 12:59pm, Yogesh Agasheyogesh.aga...@gmail.comwrote:Hi Ashwin, How about floating the span elements? I have similar list and I use float. Add a class to your span elements. In CSS, assign a width and float them left or right as per your requirement. HTH. Yogesh Ashwin wrote:One of the reasons I like the Google Suggest powered autocomplete function at Google Finance (http://finance. google.com) is because the drop choice choices appear in a tabular format with 2 columns. The left column contains the ticker symbol and the right column contains the company name. I am trying to emulate a similar effect but with 4 columns. Without thinking about customization, my first attempt involves trying to return data that looks like this from the server sideul lispan style="width:50px;"1/spanspan style="width: 150px;"Jane/spanspan style="width:150px;"Doe/spanspan style="width:250px;"Director/span/li lispan style="width:50px;"2/spanspan style="width: 150px;"John/spanspan style="width:150px;"Doe/spanspan style="width:250px;"Manager/span/li lispan style="width:50px;"3/spanspan style="width: 150px;"Peter/spanspan style="width:150px;"Tr ent/spanspan style="width:250px;"Developer/span/li /ulIn a regular HTML page, this has a tabular look to it. But when this content gets loaded in the autocompleter's DIV element, it gets treated just like HTML whitespace.Am I missing something here, or are there better ways of doing this?Thanks!Ashwin- Hide quoted text -- Show quoted text - --~--~-~--~~~---~--~~ 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] String#smush helper
Just thought I'd share this for anyone who's interested... http://www.google.com/search?source=ighl=enrlz=q=a+really+long+urlaq=foq=aqi=g10 .smush() http://www.googlerlaq=foq=aqi=g10; --- Object.extend(String.prototype, (function() { function smush(length, truncation) { length = length || 40; truncation = Object.isUndefined(truncation) ? '...' : truncation; var chunkLength = (length - truncation.length) / 2; return this.length length ? this.slice(0, Math.floor(chunkLength)) + truncation + this.slice(this.length - Math.ceil(chunkLength)) : String(this); } return { smush: smush } })()); --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---