similar to: function.prototype.bind return value?

Displaying 20 results from an estimated 2000 matches similar to: "function.prototype.bind return value?"

2005 Aug 29
9
can a class find out it''s instance name?
Hi friends - a javascript question.... Does the prototype object add some way for a class to find out the variable name of its instance variable? Or does javascript have some built in way to do this? This is confusing to describe - but if I define a variable as some object: var myVariable= new Widget(''fdfa''); can some built-in method inside the Widget class be
2005 May 17
3
validates_associated / error_messages_for
When a validates_asssociated fails... I get something like Address is invalid is there a way, preferably on a per-association basis to have the error messaage include the actual error like Zipcode is too long (max is 10 characters) _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
2005 Jun 29
2
Unit testing
Recently, I''ve started to write unit tests for some of my scripts. In general,it''s no worse in JavaScript than in Ruby or Java. I didn''t have the courage to try Selenium, but had a look at JsUnit. Unfortunately, in Konqueror it produces unfathomable errors and in Firefox it is slow beyond imagination. Anyway, writing tests for functions that are computational or
2005 Aug 02
0
Re: function.prototype.bind return
Ah - thanks Michael. Event.stop is precisely what I was looking for. I can just grab the event object inside the handler that I registered previously and pass it to an Event.stop call, and get exactly what I want. Thanks, Rahul Date: Tue, 2 Aug 2005 16:08:20 +0200 From: Markus Joschko <markus.joschko@gmail.com> Subject: Re: [Rails-spinoffs] Re: function.prototype.bind
2005 Jun 29
14
Unobtrusive scripting?
Currently, pages generated by Rails tend to be sprinkled with JavaScript. This happens, because the various helper methods work only locally and simply append to the output. In order to hide the JavaScript away, rendering would probably have to be changed. A way I can think of is that a page-specific script is included in the head of the document and JavaScript code is not written to the
2005 Sep 06
1
US Date Handling in Rails
My application is built on Rails and MySQL. It will only be accepting US formatted dates as input, however both Rails and MySQL are oriented around ISO the format. I know I can convert a good portion of the entries using ParseDate::parsedate but it does not appear this is how the conversion is taking place when data is being transferred from the params hash into model members. Say I have a field
2005 Aug 23
2
using the evalScript option on Ajax.Updater
Hi all, I''m having trouble with the evalScript option on the Ajax.Updater. I''ve removed everything except for the ajax call and a simple alert to try and debug it. It doesn''t appear that the regex is finding my JS in the response... I''m doing an update request and the response is coming back correctly to the updateConent function as this string: <script
2005 Jul 18
13
in place text edit
I''ve written a pretty nice Flickr style in place text edit JavaScript control based on the Script.aculo.us library. API is like this: <span id="editme">Edit me!</span> <script> new InPlaceEditor($(''editme''), ''url/to/action''); </script> Background changes to gray as mouse hovers over the text (like flickr) and the
2005 Sep 20
1
radio buttons and event obvsering
Hi, I made a little utility class that turns on a particular div when a radio button is clicked - a RadioButtonDivToggler. As the name hopefully suggests, when a radio button from the same group is clicked, a different div is made visible and the others are hidden. In essence, it toggles on (makes visible) the div associated with the radio button from a group that you clicked. However,
2005 Jul 06
16
Autocompletion not working in Konqueror
I''ve just had a look again at the autocompletion demo that Thomas put up at http://script.aculo.us/demos/ajax/autocompleter Unfortunately, in Konqueror (3.4.1) it doesn''t work at all. Not even an error is triggered. It does work nicely in Firefox. How about Safari? I don''t have the time right now to track this down systematically (maybe latter), but just from
2005 Dec 12
7
possible opera+prototype bug in evalscripts?
Hi all, I use the ajax updater with evalscripts=true. When I load HTML with included <script> tags, I get this error in Opera 8.51: ------------------- snip ----------------------------- http://ccml.uni-weimar.de/ Timeout thread: delay 10 ms Error: name: EvalError message: Statement on line 258: Illegal use of eval Backtrace: Line 258 of linked script
2005 Jul 10
1
Konqueror compatibility
Thomas, currently the script.aculo.us scripts have some workarounds for Safari that should be extended to more generally cover all khtml-based browsers, Konqueror in particular. In prototype.js, there is a workaround for an addEventListener bug that affects Konqueror as well as Safari, controls.js has a similar workaround, and the special case in dragdrop.js doesn''t hurt anyway. In
2005 Oct 25
24
InPlaceEditor scrolls to top in Firefox?
When I click an InPlaceEditor field in Firefox 1.0.7, the page scrolls up to the top. That''s disconcerting, and often ends up with the editable field out of the viewable pane. I can duplicate this on both Mac and PC. Is there a way to prevent this? Even the demo at http://wiki.script.aculo.us/scriptaculous/show/Ajax.InPlaceEditor does this. Jay Levitt
2005 Aug 16
1
Defining model classes for enumerations
I have several tables for enumerations. They all have the same content: id, name, position. I''d like to avoid the tedious work of defining a class for each one explicitly. Not least, in order to avoid clutter in the model directory. Here''s what I''ve come up with: class EnumRecord < ActiveRecord::Base def self.define_enums(*enums) enums.each do |spec|
2006 Jan 27
2
Position.clone() duplicate
Haven''t seen anyone ask about this yet... why are there 2 Position.clone() methods in Prototype.js? It seems that the second would overwrite the first, and the second has lots more options. Am I missing something? Thanks, rahul _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
2006 Mar 31
3
refreshing JS libraries on client?
Hi folks, So I''ve got this app built on prototype, with a bunch of extra JS classes to do what we want. Now the problem is, when I make a change to one of those JS files (or an upgrade to prototype itself), how do I ensure that the client browsers refresh their cache with the latest JS? Clearly I want the browse to cache the large JS files, but I also want that cache to expire at
2005 Oct 27
5
Problem passing event object
Hi all, I''m having a problem with an Ajax.Request. I can''t figure out how I can pass an event (an onclick on a checkbox) which causes the Ajax Request, to be recognized in an onSuccess function. Here''s my simplified code: var RequiredField = Class.create(); RequiredField.prototype = { initialize: function(chkbox) { this.chkbox = chkbox; this.chkbox.onclick =
2006 Jul 05
1
Prototype Based Validation with form_remote_tag
Hello, I am attempting to use validation.js from http://tetlaw.id.au/view/blog/really-easy-field-validation-with-prototyp e/ with form_remote_tag. The rails form helper binds the needed Ajax.Updater to the onSubmit action of the form. The validation.js also attempts to bind to the onSubmit of the form. The logic that is needed is if( valid.validate() ) { ...Ajax.Updater... } where valid
2006 Apr 14
6
character encoding in ajax submit
Hey all, Anyone got some quick advice on international character submission via Prototype''s Form.Serialize? The base scenario: I set the charset on my page to ISO-8859-1, which seems to be what everyone uses. If I submit a regular form with a standard webpage, I get international characters (like an accented "e", or and AE legature) encoded as 1-byte ascii code
2006 May 09
2
[Prototype] Why doesn''t calling submit() on a form result in the execution of the onsubmit event handler?
Hi, Is it normal that a call to $(''some_form'').submit() doesn''t result in the execution of an onsubmit event handler on ''some_form''? Thanks, - Rowan -- Morality is usually taught by the immoral. -------------- next part -------------- An HTML attachment was scrubbed... URL: