Try using Element#scrollTo
http://prototypejs.org/api/element/scrollto
$('content').scrollTo();
On Thu, Oct 30, 2008 at 10:58 PM, Ali Imran Ahmad
<[EMAIL PROTECTED]>wrote:
>
> Hi, i am developing myspace application. I have a form which has large
> height so when i post data through ajax request
Hello,
Is it possible to convert elements / text nodes to JSON using
Object.toJSON()? I need them in JSON so I can store them in a cookie for the
cookiejar class I am creating.
sample code:
var element = new Element('div');
var nativeelement = document.createElement('div');
var textnode = docume
te:
>
> On Nov 7, 2:19 pm, "Hector Virgen" <[EMAIL PROTECTED]> wrote:
> > Hello,
> >
> > Is it possible to convert elements / text nodes to JSON using
> > Object.toJSON()? I need them in JSON so I can store them in a cookie for
> the
> > cooki
Sorry if this has been asked before, but is there an updated list of
browsers and versions supported by Prototype? I'm particularly interested in
slightly-older Mac-based browsers like IE5.5 and Safari 2. Thanks!
-Hector
--~--~-~--~~~---~--~~
You received this mess
Thanks! This really should be on the main site, as was pointed out in the
thread back in 2007. :)
-Hector
On Thu, Nov 13, 2008 at 4:19 PM, RobG <[EMAIL PROTECTED]> wrote:
>
> On Nov 14, 9:54 am, "Hector Virgen" <[EMAIL PROTECTED]> wrote:
> > Sorry if this has
s in advance,
> --
> T.J. Crowder
> tj / crowder software / com
>
> On Nov 13, 11:54 pm, "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? I&
, T.J. Crowder <[EMAIL PROTECTED]>wrote:
>
> Hi,
>
> > Does anyone know if IE 5.5 for the Mac is supported?
>
> IE 5.5 for the Mac isn't even supported by Microsoft. :-) They EOL'd
> it a couple of years ago.
> --
> T.J. Crowder
> tj / crowder software
I believe Element#insert() expects an object as its parameter, like this:
$('tableid').down('tbody').insert({top: tr});
http://prototypejs.org/api/element/insert
-Hector
On Wed, Nov 19, 2008 at 8:27 AM, jason maina <[EMAIL PROTECTED]> wrote:
> Hi,
>
> As per the subject i'm building DOM eleme
A prototype way might go something like this (untested):
var focused;
Event.observe(document, 'dom:loaded', function()
{
$$('input, select, textarea').invoke('observe', 'focus', function(event)
{
focused = event.element();
});
});
-Hector
On Wed, Nov 19, 2008 at 7:50 AM, EM
;);
$(document.body).insert(button);
-Hector
On Wed, Nov 19, 2008 at 8:07 PM, kangax <[EMAIL PROTECTED]> wrote:
>
> On Nov 19, 3:39 pm, "Hector Virgen" <[EMAIL PROTECTED]> wrote:
> > A prototype way might go something like this (untested):
> > var focused
Is it possible to override Element#observe to do this automatically?
-Hector
On Fri, Nov 21, 2008 at 10:26 AM, Matt Foster <[EMAIL PROTECTED]>wrote:
>
> To elaborate on Kangax's idea, a DOM element is a dynamic object,
> being that you can add custom properties which can be referenced for
> furt
When you create an element with "new Element()", it only exists as a
javascript variable until you append the element to the DOM.
The $() function looks in the DOM for the element, which is why it is not
finding it.
Also, you may want to use Element#setStyle() instead of accessing the style
prope
This is untested, but I would probably do something like this:
$$('form[name=login_form]').invoke('observe', 'keydown', function(event)
{
if (event.keyCode === 13) {
event.findElement('form').submit();
}
});
-Hector
On Wed, Dec 10, 2008 at 4:46 AM, Dave L <[EMAIL PROTECTED]> wro
Does the form (or modal) happen to be in an iframe?
-Hector
On Thu, Dec 11, 2008 at 3:36 AM, Dave L <[EMAIL PROTECTED]> wrote:
>
> I tried all the above solutions but none seem to work. This is in a
> modal popup, so its almost as if the javascript is not finding the
> form element or something
I suggest using a class name of "required" instead of creating a new
attribute. Then it becomes very simple to select() required elements (no to
mention styling them with CSS).
div.select('select.required');
-Hector
On Wed, Dec 17, 2008 at 9:35 AM, buda wrote:
>
> sorry - I do use quirk mode
I'm not sure how Drupal has their Javascript set up, but generally you
should be able to wrap their JS in an anonymous function:
(function($){
// Drupal JS code goes here
// Within this block, '$' represents jQuery
$('#foo').click(function() {
alert('jQuery event');
});
})(
Wow, so only robot programmers can write a $() function?
-Hector
On Fri, Jan 23, 2009 at 12:16 PM, kangax wrote:
>
> On Jan 23, 3:00 pm, Gabriel Gilini wrote:
> > Quoting the Ecma-262:
> >
> > This standard specifies one departure from the grammar given in the
> Unicode
> > standard: The doll
Hello,
I am writing a plugin that takes a text input () 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 the value, but it does not
seem to work when the input is hidden. However, using the
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.
-Hector
On Mon, Feb 23, 2009 at 8:15 AM, SWilk wrote:
>
> Hector Virgen wrote:
> > Hello,
> >
> > I am writing a plugin that t
Check out Class#create
http://prototypejs.org/api/class/create
It's a great way to get started with OO javascript.
-Hector
On Fri, Feb 27, 2009 at 3:43 PM, greghauptmann wrote:
>
> Hi all,
>
> I confess this is a newbie question in advance:
>
> Q1 - If one wants to build a set of higher level
Also, here's a shameless plug to my own blog that showcases a simple OO
prototype plugin. However, it doesn't use Class#create :(
http://www.virgentech.com/code/prototagger
-Hector
On Fri, Feb 27, 2009 at 5:16 PM, Hector Virgen wrote:
> Check out Class#create
>
> http://
event.element() may not necessarily return $('object_id'). It returns the
element that fired the event, which can be a child element of
$('object_id').
For example:
Event.observe('document', 'click', function(event)
{
console.log('You clicked on: ', event.element());
});
If you look at the co
Typo in my JS snippet... there should be no quotes around document
Event.observe(document, 'click', function(event)
{
console.log('You clicked on: ', event.element());
});
-Hector
On Thu, Mar 26, 2009 at 4:35 PM, Hector Virgen wrote:
> event.element() may
You might want to try adding an observer to all form elements to detect when
the values change. For example:
var isDirty = false;
$$('input, textarea').invoke('observe', 'change', function()
{
isDirty = true;
});
-Hector
On Fri, Mar 27, 2009 at 3:22 PM, Stefano Esposito <
stefano.esposit...@
$$() uses CSS selectors, so you must pass in a CSS rule. Try this:
$$('a.classProjectsEditA').invoke('observe', 'click', editProjectRecord);
-Hector
On Wed, Apr 1, 2009 at 8:47 AM, BrentNicholas wrote:
>
> Hello all,
>
> I found that the getElementsByClassName had been depricated so I'm
> tryin
Can you use the native parseInt() function? or parseFloat()?
var num = parseInt("52");
console.log(num); // int 52
-Hector
On Fri, Apr 24, 2009 at 9:06 AM, Ananth Raghuraman
wrote:
> Need prototype function to convert object/string/number to number. Please
> help.
>
> >
>
--~--~-~--~-
It seems like you're working against the standard here. Normally, the value
is what's important upon submission.
But what you want can be done. There are two approaches to this:
1. When rendering the page, make the value and description the same. You'll
need to escape the value attribute with html
The script that is making the ajax request has to be on the same domain
where the ajax response is coming from. So just keep your script on your
server and use a wrapper function from the other domain that calls your
script residing on your domain.
On Tue, Sep 16, 2008 at 12:23 PM, Diodeus <[EMAIL
>
> I believe all class methods in proto begin with a lowercase letter.
Except for Ajax methods. :)
-Hector
On Fri, Sep 19, 2008 at 8:34 AM, Matt Foster <[EMAIL PROTECTED]> wrote:
>
> Its because IE doesn't extend the objects prototype, and because
> you're referencing it via element.form, it
Oh, ok! That makes a lot more sense, thanks! I was wondering why those were
all capitalized.
-Hector
On Fri, Sep 19, 2008 at 9:10 AM, Justin Perkins <[EMAIL PROTECTED]>wrote:
>
> On Fri, Sep 19, 2008 at 11:01 AM, Hector Virgen <[EMAIL PROTECTED]>
> wrote:
> > Except f
I like Prototype because it takes all the work out of Javascript. I've been
using it for a few years now but as a PHP developer I usually only used it
for Ajax. Only recently have I started to get acquainted with all of its
other components, and it is a pleasure to work with. Just last night, for
f
By default, Ajax sends parameters as post data. Try checking for
$_POST["centre"], or change your Ajax call to use the "get" method instead:
new Ajax.Request(url, {
method: 'get'
});
-Hector
On Sat, Sep 27, 2008 at 11:52 AM, matthewboh <[EMAIL PROTECTED]> wrote:
>
> I've done Javascript and
ction()
{ alert('changed'); });
-Hector
On Mon, Sep 29, 2008 at 8:53 AM, buda <[EMAIL PROTECTED]> wrote:
>
> No, I want after changing the Select1 call an Event whitch will caught
> by Select2 and do somth with Select2
>
> On 29 сент, 18:50, "Hector Virgen" &l
I'm not too sure, but I think it's because you need to observe the event
where the event is fired. $('Select1') fires the event, so you need to
observe $('Select1') to catch the event, otherwise you're waiting for
$('Select2') to fire it, and it never does.
2008/9/28 buda <[EMAIL PROTECTED]>
>
>
"prototype" yields 49.1 million hits, but that's not exactly fair...
On Mon, Sep 29, 2008 at 3:54 PM, Dan Dorman <[EMAIL PROTECTED]> wrote:
>
> On Mon, Sep 29, 2008 at 4:43 PM, MikeFeltman <[EMAIL PROTECTED]>
> wrote:
> >
> > One comment I'd like to make on momentum...
> >
> > A Google search for
IE7 has very poor support for alpha-blended transparent images. I'm not sure
if it would work, but what if you fade a wrapper div instead of the div with
the background image?
-Hector
On Mon, Sep 29, 2008 at 10:24 PM, Jeusdi <[EMAIL PROTECTED]> wrote:
>
> I need to do 'Fade' and 'Appear' Effect o
16 PM, Jeusdi <[EMAIL PROTECTED]> wrote:
>
> Mmm, What do you mean about wrapper div?
>
> Hector Virgen ha escrito:
> > IE7 has very poor support for alpha-blended transparent images. I'm not
> sure
> > if it would work, but what if you fade a wrapper div instead
You want to invoke the 'observe' method:
$$('input.info').invoke('observe', 'onkeydown', function(){...})
-Hector
On Mon, Sep 29, 2008 at 2:41 PM, Nik <[EMAIL PROTECTED]> wrote:
>
> Hello all,
>
> I am wishing to do something like this:
>
> $$('input.info').invoke('onkeydown', function(){...})
>
Very nice! I'd like to see this added to Scriptaculous.
On Thu, Oct 2, 2008 at 10:38 AM, dinken <[EMAIL PROTECTED]> wrote:
>
> Bug with Autocompleter not canceling pending Ajax requests causing
> potential race condition for onComplete logic.
>
> //I added this function to the Ajax.Autocompleter
In my experience I've had success using two different mouseover events
instead of a mouseover/mouseout combination.
The first mouseover observer is a simple one:
$('nav').observe('mouseover', function(event) {
$('nav').show();
});
The second observer observes the entire document and checks to
Do any callbacks exists for when an element is removed from the DOM via
Element.remove()? Or maybe a custom event can be called just prior to the
removal? I need something like this to help me remove related "tooltip" divs
that are not direct descendants of the element being removed.
For example, I
Very nice! I think that covers it for my current needs. Thanks :)
-Hector
On Mon, Oct 6, 2008 at 1:11 PM, Justin Perkins <[EMAIL PROTECTED]>wrote:
>
> You can use Function#wrap to help you with this by wrapping the
> Element#remove method, but you will also have to watch out for other
> destructi
So on click you want it to fade, and when the Ajax request is completed you
want it to appear?
On Mon, Oct 6, 2008 at 4:29 PM, Arak Tai'Roth <[EMAIL PROTECTED]>wrote:
>
> Anybody feel like helping me? I asked around the CakePHP group and
> they say it's a Javascript error, so just checking back i
Is there a vertical equivalent to Effect.Shake, or a way to make it shake
vertically instead of horizontally?
-Hector
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Prototype & script.aculo.us" group.
To post to thi
Is there a Prototype way to get the descendants of an element that are only
text nodes? Element.descendents() only returns elements. Thanks!
-Hector
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Prototype & script.
Thanks! That should do the trick :)
On Tue, Oct 7, 2008 at 12:12 PM, Justin Perkins <[EMAIL PROTECTED]>wrote:
>
> I think you will need to use the native methods to get the text nodes
> as Prototype filters them out. This will work though:
>
> $A( $('some-element-id').childNodes ).select( functio
des in childNodes.
> /Søren
>
> On 07/10/2008, at 21.24, Hector Virgen wrote:
>
> Thanks! That should do the trick :)
>
> On Tue, Oct 7, 2008 at 12:12 PM, Justin Perkins <[EMAIL PROTECTED]>wrote:
>
>>
>> I think you will need to use the native methods to ge
is helps.
-Hector
On Wed, Oct 8, 2008 at 8:43 AM, Arak Tai'Roth <[EMAIL PROTECTED]>wrote:
>
> Are you able to help me with this?
>
> On Oct 6, 8:28 pm, "Arak Tai'Roth" <[EMAIL PROTECTED]> wrote:
> > You got it:
> >
> > On Oct 6, 5:38 p
Correction (but still untested):
$$('a.ajaxable').invoke('observe', 'click', handleAjaxClick);
-Hector
On Wed, Oct 8, 2008 at 11:09 AM, Hector Virgen <[EMAIL PROTECTED]> wrote:
> I'm not sure how you'd do this with CakePHP's helper, but I th
>
> > The issue lies with the LI that has a UL in it. In that case, you get
> > "Bar [bunch of whitespace] Baz", then next you get just "Baz". If the
> > order of elements is important, then you will need to use either a
> > smarter selector or a test inside th
The problem is that each of your input boxes have the same ID. All instance
of the Autocompleter are being attached to that ID, and the DOM only returns
the first one.
On Wed, Oct 8, 2008 at 12:42 PM, kevandju <[EMAIL PROTECTED]> wrote:
>
> Example of what HTML looks like if a user chooses to add
You should still use a unique ID. In your PHP, you can do this:
for ($i=0,$k=2;$k<=$c;$i++,$k++) {
echo '
new Ajax.Autocompleter("hlp_callsign' . $i . '
","hint","callsign_search.php",
{paramName:"name"});
';
}
On Wed, Oct
Is there a reason you need the data to remain escaped while being used by
javascript? Unless your javascript is interacting directly with the
database, you should not need to keep your data escaped. Once javascript is
done with the data, and sends it back to the server, the server should then
re-es
I think you can avoid the setInterval function by using Ajax.Responders.
http://www.prototypejs.org/api/ajax/responders
Ajax.Responders.register({
onComplete: function()
{
new AnchorChecker();
}
});
-Hector
On Thu, Oct 9, 2008 at 12:52 PM, Justin Perkins <[EMAIL PROTECTED]>wrote:
>
>
gt; a library that has better xml support.
>
>
>
>>
>> On Thu, Oct 9, 2008 at 3:53 PM, Hector Virgen <[EMAIL PROTECTED]> wrote:
>>
>>> Is there a reason you need the data to remain escaped while being used by
>>> javascript? Unless your javascript
own to china town', 100);"
>
> both of those throw errors. obviously I need it to work for double quotes
> or single quotes.
>
>
>
>
> On Thu, Oct 9, 2008 at 4:38 PM, Hector Virgen <[EMAIL PROTECTED]> wrote:
>
>> Maybe I'm not understanding
e.
>
> so in reference to "Are you using javascript to print out the onmouseover
> text, or a server-side language?" - yes, I am using javascript to print the
> mouseover text because it's coming from the server via an ajax interaction
> and not on a page load.
>
>
Would it be better to receive text nodes as an enumerable? Maybe something
like Element#childTextNodes() to compliment Element#childElements()? It
would be nice if text nodes that contain only white space are excluded.
-Hector
On Thu, Oct 9, 2008 at 8:56 PM, Justin Perkins <[EMAIL PROTECTED]>wrote
For adding and removing class names, you should use Element#addClassName and
Element#removeClassName. It is much more consistent across all browsers.
-Hector
On Mon, Oct 13, 2008 at 12:06 AM, Mads <[EMAIL PROTECTED]> wrote:
>
> Could i use the .morph effect to change an entire class?
>
> Tried to
When the "script" element is inserted into the document body, does the
currently-running script wait for the js file to be downloaded and executed?
Or does the js file download in the background while the current script
finishes?
-Hector
2008/10/15 buda <[EMAIL PROTECTED]>
>
> tere is a beautiful
60 matches
Mail list logo