Hi All,
First of all I would like to thanks every one to provide with
such a nice repository of JavaScripts. I've recently downloaded your
package and am using it for the first time.
I am facing an issue though. I've a JavaScript based countdown timer
in a .js file. This .js file is
Hi,
no String.insert method?
Correct, `String` doesn't intrinsically have an `insert` method.
Is this the best way? I don't really like it..
Pretty much, except that `substr` is not part of the standard (though
it's widely-supported, and it's noted in Appendix B, which is a non-
@Gregory:
It's in 1.7. The current docs seem to have it:
http://api.prototypejs.org/dom/element/store/
Before too long, some nice stuff Tobie's been doing will go live and
it'll be easier to refer to the docs for the specific version you're
using.
--
T.J. Crowder
Independent Software Consultant
Hi,
The issue is as soon as I add a script tag referring to the
prototype.js file, my countdown timer stops working.
You'll have to give us more information to work with, stops working
is pretty vague.
There could be any number of reasons for this. Two high-probability
ones that come to mind:
Hi TJ,
Very interesting-- Could you please explain what benefit you get from
doing a closure in this context?
if (!String.prototype.insert) {
(function() {
String.prototype.insert = String_insert;
I mean, from what I can tell there isn't that could interfere
with anything
Hi Patrick,
Very interesting-- Could you please explain what benefit you get from
doing a closure in this context?
Namespacing, so I can use a named function instead of an anonymous one
without polluting the parent (perhaps global) namespace. More here:
What an incredibly helpful and in-depth answer. Thank you TJC, my
confidence is restored
foob
On May 21, 3:18 pm, T.J. Crowder t...@crowdersoftware.com wrote:
Hi,
It's best to actually paste in the code you're having trouble with;
for obvious reasons, a lot of people won't follow links, and