[Proto-Scripty] Re: Generating invalid HTML for purpose of custom attributes

2011-03-28 Thread RobG
On Mar 27, 11:43 am, Walter Lee Davis wa...@wdstudio.com wrote: On Mar 26, 2011, at 9:37 PM, kstubs wrote: Is it bad, or does it make parsing objects unstable if you append custom attributes to an HTML tag? Lets say I want to keep track of a number, maybe a customers ID, so I do

[Proto-Scripty] Re: Sort Children of a DIV without using Element#remove

2011-02-23 Thread RobG
On Feb 24, 2:21 am, Walter Lee Davis wa...@wdstudio.com wrote: I believe this is a requirement -- that I not use remove -- because   the elements I'm trying to move around all have form element observers   attached directly to their children, and I am pretty sure this will   mess me up.

[Proto-Scripty] Re: Next dumb question

2011-02-17 Thread RobG
On Feb 18, 10:28 am, Jeffrey Lee jlee...@gmail.com wrote: So why is it that when Javascript is updating the document, does the source not show the change?  Does show-source merely reflect that which was loaded, but not the actual current document?  Why is that? View source shows the

[Proto-Scripty] Re: local variables for for() array iteration

2011-01-20 Thread RobG
On Jan 20, 4:50 pm, Ran Berenfeld berenfeld...@gmail.com wrote: Thank you for the advise. one more / last question to clarify. In one of the articles about javascript scopes I read that using var inside a class constructor actually creates a private member of the class. is it true ? No.

[Proto-Scripty] Re: local variables for for() array iteration

2011-01-19 Thread RobG
On Jan 19, 11:31 pm, Ran Berenfeld berenfeld...@gmail.com wrote: Hello all sorry for this stupid question, but all these talks about the *this pointer and the variable scope in js got me confused. A function's this keyword has nothing to do with scope. support I have 2 functions, one

[Proto-Scripty] Re: finding absolute position of an element / IE7 browser detect?

2010-12-16 Thread RobG
On Dec 16, 12:36 am, doug douglass_da...@earthlink.net wrote: [...] Any ideas on how I can do this without an IE7 browser detect? Let me know if this works in IE 7: URL: http://www.cinsoft.net/position.html -- Rob -- You received this message because you are subscribed to the Google

[Proto-Scripty] Re: Traverse table cells

2010-12-14 Thread RobG
On Dec 3, 6:16 am, KenB kenber...@gmail.com wrote: I am new to prototype and need to learn how to traverse an html table and hide some columns. The only id I have is table id or the class it is associated with. Can anyone give me an example? Here is what I am trying to accomplish.  var

Re: Risky delay (was: Re: [Proto-Scripty] Re: Prototype / IE6 issue (bug?))

2010-11-18 Thread RobG
On Nov 18, 8:06 pm, T.J. Crowder t...@crowdersoftware.com wrote: On Nov 17, 2:07 pm, Phil Petree phil.pet...@gmail.com wrote: Hi, In the case of ie6, with less than 5% of all page views (and rapidly declining), it is now a footnote so why support it at all? The OP's issue has nothing to

[Proto-Scripty] Re: Deleting a class object releasing the memory.

2010-10-26 Thread RobG
On Oct 25, 9:40 pm, Paco Gómez pacogomezgrana...@gmail.com wrote: Hi TJ, I'm Jose's partner. The thing I don't understand is why we can recover memory after creating any other kind of object, but not with DOM elements. I don't see the issue in either Firefox or IE 6. [...] Do you have

[Proto-Scripty] Re: Object extend magic

2010-09-01 Thread RobG
On Sep 1, 6:54 pm, Richard Quadling rquadl...@gmail.com wrote: On 31 August 2010 20:16, kstubs kst...@gmail.com wrote: I notice that if I intend to add class to an element that I must use className and not class for my object.  But what if I intend to name my element?  What do you use

[Proto-Scripty] Re: Prevent enter from submitting form

2010-09-01 Thread RobG
On Aug 31, 10:44 pm, jhaagmans jaap.haagm...@gmail.com wrote: You obviously didn't read the entire post, as the expected behaviour for an enter press is to submit the form that is currently visible and not the one that is hidden. That's what I'm trying to accomplish. I in fact figured out

[Proto-Scripty] Re: Touch screen / mouse gesturing.

2010-08-11 Thread RobG
On Jul 29, 9:41 pm, Richard Quadling rquadl...@gmail.com wrote: Hi. I'm developing a tiny little web page app which allows vehicle inspectors to see the work last carried out on a vehicle. [...] For the touch screen systems, I'd like to be able to implement some touch screen support. [...]

[Proto-Scripty] Re: Problem with prototype and arrays.

2010-08-02 Thread RobG
On Aug 2, 3:43 pm, T.J. Crowder t...@crowdersoftware.com wrote: Hi, I found that array looping method online, I guess I will remove that page from my bookmarks. Yes, it's an extremely common misconception. What, that for..in iterates over an object's properties? It's per ECMA-262. There

[Proto-Scripty] Re: Problem with prototype and arrays.

2010-08-02 Thread RobG
On Aug 3, 2:19 am, T.J. Crowder t...@crowdersoftware.com wrote: Hi, Yes, it's an extremely common misconception. What, that for..in iterates over an object's properties? No, that it loops over array indexes. I'm missing something here. Array indexes are properties, which is why they

[Proto-Scripty] Re: enumerate hash

2010-04-11 Thread RobG
On Apr 10, 8:36 pm, chrysanthe m chrysant...@gmail.com wrote: Hi, again Sorry for being obtuse.  But can someone help me and even understand how to write a function and call it on a hash that will take a value, compare it against each of the keys in the hash, on match delete the key/value,

[Proto-Scripty] Re: How would you check if a function is defined using prototype

2010-02-08 Thread RobG
On Feb 5, 5:31 pm, T.J. Crowder t...@crowdersoftware.com wrote: Hi, If the function is expected as a property of some object (including `window`), then I'd probably do this:     if (typeof obj.functionName == 'function') So for instance:     if (typeof window.globalEval == 'function')

[Proto-Scripty] Re: instantiate class problem on IE

2009-12-23 Thread RobG
On Dec 23, 4:17 am, david david.brill...@gmail.com wrote: Hi Loris, I think that your trouble is normal, because IE don't allow to instantiate method on native object. You might need to re-think that statement. From ECMA-262: Native Object A native object is any object supplied by an

[Proto-Scripty] Re: IE Add Observers in Reverse Order?

2009-09-29 Thread RobG
On Sep 29, 8:45 am, KammylandSoftware kammyl...@gmail.com wrote: When ever you add oberservers to the same event such as Event.oberve(myElement, mousedown, someMethod_1()); Event.oberve(myElement, mousedown, someMethod_2()); does IE execute them in REVERSE order upon fire? They get

[Proto-Scripty] Re: weird behavior w/ prototype firefox

2009-09-29 Thread RobG
On Sep 29, 2:54 am, mhgrove mhgr...@gmail.com wrote: I want to have the button call a function which first schedules a call to show the busy spinner after say like 5 seconds.  This way if the call to the server is fast, there's no blip on screen of the spinner just before the page

[Proto-Scripty] Re: onChange event when div content changed

2009-09-03 Thread RobG
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

[Proto-Scripty] Re: array.indexOf fails sometimes in IE8

2009-09-02 Thread RobG
On Sep 3, 1:56 am, enigment enigm...@gmail.com wrote: Hmmm, even outside the indexOf() question, this is a bit creepy to me. I hadn't previously tested, but these are all true, at least in Firefox 3.5 and IE8: [...]         new String(mpg) !== new String(mpg)         new String(mpg) != new

[Proto-Scripty] Re: Automatically Converting HTML to DOM (e.g. new Element ...)

2009-08-18 Thread RobG
On Aug 19, 5:30 am, drewB dbats...@gmail.com wrote: As I see it the advantages of doing it client-side are: - The server can handle more users because less work is done there Unlikely. There is very little difference in computation effort between generating JSON, XML, HTML or delimited text

[Proto-Scripty] Re: I can't work with xml files in prototype

2009-06-23 Thread RobG
On Jun 23, 5:29 am, dy3g0s dy3...@gmail.com wrote: Hi, I actually work with Slideshare API, php and prototype. I make a cURL call in php to consume a certain Slideshare API method, the php script return an xml result with the header header('Content-type: text/ xml'); I obtain a xml

[Proto-Scripty] Re: Bizzarre goings on

2009-06-09 Thread RobG
On Jun 10, 7:09 am, david david.brill...@gmail.com wrote: Hi Alex, If the code WAS working, the error could be on the received JSON  ? One though, IE don't like misplaced comma on JSON. For exemple, last element of an array that is followed by a comma don't work on IE. What do don't like

[Proto-Scripty] Re: Last table row

2009-06-06 Thread RobG
On Jun 5, 8:15 pm, Jeztah webmas...@thecarmarketplace.com wrote: Morning... Very silly and easy question but my brain isn't working today How can i get the last row of a table (table id=foo) ... Tables have a rows collection that includes all rows in the table. Try: var rows =

[Proto-Scripty] Re: Cant get focus to work with change event when tabbing out of input

