@# Quotes DB     useful, funny, interesting





Google
 
Web www.quotesdb.info
Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Dalnet  |  Ircnet  |  Galaxynet
Page: 1 2 3 4 5 6 7



Comments:

<0> but if aaa is there, i don't want it to match anything
<1> aa[^a]*$
<1> or
<2> steveire you could make sure a isnt allowed in the char cl***es before and after
<1> more correctly: ^[^a]*aa[^a]*$
<0> Thanks, I'll give it a shot.
<2> btw a(?!a) is pretty silly, the look-behind will always match if the a matches before it
<0> don't think that worked Dewi
<0> Raevel: How would I do that with the char cl***es?
<1> it's not exactly an elegant solution, but it should work
<1> perhaps you should just match one and then filter the other
<2> steve_ [^a] is a char cl***
<2> steveire it depends if that is your whole pattern or not
<2> gotcha!
<2> here's a neat way of converting any object to an array: Array.prototype.splice.call({ 0 : "a", 1 : "b", length : 2 }, 0) // => ["a", "b"]



<1> my JS is nowhere near that good. :P
<1> but it does look nifty
<0> ah. Well, I might make a filter so, for the moment at least. I would prefer a working regex though.
<0> And that is my whole pattern
<2> steveire or you could just negate the result
<2> steveire if (!/aaa/.test(str)) { /* does not contain 'aaa' */ }
<0> Raevel: I was going to th=
<0> nuts. to do that, but didn't know how
<0> I think what I really need is food. Later...
<1> does JS allow you to run a piece of code over all matches? Like .NET and perl do?
<3> Yes.
<1> because then the most efficient way might be to match 'aaa' but then vet it in the handler function
<3> .replace(/pattern/, function () { ... })
<3> The function should return whatever you want the replacement to be.
<3> You'll have to do some research on it to figure out what arguments are p***ed, since I can't remember offhand.
<2> aw crap, my splice call doesnt work on HTMLCollections :/
<2> appearantly splice tries to set some value, i have no clue why that would be useful
<3> Did you tell it to set a value?
<2> me? no, it does so by itself it seems
<3> Ah.
<2> this breaks
<2> Array.prototype.splice.call(document.getElementsByTagName("*"), 0)
<3> jseval: var foo = [1, 2, 4]; foo.splice(2, 0, 3)
<4> Aankhen``: Return:
<3> jseval: var foo = [1, 2, 4]; foo.splice(2, 0, 3); foo
<4> Aankhen``: Return: 1,2,3,4
<2> oh, i forgot about that
<3> jseval: var foo = [1, 2, 4]; foo.splice(2, 1); foo
<4> Aankhen``: Return: 1,2
<2> i dont p*** the 3rd param though
<3> jseval: var foo = [1, 2, 4]; foo.splice(2); foo
<4> Aankhen``: Return: 1,2
<2> jseval: Array.prototype.splice.call({ 0 : "a", 1 : "b", length : 2 }, 0)
<3> jseval: var foo = [1, 2, 4]; foo.splice(1); foo
<4> Raevel: Return: a,b
<4> Aankhen``: Return: 1
<3> Hmm.
<3> The collection returned doesn't have the splice() method?
<2> HTMLCollections don't
<3> Ah.
<3> Then how would splice() work on it?
<2> well, it works on my custom Object as you can see above :)
<2> all it needs is enumerated properties and a length property
<3> jseval: (var foo = { 0: "a", 1: "b", length: 2 }).splice(0); foo
<4> Aankhen``: Error: Error: SyntaxError: syntax error at line 0: (var foo = { 0: "a", 1: "b", length: 2 }).splice(0); foo
<3> jseval: var foo = { 0: "a", 1: "b", length: 2 }; foo.splice(0); foo
<4> Aankhen``: Error: Error: TypeError: foo.splice is not a function at line 0: (null)
<3> Interesting.
<5> ehm, disconnected
<5> i was wondering why buubot didnt answer :)
<5> jseval: Array.prototype.concat.call({ 0 : "a", 1 : "b", length : 2 }, [])
<4> Raevels: Return: [object Object]
<5> => [["a", "b"]] actually
<5> so... not quite, but i suppose this will work
<5> jseval: Array.prototype.concat.call({ 0 : "a", 1 : "b", length : 2 }, [])[0]
<4> Raevels: Return: [object Object]
<3> So HTMLCollection only has .length, .item() and .namedItem().
<5> man, why dont that work
<5> maybe it is firebug that's screwing me up
<3> Why doesn't what work?
<3> jseval: (Array.prototype.concat.call({ 0 : "a", 1 : "b", length : 2 }, [])).toSource()



<4> Aankhen``: Return: [{0:"a", 1:"b", length:2}]
<5> but:
<5> jseval: (Array.prototype.concat.call({ 0 : "a", 1 : "b", length : 2 }, [])).splice
<4> Raevels: Return: "function splice() { [native code]}"
<5> how wierd is that
<3> Heh.
<5> oh, wait.. that wasnt what i meant
<5> n/m
<5> you eventually go crazy, poking around w/ this stuff
<3> It happened to me a long time ago.
<5> it also doesnt help that firebug is "helpful" by making htmlcollections look like arrays in the console output :)
<3> It probably just calls .toString().
<5> s/String/Source/ probably
<5> well no, htmlcollections dont have either
<5> s/dont have either/dont give helpful values/
<5> im gonna stop now.
<0> Dewi: I think you were on to something there with the vetting
<5> btw, Aankhen``, i just wrote http://js.edea.se/raevent_test.php - no more eventListeners :)
<6> hello. I have an html form with some name="foo[bar]" , how can I access this through JavaScript? seems that document.formName.foo[bar].value doesn't work ?
<2> obj.prop is the same as doing obj["prop"]
<6> ahh
<6> but I only manage to change the value through elements[number] where number is an integer
<7> Forms don't need names
<7> Only inputs do
<6> b0at: and what if I have more than one form with same fields ?
<7> What if you do? So?
<2> sylow use the id attribute instead
<6> ok Raevel I'll try that
<2> www.edea.se/articles/accessing_forms_done_right
<6> all right, of course.. thanks Raevel
<6> Instead of trying to access the name="foo[bar]" , id="foo_bar" works fine
<6> interesting article, I've bookmarked it and read it for sure :)
<6> back to work again now, cya
<2> not that that was my point... but anyways :)
<8> if window.open open a new window how do I navigate to a new address ?
<9> try var yourWindow = window.open( ... ); yourWindow.location.href = 'http://new.address.com';
<8> thank you
<10> morning
<11> hello. which property could i use instead of clientTop and clientLeft?
<10> can someone help me to load 25 image files into an array ?
<10> does the syntax $test = "hallo".$vartest."end"; is ok ??
<11> defbyte: javascript don't work with files, afair :)
<7> NOt from a browser, but with the right api it can
<11> how can i determine coordinates of DOM element?
<10> voidus: i just want to load 25 Image objects into an array and set the .src propertie to the file to load (file1-file25)
<10> and that is no big deal with js
<11> yes. it's simple..
<11> all you need is file names..
<10> voidus: thank you for nothing ... i've done it allready
<11> )
<10> why do i get only the first alert box ?? http://rafb.net/paste/results/HR6wTp27.html
<4> The paste HR6wTp27 has been moved to http://erxz.com/pb/1818
<10> voidus: can't you take a short look and help me (i'm new to javascript, but i'm programming for 8 years now)
<10> i have a loop for(var i=0; i<25; i++) { alert("hh");} but i get only one messagebox :(
<11> remove "var"
<12> no, var is fine
<12> defbyte: you realize you can only have one alert at a time right?
<12> alert halts all processing until the user clicks Ok
<11> anyway, i am not a js programmer... sorry if i am wrong)
<11> defbyte: $cards.push(tmp); <-- wrong line, i guess
<12> that's a problem so is line 14
<12> it's 'new Array()'
<12> not ARRAY
<11> frb: maybe you know how can i determine coordinates of DOM-element?
<12> then remove the $ on line 23
<12> voidus: offsetHeight Width Top Left
<10> thank you guys !
<11> frb: big thanks
<10> does someone here know a good javascript tutorial ?
<10> !v hm ?
<13> HTML: Unable to validate hm ?: You need to supply a URI scheme (e.g http)
<13> CSS: Valid - http://jigsaw.w3.org/css-validator/validator?uri=hm ?


Name:

Comments:

Please enter the result of the sum 63 + 46 (to avoid spam):






Return to #javascript
or
Go to some related logs:

#php
gentoo digest recalculate
revdep-rebuild is not a valid package atom
you just don't get you keep it copasetic
xlib6g ubuntu
#debian
ext3-fs error in ext3_setattr
sudores ubuntu
#suse
#linux



Home  |  disclaimer  |  contact  |  submit quotes