equest/
http://proto-scripty.wikidot.com/prototype:how-to-bulletproof-ajax-requests
HTH,
--
T.J. Crowder
Independent Software Engineer
tj / crowder software / com
www / crowder software / com
On Sep 22, 7:22 pm, nephish wrote:
> I am working with a javascript function called Elabel, part of the
> Google m
er argument list in this line
> onSuccess: function(response) {
>
> i have tried lots of different adjustments.
>
> thanks
> sk
>
> On Sep 22, 4:53 pm, "T.J. Crowder" wrote:
>
>
>
> > Hi,
>
> > You're taking the return value of `new Aja
ere
passing the string "input[type=radio][name='type'][value=selectThis]"
into $$ as the selector. David's suggestion fixes that by using the
*value* of selectThis rather the actual text "selectThis". As the live
example above shows, that works.
FWIW,
--
T.J. Crow
g}');
> var selectThis;
> var selectID;
>
> selectID = {matchID: strID};
> selectThis = {matchString: strValue };
> $$('select#selectIDTemplate.evaluate(selectID) option').each(function(o){
> if(o.value == selectTemplate.evaluate(selectThis)){o
Hi,
This is probably more of a question for the jQuery forums, or the
makers of the galleria plugin you're using. My suspicion is that the
plug-in doesn't support jQuery's noConflict mode (that's easy to do).
FWIW,
--
T.J. Crowder
Independent Software Engineer
tj / crowder so
whether it closes over data. More about
closures here:
http://blog.niftysnippets.org/2008/02/closures-are-not-complicated.html
HTH,
--
T.J. Crowder
Independent Software Engineer
tj / crowder software / com
www / crowder software / com
On Sep 27, 3:01 am, Daniel Ribeiro wrote:
> The author
Hi,
Can you put together a minimalist, self-contained example and post it
to pastie.org or jsbin.com or jsfiddle.net or somewhere? Just the
minimum needed to show the problem.
--
T.J. Crowder
Independent Software Engineer
tj / crowder software / com
www / crowder software / com
On Sep 28, 4:03
http:// URLs, loading
Prototype from the Google CDN:
http://jsbin.com/itovi4
As you can see, the returned result is extended (it has Prototype's
`observe` function on it).
HTH,
--
T.J. Crowder
Independent Software Engineer
tj / crowder software / com
www / crowder software / com
On Sep 28, 2:56
DOM-Level-2-HTML/html.html#ID-88517319
HTH,
--
T.J. Crowder
Independent Software Engineer
tj / crowder software / com
www / crowder software / com
On Oct 2, 6:39 pm, Vinoth John wrote:
> Div tags generated from template's href value , when it is tried to be
> retrieved through read a
Hi,
Protosafe is no longer being maintained by its original maintainer (or
anyone else, as far as I know). It's an ex-project. ;-)
HTH,
--
T.J. Crowder
Independent Software Engineer
tj / crowder software / com
www / crowder software / com
On Oct 3, 8:14 pm, nono1974 wrote:
> Hi all
file , i hav sent you in this mail. It will clearly tell you the issue i
> am facing. Thanks for your response in advance.
>
> Thanks & Regards,
> Vinoth john
>
>
>
> -Original Message-
> From: T.J. Crowder
> Sent: 03/10/2010, 7:14 PM
> To: Prototype & sc
e Prototype
and MooTools on the same page is likely to be a painful effort and
would recommend picking one and just using it. There's a lot of
overlap.
HTH,
--
T.J. Crowder
Independent Software Engineer
tj / crowder software / com
www / crowder software / com
On Oct 4, 8:26 pm, nono1974 wrot
iting), but the _fact_ of
them coming on the heels of Microsoft's recently re-upping their
commitment to jQuery is significant.
--
T.J. Crowder
Independent Software Engineer
tj / crowder software / com
www / crowder software / com
On Oct 5, 3:52 pm, buda wrote:
> jQuery is developing very qu
Tobie,
> You'll be happy to notice that thanks to the work I did a couple of
> weeks ago[1], the globalization plugin is also available _from the
> same repo_ without any dependency on jQuery[2].
Props, man! Nice one.
-- T.J. :-)
On Oct 6, 3:37 pm, Tobie Langel wrote:
> Hey folks.
>
> You'll b
the horror that is
JavaScript's implicit globals[1], which I would STRONGLY recommend
against doing.
[1] http://blog.niftysnippets.org/2008/03/horror-of-implicit-globals.html
HTH,
--
T.J. Crowder
Independent Software Engineer
tj / crowder software / com
www / crowder software / com
On Oct 10, 4:25 a
'click' event of the
element. You can be more general and remove all click handlers from
the element:
$('foo').down('div.watchme').stopObserving('click');
...or even _more_ general and remove all handlers from all events on
the element:
$('foo
Hi again,
I probably should have mentioned in my earlier message that Prototype
1.7 (which hasn't been released yet) has built-in delegation handling
which can make the `findElement` stuff a bit shorter syntactically:
$('foo').on('click', 'div.watchme', clickHandlerFunction);
See http://api.
Hi,
You might check out 1.7RC3, it has IE9 support:
http://prototypejs.org/2010/10/12/prototype-1-7-rc3-support-for-ie9
HTH,
--
T.J. Crowder
Independent Software Engineer
tj / crowder software / com
www / crowder software / com
On Oct 9, 7:57 am, asb wrote:
> Hello,
>
> Ajax.Periodic
rototype enhancment on an un-enhanced DOM
element; details:
http://prototypejs.org/learn/extensions
HTH,
--
T.J. Crowder
Independent Software Engineer
tj / crowder software / com
www / crowder software / com
On Oct 13, 11:43 am, AshishSingh Bhatia wrote:
> Hello ,
>
> I have an applicat
:
http://jsbin.com/aboyo/2
You can condense that a bit:
http://jsbin.com/aboyo/3
HTH, apologies if I've gotten the wrong end of the stick.
--
T.J. Crowder
Independent Software Engineer
tj / crowder software / com
www / crowder software / com
On Oct 14, 1:54 am, Phil Petree wrote:
> Hey
ucks! It should have been a 2 minute find/do.
>
> Not gonna worry about the click handler because there are only 8 onclicks on
> that page and I doubt a user will use more than 1 or 2 of them... if they
> even realize those images work that way... just an easter egg is all it is.
>
&
Hi,
Are you using 1.7RC3? It has IE9-related fixes.
http://prototypejs.org/2010/10/12/prototype-1-7-rc3-support-for-ie9
HTH,
--
T.J. Crowder
Independent Software Engineer
tj / crowder software / com
www / crowder software / com
On Oct 14, 9:51 pm, Benxamin wrote:
> I inherited on some tab
s.org/2008/03/mythical-methods.html
http://blog.niftysnippets.org/2008/04/you-must-remember-this.html
HTH,
--
T.J. Crowder
Independent Software Engineer
tj / crowder software / com
www / crowder software / com
On Oct 15, 8:30 am, Tobie Langel wrote:
> Or:
>
> var element = $('so
ot;data-picker" is a real
> attribute?? or you just add it for easy use with the $('*[data-
> picker]') selector??
>
> thanks in advance
> nahum
>
> On Oct 14, 10:35 am, "T.J. Crowder" wrote:
>
>
>
> > Hi,
>
> > > Thanks
rstood the truly bizarre
and arbitrary way Google adds linebreaks to code...)
FWIW,
--
T.J. Crowder
Independent Software Engineer
tj / crowder software / com
www / crowder software / com
On Oct 15, 7:08 pm, Scott wrote:
> When copying and pasting the html from my post, there are some ext
operties and applies them to a destination
object. There's nothing tricky about it at all. The only issue I could
see would be if you tried to use it on a host-provided destination
object that doesn't allow custom properties.
FWIW,
--
T.J. Crowder
Independent Software Engineer
tj / crowde
Hi,
The problem isn't in the declaration of the properties, it's in how
you're calling the `show` function. You're calling it without ensuring
that `this` has the correct value. Details and solution here:
http://blog.niftysnippets.org/2008/04/you-must-remember-this.html
a selector. This is just to cut out
the overhead of reading and writing attributes to the underlying DOM,
and because properties can be things other than strings. In practice,
I find I have virtually no use for expando properties in my
applications (I use elements to *represent* application object
ot so bad
> practice?
On Oct 20, 1:48 pm, buda wrote:
> T.J., thanks for an exhaustive explanation!
> But, as I understud, expando properties == custom attributes and its
> not good, but I see expando on extended elements in prototype!
> Will this to migrate to storage functionality o
od idea, but it seems like an odd omission to me. I've done
a ticket in Lighthouse[1] offering to do a patch on git (for 1.7.1,
not 1.7.0) if people do want it.
[1]
https://prototype.lighthouseapp.com/projects/8886-prototype/tickets/1158-add-hashclear
FWIW,
--
T.J. Crowder
Independent S
Hi,
> I'm surprised the loop didn't work, it seems to:
> http://jsbin.com/ejeju4/2
Sorry, that link was wrong. It should be:
http://jsbin.com/ejeju4
-- T.J.
On Oct 21, 7:51 am, "T.J. Crowder" wrote:
> Hi,
>
> On Oct 21, 3:39 am, chrysanthe m wrote:
>
&g
wn" -- but I assume that that's just a
typo in this message, or you'd be seeing an exception in your
debugger.)
With these things, sometimes the issues become obvious when you step
through the code with a debugger. Might have helped here, if you did
that and saw the values fo
lick but *will* trigger `mouseup` -- like pressing down
elsewhere, the moving the mouse onto the button and releasing the
mouse button. Let's defer to the UA about when the user's actually
clicked the button.)
HTH,
--
T.J. Crowder
Independent Software Engineer
tj / crowder software / co
nt/observe/
[2] http://api.prototypejs.org/dom/event/
[3]
http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-Event-preventDefault
[4] http://api.prototypejs.org/dom/event/stop/
HTH,
--
T.J. Crowder
Independent Software Engineer
tj / crowder software / com
www / crowder software / com
On O
` object.
Here are the test files:
http://pastie.org/1240577 - the basic counter test
http://pastie.org/1240579 - keep the instances test
http://pastie.org/1240582 - don't null out array entries test
http://pastie.org/1240613 - using the one-liner `destroy` above
HTH,
--
T.J. Crowder
Indepen
have to audit the code, ensure there are no circular
references anywhere (which _will_ cause memory leaks), make sure you
don't have references being kept active by closures (you don't in your
example code, but as we've said, that was just test code), etc.
[1] http://en.wikipedi
ee Davis wrote:
> On Oct 21, 2010, at 6:32 PM, T.J. Crowder wrote:
>
> > Instead, I'd do it in the obvious place: The form submit event:
> >http://jsbin.com/aniro4/3Or you could do it on the `click` event of
> > the button:http://jsbin.com/aniro4/4(I wouldn't use
s programhttp://home.orange.nl/jsrosman/to see the
> memory and the DOM elements used and you'll see how after the destroy
> 1 node is released, the node for the "testDiv" variable.
>
> So, why is deleting this variable and not the array? it sounds very
> strange
ccording to the spec, and I know it does for other things, but I
think some significant implementation has an issue with generating the
call without clarifying it as with the parens above.
Happy coding,
--
T.J. Crowder
Independent Software Engineer
tj / crowder software / com
www / crowder software
owStatMsgAndStopHandler` in a place you're defining other
generally-useful stuff, the only closures in the rewrite are generated
in the well-controlled scope of Function#curry. So we're not keeping
stuff in memory we don't need.
[1] http://blog.niftysnippets.org/2010/03/anonymous
Hi,
> Do you have any idea why is this happening?
Well, assuming it _is_ actually happening as opposed to being a
measurement error, I'm afraid not. The thing (again) that I'm not sure
Jose was really clear on was that memory will NOT be freed immediately
just because you stopped referencing it,
More here:
http://blog.niftysnippets.org/2008/04/you-must-remember-this.html
http://api.prototypejs.org/language/function/prototype/bind/
HTH,
--
T.J. Crowder
Independent Software Engineer
tj / crowder software / com
www / crowder software / com
On Nov 1, 8:14 pm, laurent barre wrote:
> Hi,
>
p your page, but every
page in every tab. (And most of the others aren't much better,
partially because they basically *can't* be -- if you have any other
JavaScript on the page, they *have* to completely lock it up during a
synchronous request.) It's a Bad Thing(tm), hence my not tal
"): "Properties of the object being enumerated may be
deleted during enumeration."
[1] http://www.ecma-international.org/publications/standards/Ecma-262.htm
HTH,
--
T.J. Crowder
Independent Software Engineer
tj / crowder software / com
www / crowder software / com
On Nov 5, 9:
the authors of
the other software to fix their `for..in` loops, because Prototype
adds a lot of functions to the `Array.prototype` and that's why you're
seeing functions in the result. (Again, details in the link above.)
HTH,
--
T.J. Crowder
Independent Software Engineer
tj / crowder sof
firstname: "Joe",
lastname: "Bloggs"
});
(Example: http://jsbin.com/axuzo3)
The regex plus the loop are what make that happen, both the subscript
notation (the first one) and the dotted notation (the second one). I
think it only works one level deep with the bracketed
sh` object (instead of its published API), I'm afraid you'll
have to rewrite it to use the API instead (as internals can change
from a dot rev to a dot rev without notice).
FWIW,
--
T.J. Crowder
Independent Software Engineer
tj / crowder software / com
www / crowder software / com
On Nov 7, 8:10
value just as you would any other value:
$request = $_POST["json"];
$requestObject = Zend_Json::decode($request); // Or your
$zendJson, whatever that is
But again, I'm not a PHP guy and could easily be missing something
important here.
FWIW,
--
T.J. Crowder
Indepe
/Global_Objects/encodeURI
https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/encodeURIComponent
HTH,
-- T.J. :-)
On Nov 8, 9:42 pm, "T.J. Crowder" wrote:
> Hi,
>
> I don't know that it's the problem because I'm not a PHP person, but
> you're
:
>
>
>
>
>
>
>
> > Right. The best low-level way to translate JS to PHP and back again is
> > using encodeURI or uncodeURIComponent on your JS side, and
> > rawurldecode() or rawurlencode() on the PHP side. They are
> > functionally identical, as long
up to you).
This is what I've suggested that you haven't, as far as I can tell,
tried:
On Nov 8, 9:42 pm, "T.J. Crowder" wrote:
>
> The most reliable way to send parameters that I know is to send them
> URL-encoded, and to decode them as URL-encoded data. In Prototy
Hi,
It's T.J., not J.
> i want convert requestObject in JSON string and send to the server.
>
> var jsonRequest =
> encodeURIComponent(JSON.stringify(requestObject));
> new Ajax.Request(baseUrl + '/usermsg/index/sendmessage', {
> method: 'POST',
> requestHeade
Can you post a complete, self-contained, minimalist test page[1]
(perhaps to Pastie.org or even JSBin.com) demonstrating the problem?
[1] http://proto-scripty.wikidot.com/self-contained-test-page
--
T.J. Crowder
Independent Software Engineer
tj / crowder software / com
www / crowder software
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?
>
> stats here:http://mashable.com/2010/06/01/ie6-below-5-percent/
As is frequently the case, it's more complicated than that. :-)
StatCounter may say less than
the DOM
and JavaScript layers can cause memory leaks on IE.
[1] http://msdn.microsoft.com/en-us/library/ms533747(VS.85).aspx
[2] http://prototypejs.org/learn/extensions
Happy coding,
--
T.J. Crowder
Independent Software Engineer
tj / crowder software / com
www / crowder software / com
On Nov 21
threaded unless you
explicitly
// use the web workers stuff, which we aren't.
callback();
}
}
}
[1] http://www.stevesouders.com/blog/2008/03/20/roundup-on-parallel-connections/
HTH,
--
T.J. Crowder
Independent Software Engineer
tj / crowder software / com
www
in this updated
example[2]. Also worth using a tool like Firebug or Chrome's Dev
Tools, etc., to look at the HTTP response. Is it being served with the
right content type? (Although I'm not sure how much Ajax.Updater
cares.)
[1] http://jsbin.com/ukasi3/2
[2] http://jsbin.com/ukasi3/3
HTH,
fficient externs, you should be able to compile your _own_ code
with advanced optimizations while still using Prototype &
script.aculo.us, and you could combine the result into a single file
to minimize HTTP requests.
FWIW.
--
T.J. Crowder
Independent Software Engineer
tj / crowder softwar
know. Can you give it a try? Sounds like it _may_ be a bug in
Prototype in that specific situation, with that specific browser. A
simple, standalone test case is the first step to getting that
resolved.
--
T.J. Crowder
Independent Software Engineer
tj / crowder software / com
www / crowder software
-supercalls-in.html
Happy coding,
--
T.J. Crowder
Independent Software Engineer
tj / crowder software / com
www / crowder software / com
On Nov 29, 4:45 pm, Luke wrote:
> Thanks. Fermion in the Prototype-IRC also told me the same thing. But
> he said you cannot access the parent's propert
?
>
> Would that be better to use for performance critical apps instead of the
> $super argument?
>
> On Mon, Nov 29, 2010 at 8:03 PM, T.J. Crowder wrote:
>
>
>
>
>
>
>
> > Hi,
>
> > From within a call to `SectionText`'s `extension` function, you
b/master/CHANGELOG
[2] https://github.com/madrobby/scriptaculous/blob/master/CHANGELOG
HTH,
--
T.J. Crowder
Independent Software Engineer
tj / crowder software / com
www / crowder software / com
On Nov 30, 4:33 pm, robsan wrote:
> Hi my name is Robin and I am developing for a quit big site which is
> ru
inimalist, self-contained test page demonstrating the
problem. 90% of the time (at least), just the process of doing that
helps you find the answer; the other 10%, you have something you can
post so people can help you out.
HTH,
--
T.J. Crowder
Independent Software Engineer
tj / crowder software / co
to actually call the `callbackResponse` passed into
it (http://jsbin.com/asate3/3), it succeeds in calling that (including
on IE7) and then fails (of course) to call the non-existant function
callbackResponse_1.
Nothing whatsoever to do with XMLHttpRequest. Or Prototype.
Am I missing something?
--
T.J.
be able to help you. I don't think the fact
it's JSP has anything to do with it (unless, of course, the JSP isn't
outputting the HTML you expect -- but that's nothing to do with
Prototype).
> Any other suggestion?
Just to create a self-contained example and post it some
ed in a
CSS selector. Strongly recommend sticking to the CSS ID rules when
selecting HTML element IDs for elements you're later going to
manipulate via a JavaScript library.
HTH,
--
T.J. Crowder
Independent Software Engineer
tj / crowder software / com
www / crowder software / com
On Dec 2,
> some form controls (radio, checkbox, maybe others...) have a native
> click() method that toggles them, so that would be in conflict...
Nice one, *exactly* why this sort of thing is not generally a good
idea. Create a utility class to do it, etc., but putting them on the
actual elements is askin
quot;child" is "children", not
"childs". Although most English nouns are made plural by adding an "s"
or "es" or even "ses", quite a number of them are done differently.)
Hope this helps,
--
T.J. Crowder
Independent Software Engineer
tj / crowd
od reason to do the
function expression (`var discardAll = function`...), use a function
declaration instead (`function discardAll`...), as here:
http://jsbin.com/awiqi4/2
But it doesn't matter for the problem you've outlined, unless the code
is in a different order than shown.
FWIW,
--
ition,
it's *possible* to add non-enumerable properties to `Object.prototype`
using special syntax, but I still wouldn't do it.)
HTH,
--
T.J. Crowder
Independent Software Engineer
tj / crowder software / com
www / crowder software / com
On Dec 11, 12:07 am, Luke wrote:
> H
name: 'a'
};
var b = Object.clone(a);
b.name = 'b';
a.func();
b.func();
display("a.func === b.func? " + (a.func === b.func));
* * * *
http://jsbin.com/abeqe3
HTH,
--
T.J. Crowder
Independent Software Engineer
tj / crowder software / com
www / crowder softw
m instanceof MyCoolClass));
display("m.x = " + m.x);
var c = m.clone();
display("c instanceof MyCoolClass? " + (m instanceof MyCoolClass));
display("c.x = " + c.x);
* * * *
http://jsbin.com/oqoxe5
HTH,
--
T.J. Crowder
Independent Software Engineer
tj / crowder soft
y know the answer to certain aspects of the question, but
we were all new once, we all have limited time to read things, and we
don't all learn perfectly reading general texts; sometimes we need our
specific question answered in order to understand a broader concept.
--
T.J. Crowder
Independent So
> with, and stop before it gets extended twice. But I'll think I'll
> define the classname as a property in the class itself then, and maybe
> throw an error if the classname has not been set.
>
> On Dec 17, 3:08 pm, "T.J. Crowder" wrote:
>
>
>
>
>
&
forgetting to stop
them...
FWIW,
--
T.J. Crowder
Independent Software Engineer
tj / crowder software / com
www / crowder software / com
On Dec 17, 10:20 pm, JoJo wrote:
> What's the best way to find which iteration the PeriodicalExecutuer is
> currently on? What I'm trying to do is
veAll(['keyup', 'click', 'focus', 'blur'],
function(evt) {
this.fire('check:filter');
});
// Or:
$('filter').observeAll('keyup click focus blur', function(evt) {
this.fire('check:filter');
});
// Or even:
var filter = $(
jsbin.com/ukifo3
Works with IE6, IE7, Firefox, Opera, Chrome...
FWIW,
--
T.J. Crowder
Independent Software Engineer
tj / crowder software / com
www / crowder software / com
On Dec 22, 9:51 pm, kstubs wrote:
> OK, just observing click event for the submit button is working fine.
--
It doesn't seem to be a Prototype-specific thing. `getComputedStyle`
is just not giving back that information: http://jsbin.com/uyifa4
Except on Opera. It works on Opera.
V. weird.
FWIW,
--
T.J. Crowder
Independent Software Engineer
tj / crowder software / com
www / crowder software / co
Doh! Not all that weird, I'd forgotten that `border-size` is a
shorthand property!
Works with full names: http://jsbin.com/uyifa4/2
Nice one, Walter!
-- T.J.
On Dec 23, 5:45 pm, "T.J. Crowder" wrote:
> It doesn't seem to be a Prototype-specific thing. `getComputedStyl
don't have names at all and so are not
sent to Google.
--
T.J. Crowder
Independent Software Engineer
tj / crowder software / com
www / crowder software / com
On Dec 24, 3:51 am, kstubs wrote:
> T.J., Duhh! Thanks for pointing out the obvious. I was stuck on observing
> "submit
ut there's no reason to bind
the function, you're already effectively doing that in your first
example.
So the first example is correct, but apparently there's some problem
in the surrounding code; you'll have to show us that.
[Super-freaky bracing style. :-)]
HTH,
--
T.J
nction Singleton_bar() {
// ...
}
return pubs;
})();
Usage:
Singleton.foo(...);
Singleton.bar(...);
...but somehow I don't think that's what you have in mind.
FWIW (little, I'm thinking),
--
T.J. Crowder
Independent Software Engineer
tj / crowder software / com
www / crowder
> why do not you like the anonymous function?
Because I like to help my tools help me:
http://blog.niftysnippets.org/2010/03/anonymouses-anonymous.html
-- T.J. :-)
On Dec 25, 8:26 pm, buda wrote:
> why do not you like the anonymous function?
>
> On 25 дек, 00:42, "T.J
Hi,
Based on that code, the `this` value in `_msoSGrid.load` definitely
refers to `_msoSGrid`. What makes you think the context during the
call is wrong? I'd say there's an issue with the actual `load`
function, because the call to it is absolutely fine.
-- T.J.
On Dec 25, 3:00 am, kstubs wrot
be
undefined (because the div doesn't exist yet), that's all that
`bindAsEventListener` will see.
Your updated code:
document.observe(
'MeetQuery:lookup_scores',
function(event) {
_msoRSess.appear($('SCORES').down('div.grid table'));
}
);
...doesn't d
What does your actual Ajax.Request code look like?
--
T.J. Crowder
Independent Software Engineer
tj / crowder software / com
www / crowder software / com
On Jan 2, 5:40 am, kstubs wrote:
> I'm passing a parameter string to parameter: of the Ajax.Request object. My
> string looks like
I've never had to do the above in the
real world. Perhaps someone with real-world experience will chime in,
and if they do, they're likely to have higher-quality information.
[1] http://developer.yahoo.com/performance/rules.html
[2] http://code.google.com/speed/articles/web-metrics.html
H
er. The string you provide the
actual one used.
HTH,
--
T.J. Crowder
Independent Software Engineer
tj / crowder software / com
www / crowder software / com
On Jan 2, 4:09 pm, kstubs wrote:
> Hi TJ, I've spent this morning walking through the code and have determined
> that p
it as "Sr%2016%2b" (which is perfectly correct) rather than
using the + instead of %20. (`encodeURIComponent` will give the the
%20 version.) The decoded string is the same.
Here's my test page: http://pastie.org/1428234 (but without the
showparams.jsp it calls, not sure how much it'
Hi,
> Afaik a JSON-Object (or string) must be wrapped in {}. What you have is an
> array (your string's wrapped with [ ]). Try:
No, that's fine. Both object and array are valid top-level objects:
http://json.org/
--
T.J. Crowder
Independent Software Engineer
tj / crowder so
and uses `eval` under-
the-covers. If you're not comfortable with that, you can use
`json_parse.js` or `json_parse_state.js`, neither of which uses
`eval`. The former is a recursive-descent parser, the latter is a
state machine.
HTH,
--
T.J. Crowder
Independent Software Engineer
tj / crowder soft
> The link provided at the
> bottom of the main pagehttp://www.prototypejs.org/for the "MIT
> (source code)" does not work.
Well, that's not good.
In any case, you can find the license with the source code:
https://github.com/sstephenson/prototype/blob/master/LICE
n't, it keeps using its prototype's property (if
any).
The thing with your `intro` property is that nothing is ever assigned
to it, and so no instance had its own `intro` property, and they were
all falling back on the one on `Parent.prototype`. All you ever did in
the `ChildA` and
with `A`'s loop.
Corrected:
function B()
{
var i; // <== The new bit
for(i=0;ihttp://blog.niftysnippets.org/2008/03/horror-of-implicit-globals.html
[2] http://blog.niftysnippets.org/2008/03/poor-misunderstood-var.html
HTH,
--
T.J. Crowder
Independent Software Engineer
tj / cro
t to
mention the complications around `this`) just to loop through an
array. People are free to do that if they like, but it's not remotely
necessary and it's certainly not always appropriate. There's nothing
wrong with a nice, simple `for` loop.
Just my two cents.
--
T.J. Crowder
I
at will
completely lock up the UI of the browser (not just your page, the
entire browser) during the time your ajax call is being processed.
Locking up the UI for 1-30 seconds is a Bad Thing(tm). :-)
[1] http://api.prototypejs.org/ajax/
HTH,
--
T.J. Crowder
Independent Software Engineer
tj / crowde
Simple Controls Gallery code suggests that it's
noConflict-compatible and it doesn't have any `for..in` loops, so if
you add `noConflict` after loading jQuery and before loading
Prototype, you should be okay. E.g.:
jQuery.noConflict();
HTH,
--
T.J. Crowder
Independent Software E
list.indexOf(targetElement);
if (index >= 0) {
++index;
nextElement = list[index >= list.length ? 0 : index];
}
Prototype adds `Array#indexOf` to implementations that don't have it
natively.
[1] http://api.prototypejs.org/language/Array/prototype/indexOf/
HTH,
--
T.J. Crowder
major version aligns with ECMAScript5). It's easily done. :-)
HTH,
--
T.J. Crowder
Independent Software Engineer
tj / crowder software / com
www / crowder software / com
On Feb 1, 11:51 am, Bertilo Wennergren wrote:
> On Tue, Feb 1, 2011 at 12:35, T.J. Crowder wrote:
> > (now that `
ate(times[i]);
yourSelectBox.insert(o);
(Live example: http://jsbin.com/usatu4) ...but on IE6 that worked in
that the elements were added to the drop-down, but the drop-down's
width wasn't recalculated.
HTH,
--
T.J. Crowder
Independent Software Engineer
tj / crowder software / com
www / crow
601 - 700 of 1586 matches
Mail list logo