I noticed that if I set the checked attribute on a radio button before
I attach it to the DOM, IE7 will not show the button as checked when
it is indeed appended to the DOM. It may happen to other IE versions
too.
var r = new Element(
'input', {
type: 'radio'
}
);
if (someCondition) {
r.writ
What's the best way to find which iteration the PeriodicalExecutuer is
currently on? What I'm trying to do is step through an array slowly
(period of 0.5 seconds) and having the ability to stop at an arbitrary
time. The PeriodicalExecuter has the ability to stop, but it doesn't
have the ability to
Why is the Element::store() not listed in the documentation???
http://www.prototypejs.org/api/element .
Thanks for pointing out this feature. I've been stupidly creating my
own data structures to further describe DOM elements. Now I don't have
to do that.
On Nov 22, 12:31 pm, Luke wrote:
> Thank
ototypejs.org/dom/event/stop/
>
> HTH,
> --
> T.J. Crowder
> Independent Software Engineer
> tj / crowder software / com
> www / crowder software / com
>
> On Oct 22, 2:41 am, JoJo wrote:
>
> > I use anchors to call javascript functions. Usually, I do this:
>
&g
I use anchors to call javascript functions. Usually, I do this:
call the function
This works fine in all browsers. Window.onbeforeunload is never
triggered because the ONCLICK returns false, and thus the HREF if not
executed. When HREF is not executed, the browser does not believe that
the w
led when the AJAX is processing...
On Oct 20, 1:36 pm, JoJo wrote:
> activate() did not fix it.
>
> On Oct 19, 11:08 pm, Walter Lee Davis wrote:
>
> > Try activate in place of focus, and see if that works for you. Just
> > checking -- you do have Prototype in your page, rig
activate() did not fix it.
On Oct 19, 11:08 pm, Walter Lee Davis wrote:
> Try activate in place of focus, and see if that works for you. Just
> checking -- you do have Prototype in your page, right?
>
> Walter
>
> On Oct 19, 2010, at 9:59 PM, JoJo wrote:
>
> > I
I'm creating a standard chat system. When the user hits the Enter key
in the textarea, I send her comment to the server. Then I clear her
message so she can begin typing a new one. The cursor blinker
disappears when I do this clear. It's better for usability if the
blinking remains. How do I put it
$('someElement').hide.delay(2);
$('someElement').show.delay(3);
These functions trigger this error: "'style' is null or not an object"
in IE7. The only way to solve it is to write long ugly code:
var f = function() {
$('someElement').hide();
};
f.delay(2)
--
You received this message because
Is there a version of document.viewport.getScrollOffsets for DIVs with
CSS style of overflow:auto?
I have a DIV with scroll bars and it contains 150 images. I wish to
only load the images as the user scrolls to them, so I don't burden
the server. To do this, I would need to detect the scroll offse
I am trying to pre-select an option in a standard HTML select dropdown
using option.writeAttribute('selected', 'selected'). It worked in IE
and FF, but not in Safari. I had to change the code to
option.selected=true for all 3 browsers to work. I'd prefer to use the
writeAttribute wrapper instead of
I believe I solved the problem. I had a queue of work orders. One of
these work orders queued up another work order, so it was a nested
AJAX request - BAD IDEA!
On Sep 24, 12:56 pm, JoJo wrote:
> I don't need A to finish before B. I need A's callbacks to not be cut
> off by B
n Fri, Sep 24, 2010 at 3:21 PM, JoJo wrote:
> > I have several lines of code that I want to run atomically (no context
> > switches to other code). Please look at the following barebones
> > example that illustrates the issue:
>
> > //=
>
I have several lines of code that I want to run atomically (no context
switches to other code). Please look at the following barebones
example that illustrates the issue:
//=
function doAjax() {
console.info('making request');
new Ajax.Request(
url, {
onSuccess: fun
I'm collecting stats on user clicking behavior. In this example, I
write an entry into the database whenever someone clicks a link that
starts a download:
download program
function logClick() {
new Ajax.Request(
'/logger.php?action=1'
);
}
This works great in Internet Explorer and Fi
only alerted "undefined" but never alerted "my code". Anyway,
this is not a bulletproof solution because if the site owner's
Prototype loads after mine, it will still be included twice and crash
IE7.
On Jul 8, 2:39 pm, JoJo wrote:
> I can do a lot of things like:
>
>
existence of Prototype.Version (look in
> scriptaculous.js for the exact syntax) and then error out or skip
> loading?
>
> Walter
>
> On Jul 8, 2010, at 5:02 PM, JoJo wrote:
>
> > PROBLEM
>
> > In IE7, many of Prototype's functions stop working when Prototy
PROBLEM
In IE7, many of Prototype's functions stop working when Prototype.js
is included twice. What is the best practice for shielding against
multiple loads of Prototype?
BACKGROUND
I'm creating a widget script people can embed on their websites. My
script uses Prototype. There's a possibility
Is it possible to test whether the window has been loaded or not? I
have a script.js that anyone can use. Some people will put it in the
head tag, so this script will be run before Window has been loaded.
Other people might do something crazier like only load script.js when
someone clicks a button.
Why can't I create hashes where the keys are variables?
var klass = Class.create(
initialize: function() {
this.field = new Hash({klass.staticVar: 999});
}
);
klass.staticVar = 888;
SyntaxError: missing : after property id { message="missing : after
property id", more...}
I
& Executive Director, Tabby's Placehttp://www.tabbysplace.org/
>
> -Original Message-
> From: prototype-scriptaculous@googlegroups.com
>
> [mailto:prototype-scriptacul...@googlegroups.com] On Behalf Of JoJo
> Sent: Saturday, April 24, 2010 4:46 PM
> To: Prototype &a
I'm using an anchor tag to run some JS when clicked. This works
perfectly in Firefox, but Internet Explorer 8 wrongfully fires the
onbeforeunload callback. I know this can be solved by changing
HREF="javascript:void(0)" to HREF="#", but it won't work in my
situation because my anchor is very low in
e range 1 through -1 gives you a massive number
> (20,001) of vertical planes to stack...
>
> FWIW,
> --
> T.J. Crowder
> Independent Software Consultant
> tj / crowder software / comwww.crowdersoftware.com
>
> On Apr 1, 1:13 am, JoJo wrote:
>
> > On
On all browsers but Safari, getStyle('zIndex') returns a string
representation of the max integer value "2147483647" for one of my
elements. However, on an older version of Safari, it return the
exponentiated number "2.14748e+9". After upgrading to the newest
Safari, it now returns "2.14748e+009"
anged it to:
header( 'Cache-Control: max-age=0, must-revalidate, post-check=0, pre-
check=0', false );
On Mar 16, 2:17 am, Daan Mortier wrote:
> JoJo:
>
> > I'm doing some cross-site AJAX hack by dynamically inserting a script
> > tag. This script tag
I'm doing some cross-site AJAX hack by dynamically inserting a script
tag. This script tag loads a PHP script that prints out javascript:
$$('head').first().appendChild(
new Element(
'script', {
id: 'scriptTag',
type: 'text/javascript',
src: 'http://www.extern
I noticed that the onFailure callback never fires when there's
actually an error in Ajax.Request. Commonly, I just alert('server
busy') in the callback. I never see this alert when my web host is
overloaded and just doesn't respond at all. How do I alert an error
message when the server is too slow
$('div').getStyle('padding-top') returns "1em" in Internet Explorer
and "12px" in Firefox. It appears that Firefox has recursively
multiplied all its ancestor's font-sizes to get the absolute value of
12px. This is actually better for the particular GUI I'm making. Is
there anyway for Internet Expl
I want to update the title tag. This works in Firefox:
$$('title').first().update('dynamic string');
Do you know why there is a runtime error in Internet Explorer 8?
--
You received this message because you are subscribed to the Google Groups
"Prototype & script.aculo.us" group.
To post to th
I'm using the Twitter API. It needs the user's username and password
send though the Basic Authentication protocol before that user's
Twitter account can be modified. I've searched for how to do Basic
Authentication on the JS side (I don't want to use curl because of
server load), but I've only f
isn't being loaded more than once, are there other third-
> party scripts or libraries on the page that may be interfering with `
> $A`?
>
> HTH,
> --
> T.J. Crowder
> Independent Software Consultant
> tj / crowder software / comwww.crowdersoftware.com
>
> On Dec 15, 8:57 pm, JoJo wrote:
>
> > I'm creating a widget where I tell people to copy and paste this code
> > onto their site:
>
> >
How does dom:ready prevent multiple executions of the same script?
On Dec 16, 6:16 am, "Alex McAuley"
wrote:
> Why not attach the widget code to dom:ready
>
> Alex Mcauleyhttp://www.thevacancymarket.com
>
> - Original Message -
> From: "JoJo&quo
I'm creating a widget where I tell people to copy and paste this code
onto their site:
http://www.site.com/script.js";>
Script.js looks for all the widget divs on the page by using $$ and
dynamically fills them up. Now, I'm not catering to nerd programmers
who know that it's better to
All conditions.
On Dec 7, 4:27 pm, "Rick Waldron" wrote:
> What condition should exist to stop the evaluation?
>
> -- Sent from my Palm Prē
>
> JoJo wrote:
>
> I have a <textarea id="foo"> which contains JS code that people can
>
> copy and
I have a which contains JS code that people can
copy and paste. It's dynamically generated, so I do something like
this:
$('foo').update(');
The documentation on Element.update states that the script will be
evaluated rather than inserted literally. It does not tell me how to
stop the evaluation
I switched to using Element.observe() and it started working in IE6 &
7. I guess I don't need a solution to setting onclick directly, but if
anyone has any insight, please share.
Thanks.
On Dec 1, 1:39 pm, JoJo wrote:
> If I dynamically create an achor in IE6 and IE7, it's oncl
If I dynamically create an achor in IE6 and IE7, it's onclick event
won't fire when clicked on. Below is an example of a static anchor
and dynamic anchor - both are supposed to pop up an alert. Why does
only the static anchor work?
JS JS JS JS JS JS JS JS JS JS JS JS
entHeight;
}
return {width: w, height: h};
On Nov 29, 8:44 pm, JoJo wrote:
> How do you get the true height of the body element? I have a very long
> page and calling getDimensions() only returns the viewable area's
> height.
>
> Thanks.
--
You received this
I want to remove an element from the DOM after fading it.
new Effect.Fade(
'lightbox', {
duration: this.animationTime,
afterFinish: $('lightbox').remove()
}
);
The above code works but gives me an error. Why is it still trying to
calculate opacity after it's finished?
el
How do you get the true height of the body element? I have a very long
page and calling getDimensions() only returns the viewable area's
height.
Thanks.
--
You received this message because you are subscribed to the Google Groups
"Prototype & script.aculo.us" group.
To post to this group, send
I am making a website with an embedded app, so it is very much like a
desktop application. There are blocking events.
On Nov 18, 12:12 am, Peter De Berdt wrote:
> On 18 Nov 2009, at 01:30, JoJo wrote:
>
> > When the user clicks a button, I want to show an hourglass cursor
> >
When the user clicks a button, I want to show an hourglass cursor
while its onclick handler is being run. I tried this:
$$('body').first().setStyle({cursor: 'progress'});
The hourglass only appears when I hover over the body background. When
hovering over the button itself (which is an ), the cur
Is it poor practice to use $$?
$$('#grandparent #parent tag.class');
I've been using $$ quite a lot because it has sped up DEVELOPMENT, but
now I have realized that it will slow down MAINTENANCE. Recently, my
boss asked me to move a whole div to another part of the page. Since
I was accessi
I wanted to prevent rapid double clicking of an AJAXed tab. My code
works well in IE8, FF, and S. In IE7 and 6, the tab gets disabled
permanently even though I see both window.status calls printing out
the expected stuff. What's going on?
++
var tabOnclick = tabElement
of executing
> ajax calls any time, for as long as you do all your ajax calls through
> prototypejs (we have some old code we still need to migrate to
> prototypejs, so for some of those processes, it doesn't work for us,
> but this does the trick ;) )
>
> Cheers,
>
* onUninitialized,
* onLoading,
* onLoaded,
* onInteractive,
* onComplete and
* onException.
I'm trying to display a swirly animated GIF while my AJAX request is
being processed. I am currently using the onLoading callback to
display the GIF. In some rare cases, the onLo
der software / comwww.crowdersoftware.com
>
> On Oct 12, 11:52 pm, JoJo wrote:
>
>
>
>
>
> > Why is it that the following gives the error: [Exception... "An
> > invalid or illegal string was specified" code: "12"]
>
> > var title = $(cha
You might want to try setting paddingLeft, paddingRight, paddingTop,
paddingBottom all to 50px. I recall I ran into the same issue before
and this solved it.
On Oct 11, 12:41 am, "Alex McAuley"
wrote:
> from reading the docs Effect.morph excpects a style string using camelised
> case
>
> I am n
Why is it that the following gives the error: [Exception... "An
invalid or illegal string was specified" code: "12"]
var title = $(channelId).down('strong').down('a').innerHTML;
While this one, which looks identical to me work just fine?
var title = $$('#' + channelId + ' strong a').first
Upon entering the page and clicking on an inPlaceEditor, I get the
expected result: single line editing of a text field. I then click
"ok" without even touching the text. My PHP script trims it and spits
back the value. I then click to edit again, but now the box has become
a 3 multi-line box. I
http://www.prototypejs.org/api/utility/dollar-r
>From the documentation of the Range utility, it seems like it can only
increment by 1's. For example, $A($R(1,10,true)) gives you:
[1,2,3,4,5,6,7,8,9,10].
I'm looking for a way to specify that I want to increment by any
value. Let's say count up b
Hi David,
I know PeriodicalUpdater has a start() function, but
PeriodicalExecuter does not (according to the documentation).
On Sep 16, 5:27 am, david wrote:
> Hi Jojo,
>
> if you look at prototype source, you will see that there is a start
> function on the PeriodicalUpadter
&g
I have this code and it works very well:
window.onbeforeunload = function() {
if (this.hasUnsavedChanges) {
return 'you have unsaved changes';
}
}.bind(this);
+
But when I try to convert it to Prototype style, it doesn't
try this:
>
> $('feedbackName')|.writeAttribute("style", null)|
>
> It will remove style attribute from element.
>
> Marko
>
> Alex McAuley wrote:
> > setStyle() requires parameters
>
> > Alex Mcauley
> >http://www.thevacancymarket.
http://www.prototypejs.org/api/periodicalExecuter
I noticed that there is no start method of a PeriodicalExecuter.
However, AJAX.PeriodicalUpdater does have one. I'm trying to mix
these two types and polymorphically start and stop them. To restart a
PE, do I really have to redeclare it?
--~--
I'm highlighting an input textbox if the user forgot to fill out the
form. After the box get highlighted, it looks like retro Windows 95
with thick borders and boxy edges. So I attempt to remove the styling
with an afterFinish callback, but for some reason, that is never
called. Why?
if ($F('fe
I tried to defer it, but that didn't work. It said "this.element is
null" in Control.js. I'm guessing because the function wasn't
deferred long enough to wait for the HTML to be inserted.
new Ajax.Updater(
'placeToInsertResponse',
'ajaxScript.php', {
parameters: $('formId').seria
I wanted everyone to know that I was stupid to be testing this in
IE8's IE7 backwards compatability mode. This error never occurs in
the real IE7. It's just a warning for everyone, never use IE8's
backwards mode when web designing.
On Sep 4, 2:22 pm, "T.J. Crowde
01 am, JoJo wrote:
> Hi TJ,
>
> This is the simple script which will say "MYAPP.class1 is null or not
> an object - Line 33" about 25% of the time on IE8 in IE7-compatability-
> mode. You must hit refresh a few times and then click the button to
> see the error. Maybe w
MYAPP.class1 = new MYAPP.Class1();
});
//]]>
make class1 speak
+
On Sep 4, 12:51 am, "T.J. Crowder" wrote:
> Hi JoJo,
>
> I suspect there's some small (but
I never knew about the shortcut. Could you point me to the page that
talks about this? Thanks!
On Sep 4, 6:30 am, mau wrote:
> JoJo, thanks for your response,
>
> There’s also a shortcut method offered which you can call on the
> element itself. Note, that this will only work
Shouldn't it be:
new Effect.Appear('menu');
On Aug 31, 7:56 am, mau wrote:
> Hi, I've an issue with scriptaculous appear effect and IE 7, when I
> nest a div inside another div with display none to make it appear, it
> doesn't appear slow, it appears at once.
>
> I call a js function when div
ut is giving an error when I
access it in main.js? This native and function object talk just went
straight over my head. I am only a beginner to JS.
On Sep 3, 10:51 pm, RobG wrote:
> On Sep 4, 3:43 pm, RobG wrote:
>
>
>
> > On Sep 4, 4:40 am, JoJo wrote:
>
> > >
gt;
> Works in every browser - i had to update some code to fix similar errors on
> my web desktop
>
> Alex Mcauleyhttp://www.thevacancymarket.com
>
> - Original Message -
> From: "JoJo"
> To: "Prototype & script.aculo.us"
> Sent: Thur
= new MYAPP.Class1();
MYAPP.class2 = new MYAPP.Class2();
});
On Sep 3, 10:40 am, DJ Mangus wrote:
> See this
> article:http://proto-scripty.wikidot.com/prototype:how-to-load-scripts-dynami...
>
> On Thu, Sep 3, 2009 at 9:25 AM, JoJo wrote:
>
> > Instead of loading JS in the , ho
s i would
> always wait until the dom is ready or in each function that gets called test
> the function,variable or method exists else timeout untill it does
> Alex Mcauleyhttp://www.thevacancymarket.com
>
> - Original Message -
> From: "JoJo"
> To: "Pro
In my , I'm loading several JS files. I'm expecting this to
occur:
1) script1.js is loaded
2) script1.js runs - it creates an object
3) script2.js is loaded
4) script2.js runs - it creates a different object that depends on
script1's object.
5) and so on
This works perfectly in Firefox and
I (Mojito) [don't know why my first post name differs from reply name]
have solved by issue. I was passing in strings with '\0' on their
ends. So 'mpg\0' does not equal 'mpg'. It was a nightmare to debug
because '\0' is invisible.
On Sep 2, 10:29 am, enigment wrote:
> Ah, that's the missing p
I'm wondering why Internet Explorer was not mentioned in
http://www.prototypejs.org/api/element in that example creating the
element with the class.
I'm curious why Prototype doesn't just add the class for me behind the
scenes...
On Aug 31, 11:09 pm, "Alex McAuley"
wrote:
> Because IE8 does not
Nevermind. I found it though Google search:
http://www.prototypejs.org/api/periodicalExecuter
Boy, was it hard to find.
On Aug 24, 4:24 pm, Paul Kim wrote:
> I don't think Prototype has a plain timer, but couldn't you just use
> setTimeOut?
>
> setTimeout("javascript statement", 1000);
>
> - P
is an object. Even function literals.
>
> On 8/22/09, JoJo wrote:
>
>
>
>
>
> > How do I use bind? Doesn't the bind function take an object as an
> > argument? I'm doing this stuff inside a class, not an object.
>
> > On Aug 22, 6:15 pm,
How do I use bind? Doesn't the bind function take an object as an
argument? I'm doing this stuff inside a class, not an object.
On Aug 22, 6:15 pm, Gareth Evans wrote:
> Use bind (method on the function object)
> see the typewriter example i wrote for syntax
>
> On Sun, Aug 23, 2009 at 9:06 AM,
If I want to quickly develop without looking up whether I need NEW or
don't need NEW, can I just put NEW in front of everything? Would this
lead to a memory leak or does Prototype have some sort of garbage
collection?
On Aug 20, 2:04 am, "T.J. Crowder" wrote:
> Hi,
>
> In general, the correct t
And how would I contact this Thomas god?
On Aug 22, 11:07 am, Walter Lee Davis wrote:
> Where by Sam I meant Thomas, obviously...
>
> On Aug 22, 2009, at 2:04 PM, Walter Lee Davis wrote:
>
>
>
> > I asked on the Github list, and only the repo owner can delete pages
> > entirely. We are free to t
I think I figured it out. The callback must not have parentheses.
FAIL:onUpdate: someFunction();
GOOD: onUpdate: someFunction;
I have no idea why. I am a beginner to JS.
On Aug 15, 11:17 pm, Mojito wrote:
> Why is the onUpdate callback fired right when the Sortable is created
> and not wh
75 matches
Mail list logo