2009-06-01 Thread RobG
On Jun 2, 5:32 am, molo maurice_lowent...@ssga.com wrote: I could use some help. I've been looking at this all day and cannot come up with a solution I am using the same routine on these 5 input fields. If I type in a character on one of these fields and press enter, it works as expected

[Proto-Scripty] Re: Adding properties to native objects

2009-05-21 Thread RobG
On May 21, 11:11 pm, T.J. Crowder t...@crowdersoftware.com wrote: Hi Joe, T.J.'s factory suggestion... FWIW, I think it was Doug's suggestion, I just updated it a bit. function DateFactory(){   var fName, that = new Date();   for (fName in SpecialDateProps)     that[fName] =

[Proto-Scripty] Re: How can I get a list of events fired by an object?

2009-05-21 Thread RobG
On May 22, 12:11 am, Walter Lee Davis wa...@wdstudio.com wrote: I'd like to see what events are there for the observing, particularly   on an iframe. The iframe element doesn't support any events[1]. The document that it contains may support various events (such as load, click, etc.). Is

[Proto-Scripty] Re: Adding properties to native objects

2009-05-19 Thread RobG
On May 19, 9:26 pm, ColinFine colin.f...@pace.com wrote: This is a case when you really truly want just the facilities that Javascript provides (prototypes rather than classes), and using (pretend) classes makes it harder not easier. Yes, although some may argue that it is better to create

[Proto-Scripty] Re: Changing href in onclick function

2009-05-19 Thread RobG
On May 15, 6:54 pm, marioosh marioosh@gmail.com wrote: I have a id=ph href=#. I want to do that (sorry for my poor english): When user click ph, i need to set href to some usable address (by sending request Ajax.Request) and fire onclick once again. That seems unnecessarily complex, why

[Proto-Scripty] Re: DOM building methods

2009-05-13 Thread RobG
On May 13, 6:12 pm, keemor kee...@gmail.com wrote: Hi, I'd like to present 3 ways of building ul list and compare the speed of them. I used firebug's profiler on FF3 html: body         a href=# id=gogo/a         ul id=list/ul /body $('go').observe('click',go); [...] Third: Time

[Proto-Scripty] Re: Classes vs Objects - Best Practice?

2009-05-11 Thread RobG
On May 12, 1:20 pm, RobG rg...@iinet.net.au wrote: [...] Javascript can emulate many object models, not just classic OO or class-based iheritance. That should have been: many *inheritance* models -- Rob --~--~-~--~~~---~--~~ You received this message

[Proto-Scripty] Re: Extracting methods from codebase

2009-05-03 Thread RobG
On May 1, 1:42 am, Bertrand bertrand.char...@gmail.com wrote: Well, actually, my managers are pushing for self-contained javascript code (trying to get rid of all the library calls, which isn't necessarily a good idea, but I have to abide). So I ended up using a DOM-compliant version using

[Proto-Scripty] Re: convert string to a number

2009-04-26 Thread RobG
On Apr 25, 3:37 pm, Ananth Raghuraman araghuram...@gmail.com wrote: Thanks for pointing me to the native functions! In the meantime I also found 1.8 has the Number object/function. The Number constructor is a built-in ECMAScript function. When called as a function, it does type conversion:

[Proto-Scripty] Re: convert string to a number

2009-04-24 Thread RobG
On Apr 25, 2:06 am, Ananth Raghuraman araghuram...@gmail.com wrote: Need prototype function to convert object/string/number to number. Please help. Without a more concise specification for what the object/string/number might be, you will end up with a large function that works for a few

[Proto-Scripty] Re: Event Observers and Question on Copying Form Values Using Prototype

2009-04-23 Thread RobG
On Apr 24, 4:05 am, katz bridgeuto...@gmail.com wrote: Greetings. I need to learn how to achieve to dynamically copy form field values using Prototype or possibly Ruby. I want to achieve something like this:http://websitebuildersresource.com/2009/02/05/copy-form-input-data-to...

[Proto-Scripty] Re: Observe div content change?

2009-04-22 Thread RobG
On Apr 22, 9:02 pm, Yozefff yoze...@gmail.com wrote: Is it possible to observe when the content of a DIV is changed? The W3C DOM 2 Events specification has an Interface MutationEvent for that purpose (and others). Support may vary across browsers: URL:

[Proto-Scripty] Re: Namespace Function

2009-04-21 Thread RobG
On Apr 22, 9:57 am, disccomp discc...@gmail.com wrote: Here's the working code:http://pastie.org/454045 OK, here it is: | $N = function(ns){ *Always* declare variables. I can't see why you don't use: function $N(ns) { or, because I dislike the use of $ in variable names: function

[Proto-Scripty] Re: Recommended and Disrecommended DOM Methods

2009-04-19 Thread RobG
On Apr 18, 4:46 am, Doug Reeder reeder...@gmail.com wrote: Is there a list of which DOM properties and methods are useful when using Prototype, and which are unnecessary, given the availability of Prototype methods? It is not so much what is necessary or not, but what might be an appropriate

[Proto-Scripty] Re: Client-side File Processing

2009-04-14 Thread RobG
On Apr 14, 3:11 pm, Doug Reeder reeder...@gmail.com wrote: I'd like to allow the user to select a file from his/her filesystem,   and process it locally.  Due to heightened security (or at least the   semblance thereof) the value of a file input element is just the name   of the file, not

[Proto-Scripty] Re: show hidden div if js is disabled

2009-04-10 Thread RobG
On Apr 10, 11:09 am, swdean magic...@gmail.com wrote: I am quite new to coding and I am trying to show div in case js is disabled the reason is because I set it to display: none Don't do that, consider the noscript element. URL http://www.w3.org/TR/html4/interact/scripts.html#edef-NOSCRIPT

[Proto-Scripty] Re: examine whether methode is already used

2009-04-02 Thread RobG
On Apr 2, 5:57 pm, basti bastian.friedr...@am-soft.de wrote: Good morning, I wanted to use the method getElementsByClassName by prototype to retrieve an array of objects. Using my Firefox 3.0.7 on Windows XP alert told me that the returned value by this method is a Nodelist, which I

[Proto-Scripty] Re: Select form elements by name

2009-04-01 Thread RobG
On Apr 2, 4:43 am, Diodeus diod...@gmail.com wrote: What's the Prototype equivalent of this jQuery code? I would like to select all of the radio button with a certain name. $('#billship input:radio[name=shipType]'); All of the following will return a live NodeList:

[Proto-Scripty] Re: observe any change in the window

2009-03-30 Thread RobG
On Mar 30, 9:36 pm, Walter Lee Davis wa...@wdstudio.com wrote: Take a look at Form.Observer I think you meant to reply to the OP. -- it's ideal for this sort of thing. I don't think it is. It   watches the form in a tight loop (at your specified interval) and if   there are any changes

[Proto-Scripty] Re: event.element vs. $('element_id')

2009-03-27 Thread RobG
On Mar 27, 9:35 am, Hector Virgen djvir...@gmail.com wrote: [...] As for speed, I would imagine that event.element() is faster than $('object_id') because even.element() is just accessing a property, instead of searching the dom for a node. But I could be wrong on this :) Logic would say

[Proto-Scripty] Re: event.element vs. $('element_id')

2009-03-27 Thread RobG
On Mar 27, 10:02 pm, Lapis petter.env...@gmail.com wrote: I do like this sometimes, when the scoping is ok: var submitter = $('submitter'); if (submitter) {   submitter.observe('click', function (event) {     // use submitter here   }); }; It is great, time-wise. And exploits IE's

[Proto-Scripty] Re: HTML Entity Handling with setValue

2009-03-18 Thread RobG
On Mar 18, 12:00 pm, Tobie Langel tobie.lan...@gmail.com wrote: OK, so to summarize: 1) TextArea have a value property (as per DOM 2 specs), 2) Prototype Element#setValue uses the value property (not the HTML value attribute), 3) Proper, standard compliant way of doing what OP wants:    

[Proto-Scripty] Re: HTML Entity Handling with setValue

2009-03-18 Thread RobG
On Mar 18, 11:26 pm, Walter Lee Davis wa...@wdstudio.com wrote: I'm so confused... About what? -- Rob --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group,

[Proto-Scripty] Re: HTML Entity Handling with setValue

2009-03-17 Thread RobG
On Mar 17, 11:02 am, ViniH vinihol...@googlemail.com wrote: I have a textarea on a page which contains notes as text. Html encoded entities are encoded correctly for display in order to pass XHTML 1.0 strict validation (which is a company requirement). I would like to see the reasons why,

[Proto-Scripty] Re: HTML Entity Handling with setValue

2009-03-17 Thread RobG
On Mar 18, 1:41 am, Walter Lee Davis wa...@wdstudio.com wrote: Would $('myTextArea').update('new string') be of any use, then? If the   underlying mechanism of update() is to set the innerHTML property,   wouldn't this be a nice shortcut? It isn't much of a shortcut to call a function that

[Proto-Scripty] Re: HTML Entity Handling with setValue

2009-03-17 Thread RobG
On Mar 18, 2:24 am, Tobie Langel tobie.lan...@gmail.com wrote: As previously discussed here, setAttribute sets the HTML attribute, which does not update the displayed value in some browsers. ViniH is correctly using Element#setValue, Yes, I misread that as setAttribute. which abstracts

[Proto-Scripty] Re: HTML Entity Handling with setValue

2009-03-17 Thread RobG
On Mar 18, 11:02 am, Walter Lee Davis wa...@wdstudio.com wrote: Not to belabor the point, but as Tobie pointed out already, textarea   elements don't **have** a value property to manipulate. You've got your wires crossed - if you'd quoted what you were replying to, you'd see that it was me

[Proto-Scripty] Re: help with basic regular expression

2009-03-16 Thread RobG
On Mar 17, 4:10 am, kangax kan...@gmail.com wrote: On Mar 16, 1:13 pm, arkady arkad...@gmail.com wrote: if trying to strip off the everything before the body and everything after /body response.replace(/.*(?=body)/, '').replace(/(\/body).*/, '$1'); That seems a bit risky, the string

[Proto-Scripty] Re: writeAttribute problem

2009-03-07 Thread RobG
On Mar 7, 4:29 am, Tobie Langel tobie.lan...@gmail.com wrote: Hi again, Rob. I don't really want to argue over the benefits of attributes versus expandos, just wanted to outline that they weren't the same thing although the specs mandate a mapping of specified expandos to their attribute

[Proto-Scripty] Re: writeAttribute problem

2009-03-07 Thread RobG
On Mar 7, 12:53 pm, kangax kan...@gmail.com wrote: On Mar 6, 7:07 am, RobG rg...@iinet.net.au wrote: [...] The differences are in the browsers' implementation of setAttribute, For example, using setAttribute with any of the intrinsic event handlers. Setting intrinsic event handlers

[Proto-Scripty] Re: writeAttribute problem

2009-03-06 Thread RobG
On Mar 6, 8:16 pm, Tobie Langel tobie.lan...@gmail.com wrote: writeAttribute does not fix cross browser differences in the implementation of setAttribute. How so? What's missing? File bugs! :) The differences are in the browsers' implementation of setAttribute, For example, using

[Proto-Scripty] Re: writeAttribute problem

2009-03-05 Thread RobG
On Mar 5, 6:53 pm, Tobie Langel tobie.lan...@gmail.com wrote: Rob, Please have a look at the DOM specs. I have, the issue is how it's implemented. When the specs are written without ambiguity and all browsers follow them, it might be reasonable to use them as the sole criterion for doing

[Proto-Scripty] Re: Decimal places

2009-03-05 Thread RobG
On Mar 5, 7:50 am, Bob bro...@packagingcorp.com wrote: I'm relativley new to PrototypeJS. I  am doing some calculation in a back end program and returning a JSON string to my web page. One of the values is a price. If I return 14.20, it gets converted in evalJSON to 14.2. I want to keep

[Proto-Scripty] Re: writeAttribute problem

2009-03-04 Thread RobG
On Mar 5, 7:32 am, Lee Jenkins l...@datatrakpos.com wrote: Are there any known problems with writeAttribtue and FF3?  I have a small function: function(obj){      Element.writeAttribute(obj.elname, obj.attr, obj.newValue); } It doesn't update the attribute. How did you determine

[Proto-Scripty] Re: Creating Checked Radio buttons, not working in IE

2009-03-04 Thread RobG
On Mar 4, 7:13 pm, Alex Mcauley webmas...@thecarmarketplace.com wrote: Yes walter is correct... As far as i know you cannot insert an element into another element if it does not exist in the DOM I guess that by insert you mean append (and that isn't what Walter said). (as the element is

[Proto-Scripty] Re: When?

2009-02-26 Thread RobG
On Feb 26, 7:28 am, Lox gecka.comp...@gmail.com wrote: [...] then prototype is becoming the mature and stable platform for standardised/cross platform javascript development. I understand that, and quite second that, but Peppy or Sizzle are much more faster at selecting elements by css

[Proto-Scripty] Re: Updating value of hidden form control

2009-02-23 Thread RobG
On Feb 24, 3:50 am, Hector Virgen djvir...@gmail.com wrote: Thanks for the clarification. I assumed that the attribute would be the same as the element property, but I see now how they can be different. To change the default value, use the defaultValue property: URL:

[Proto-Scripty] Re: Updating value of hidden form control

2009-02-23 Thread RobG
On Feb 24, 2:15 am, SWilk wilkola...@gmail.com wrote: Hector Virgen wrote: Hello, I am writing a plugin that takes a text input (input type=text/) and hides it using $(input).hide(). The plugin then uses other controls to update the value of the text input. I am using

[Proto-Scripty] Re: Updating value of hidden form control

2009-02-22 Thread RobG
On Feb 23, 1:00 pm, Hector Virgen djvir...@gmail.com wrote: Hello, I am writing a plugin that takes a text input (input type=text/) and hides it using $(input).hide(). The plugin then uses other controls to update the value of the text input. I am using Element.writeAttribute() to update

[Proto-Scripty] Re: Remove an element from the DOM and add it later exactly to the same point

2009-02-18 Thread RobG
On Feb 19, 3:55 pm, RobG rg...@iinet.net.au wrote: [...] *Do not* use Prototype.js's sibling array as it will remove text nodes, you certainly don't want to do that. Not worded quite right: Prototype.js doesn't include text nodes in its sibling arrays, but they should be used in this case so

[Proto-Scripty] Re: Firefox document.getElementById

2009-02-15 Thread RobG
On Feb 12, 1:03 am, T.J. Crowder t...@crowdersoftware.com wrote: Hi, Details here:http://prototypejs.org/learn/extensions The following statement in that article is wrong: ...native objects such as HTMLElement... HTMLElement is a *host* object, not a native object. -- Rob

[Proto-Scripty] Re: Taboo Subject

2009-02-12 Thread RobG
On Feb 10, 8:29 pm, Lars Schwarz lars.schw...@gmail.com wrote: well, it's like fixing IE6 bugs. i mostly double-code functions like form-checks that are done pre-posting in javascript, to be checked again on server side again for the case javascript is turned off. The reason to check on

[Proto-Scripty] Re: Javascript scope

2009-02-12 Thread RobG
On Feb 11, 11:21 am, doug douglass_da...@earthlink.net wrote: I have read about Javascript and scope and I still don't really understand it completely, particularly when it comes to Ajax.Updater. I don't really understand, for example why, if there is a variable window.myvar, some

[Proto-Scripty] Re: Prototype bug?

2009-02-10 Thread RobG
On Feb 10, 9:35 pm, Jim Higson j...@333.org wrote: On Feb 8, 1:19 pm, RobG rg...@iinet.net.au wrote: [...] It's a bit unfair to blame the language for what you consider an inappropriate use of one of its features.  Perhaps the name of the function should be isStringPrimitive. I guess I

[Proto-Scripty] Re: Prototype bug?

2009-02-08 Thread RobG
On Feb 8, 12:55 am, Jim Higson j...@333.org wrote: alert( Object.isString( foo )); // alerts string It alerts true. alert( Object.isString( new String( foo ) )); // alerts object It alerts false. I know why this happens - because Prototype uses the underlying typeof's understanding

[Proto-Scripty] Re: Prototype bug?

2009-02-08 Thread RobG
On Feb 8, 11:53 pm, kangax kan...@gmail.com wrote: On Feb 8, 8:19 am, RobG rg...@iinet.net.au wrote: [...] It can hardly be called a bug when it does what the documentation says it does (I think works as designed is the polite response). The function itself is a bit pointless though

[Proto-Scripty] Re: Prototype bug?

2009-02-08 Thread RobG
On Feb 9, 11:37 am, kangax kan...@gmail.com wrote: On Feb 8, 7:32 pm, RobG rg...@iinet.net.au wrote: On Feb 8, 11:53 pm, kangax kan...@gmail.com wrote: [...] It's not pointless, but the scope of its use is indeed pretty narrow. Can you provide a scenario where isNumber is more

[Proto-Scripty] Re: validation for alphanumeric field/sequence

2009-02-06 Thread RobG
On Feb 7, 12:21 am, kangax kan...@gmail.com wrote: On Feb 6, 7:36 am, ColinFine colin.f...@pace.com wrote: On Feb 5, 9:29 pm, Michael mich...@vermontsnows.com wrote: Thank you all - Kangax's low profile technique works like a champ. Walter Lee: Regular expressions hurt my head. I

[Proto-Scripty] Re: div inside select/select tags?

2009-02-04 Thread RobG
On Feb 4, 10:41 am, Richie M i...@linuxbox.co.uk wrote: Hi, I have a form with three drop down select boxes in it. I'd like the second box to populate when an option is selected in the first, and for the third to populate when an option is selected from the second. In the first select

[Proto-Scripty] Re: Cloning an HTML Element

2009-01-23 Thread RobG
On Jan 24, 6:57 am, da644 andrewjdi...@gmail.com wrote: Hi, I have an HTML object that has been creating using some scripting and I wish to insert this into to different locations on the page, e.g. var newObj = createMyObject(); $('location1').insert(newObj);

[Proto-Scripty] Re: reserved words for prototype and/or scriptaculous?

2009-01-16 Thread RobG
On Jan 17, 12:30 am, ColinFine colin.f...@pace.com wrote: [...] but if you want it to be more general, you can say getData(evt.element().up('form')) All form controls have a form property that is a reference to the form they are in, so why not: getData(evt.element().form)) -- Rob

[Proto-Scripty] Re: error in IE7 while trying to readAttribute from option

2009-01-05 Thread RobG
On Jan 6, 6:01 am, kidbrax braxton.be...@gmail.com wrote: when I try the following code I get an error in IE7: someVar = mySelect.options[mySelect.slectedIndex].readAttribute('rel') The rel attribute is not valid for option elements, it is valid for A and LINK elements. It causes the

[Proto-Scripty] Re: Custom attributes or not custom attributes ?

2009-01-04 Thread RobG
On Dec 31 2008, 12:05 am, buda www...@pochta.ru wrote: But to store metadata in objects - is doing overjob - elements might be added or deleted or changed their style or state - and syncronyze elmenets state with their object mappers - is very hard and useless It's not hard at all, and

[Proto-Scripty] Re: Custom attributes or not custom attributes ?

2008-12-30 Thread RobG
On Dec 29, 8:38 pm, buda www...@pochta.ru wrote: It is useful, but I don't think it's worth the trouble and I personally don't use it. IE's DOM is one example of what makes custom attributes troublesome - you never know which issues you will run into due to every custom attribute ending

[Proto-Scripty] Re: Improving FPS Speeds

2008-12-17 Thread RobG
On Dec 17, 8:52 pm, Craig cr...@europe.com wrote: site im developing is not live but similar tohttp://www.aspecto.co.uk/ Is there much use in creating a slider function to run all the sliders from would this make much of a difference? It might make the code tidier and get rid of some global

[Proto-Scripty] Re: Improving FPS Speeds

2008-12-16 Thread RobG
On Dec 17, 3:13 am, Craig cr...@europe.com wrote: I have a very graphics intense website with 4 sliders on each coded in a serperate JS file. Recently i have developed a full screen image viewer that behaves much like lightbox. I am using the effects library to BlindDown the image and

[Proto-Scripty] Re: select only text (i.e. textnodes, probably) using $$

2008-12-10 Thread RobG
On Dec 11, 3:25 am, lskatz [EMAIL PROTECTED] wrote: I finally got around to this, and it turns out that even though the approach is good, I cannot insert HTML tags.  I chose to not use recursion to make it simple.  The problem is that it uses each character literally and displays the

[Proto-Scripty] Re: IE eval() question...

2008-12-05 Thread RobG
On Dec 4, 11:17 am, yoshi [EMAIL PROTECTED] wrote: heres my js: var stuff7=eval('function() {alert(stuff..);}') when i alert stuff7 it is undefined. The code passed to eval is treated at a function declaration. Without a name, it is a syntax error. now if i do this: eval('var

[Proto-Scripty] Re: Simple question

2008-11-27 Thread RobG
On Nov 27, 11:32 pm, spradeepkumar [EMAIL PROTECTED] wrote: [...] If you are particular in using this...prototype has got bind methods with which you can control your scope The value of a function's this keyword has nothing to do with scope, it is set by the call. -- Rob

[Proto-Scripty] Re: Browser Support List?

2008-11-14 Thread RobG
On Nov 15, 6:18 am, Hector Virgen [EMAIL PROTECTED] wrote: Thanks, TJ. That's a really good point, but unfortunately many of our clients use old Macs with IE 5.5. I would still like to provide them with some basic Javascript UI enhancements. Does that mean I would have to write native

[Proto-Scripty] Re: Browser Support List?

2008-11-13 Thread RobG
On Nov 14, 9:54 am, Hector Virgen [EMAIL PROTECTED] wrote: Sorry if this has been asked before, but is there an updated list of browsers and versions supported by Prototype? URL:

[Proto-Scripty] Re: evalScripts problem

2008-11-13 Thread RobG
On Nov 14, 7:39 am, Ehsun [EMAIL PROTECTED] wrote: I've create an Object in my pages script tags, something like this: a = new A(); and when I want to call a method of a in the script which is actually the ajax content (evaluated with .evalScripts) everything is fine. but when the

[Proto-Scripty] Re: Action on innerHTML and bindAsEventListener doesn't work anymore

2008-11-06 Thread RobG
On Nov 7, 12:24 am, T.J. Crowder [EMAIL PROTECTED] wrote: Hi, Yes I know this possibility. I though about it, but I can not use it... and I don't think the bind problem will be fix in that way ;) I'm pretty sure it will.  Did you try it?  I did a trivial test, and it worked fine.  

[Proto-Scripty] Re: Building a lazy Loader

2008-11-06 Thread RobG
On Nov 7, 12:52 am, Alex Mcauley [EMAIL PROTECTED] wrote: i want it to be transparent hence the syncronous request Blocking the UI is hardly transparent. The lazy loading of scripts is a flawed strategy - it seems a good idea but if you think about the issues, you should realise that you'll

[Proto-Scripty] Re: Building a lazy Loader

2008-11-06 Thread RobG
On Nov 7, 5:45 am, Matt Foster [EMAIL PROTECTED] wrote: What are the drawbacks of requestings the JS file via Ajax.Request and stuffing the responseText inside the innerHTML property of a generated script element? It is not reliable across browsers, nor is assigning the source as a string

[Proto-Scripty] Re: Action on innerHTML and bindAsEventListener doesn't work anymore

2008-11-05 Thread RobG
On Nov 5, 2:58 am, jak0lantash [EMAIL PROTECTED] wrote: Hi everybody. I have some difficulties with bindAsEventListener. I'm working on a little module system (like in netvibes, but simpler). In the page, there are two div, kind of module, one on top, one on bottom. With a button, I

[Proto-Scripty] Re: Zebra Stripes

2008-10-29 Thread RobG
On Oct 30, 9:46 am, solidhex [EMAIL PROTECTED] wrote: I am trying to figure out a way to zebra stripe list items in an unordered list. The only tricky part is that I don't want to zebra stripe the nested lists, but I want to maintain the same every other stripping pattern on the nested

[Proto-Scripty] Re: how to load scripts dinamically

2008-10-16 Thread RobG
On Oct 17, 3:22 am, SWilk [EMAIL PROTECTED] wrote: Hey, T.J. wrote a How-To on the wiki based on todays thread: http://proto-scripty.wikidot.com/prototype:how-to-load-scripts-dynami... I just have one question regarding the how-to: quote Here's the dynamic.js file:

[Proto-Scripty] Re: writing unintrusive javascript with prototype

2008-10-15 Thread RobG
On Oct 14, 5:07 pm, T.J. Crowder [EMAIL PROTECTED] wrote: [...] One way to do this is to have the relevant fields tagged with a specific CSS class. An excellent response overall, but just for the record: the HTML class attribute is not targeted at CSS, it is for any purpose you wish to put

[Proto-Scripty] Re: textarea and linebreaks

2008-10-15 Thread RobG
On Oct 16, 4:42 am, buda [EMAIL PROTECTED] wrote: I'm sorry - maybe its not sutable forum but I dont take part in anyone except this one I have a textarea with wrap=hard Wrap is not a standard attribute (i.e. it isn't part of the HTML 4.01 standard), it can't be expected to be consistent

[Proto-Scripty] Re: Getting Text Nodes of Elements

2008-10-11 Thread RobG
On Oct 12, 3:29 am, Justin Perkins [EMAIL PROTECTED] wrote: On Sat, Oct 11, 2008 at 10:31 AM, RobG [EMAIL PROTECTED] wrote: Performance is not the issue - fewer lines of code doesn't necessarily mean faster performance. Do you differentiate between browser sniffing and object/method

[Proto-Scripty] Re: Getting Text Nodes of Elements

2008-10-11 Thread RobG
On Oct 12, 10:05 am, kangax [EMAIL PROTECTED] wrote: On Oct 11, 2:40 pm, RobG [EMAIL PROTECTED] wrote: On Oct 12, 3:29 am, Justin Perkins [EMAIL PROTECTED] wrote: On Sat, Oct 11, 2008 at 10:31 AM, RobG [EMAIL PROTECTED] wrote: Performance is not the issue - fewer lines of code doesn't

[Proto-Scripty] Re: How can I get input elements of a div in order of their position?

2008-10-06 Thread RobG
On Oct 7, 12:22 pm, buda [EMAIL PROTECTED] wrote: Thanks for idea, there is no any way by doing it with prototype.js nativly? Sure, use $A to convert the returned NodeList to an array and use each to iterate over it. As far as I know, Prototype.js doesn't wrap getElementsByTagName - what

[Proto-Scripty] Re: Get value from table cell when table row have checkbox checked

2008-09-12 Thread RobG
On Sep 12, 12:53 pm, Daniel Lopes [EMAIL PROTECTED] wrote: This not solution when you want use grids... table are not for layout, right use is to display data, layout must be maded in divs. That makes no sense at all. I wasn't suggesting your use of a table is wrong, but that you use the