@# Quotes DB     useful, funny, interesting





Google
 
Web www.quotesdb.info
Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Dalnet  |  Ircnet  |  Galaxynet
Page: 1 2



Comments:

<0> hi, I know there is a way to read the value of tabindex using js, but is there a way to quickly get a handle on the next field (next tabindex) without looping thru all of the elements to find the good one
<1> no quick way
<0> ok Ill look then ;) Thanks
<0> I'll loop I mean
<1> I can think of create an event for tab key, and wait for onfocus fired on the next control
<0> it would be too late for my need, but thanks anyway, I'll just build an array in the proper order and loop in it :(
<2> Heelo
<2> i need help with google maps
<2> someone?
<3> Really quick question, I hope: Can anyone point me to a page that shows how to start an infinite loop of calling an JS function (it makes an AJAX request)?
<4> ht311, see this? http://www.metafilter.com/mefi/53415
<1> yeah, saw the releases, haven't try it yet
<1> tried the japanese cookbook, pretty cool
<1> starfox just come out
<0> Hi, I have a couple fields named "foo[]", I can find how Many I have using this: document.getElementsByName('foo[]').length; Is there a way to loop in them easily so I can retrieve the values ? I tried document.getElementsByName('foo[0]').value but it doesnt work... any Idea ?
<1> document.getElementsByName('foo[]')[0]



<1> or document.myform.elements['foo[]'][0]
<0> wow what a strange syntax :)
<0> Thanks that works
<1> because you use a strange [] in the name for ****y php
<1> and nothing strange beside that. [0] is just getting the element 0 in the collection
<0> I see you don't like php :) heeheh how does perl or others handle arrays ?
<1> as long as it is same name, it will be an array
<1> no [] needed
<0> ah ok :)
<1> see how strange php is?
<0> yes, weird, don't know why they force the [] syntax
<5> i'm looking for a way to implement a pause() function in javascript that doesn't involve a loop that makes the CPU spike to 100%
<6> setTimeout
<5> i was thinking of maybe doing some operation that waits for a reply towards a PHP server where i can do a controlled timeout, anyone aware of a function in javascript that i could use for that?
<5> is it a syncronus event?
<6> There is no pause, but you can do pretty much the same with setTimeout.
<6> You just have to plan a bit differently.
<5> .... like in, making everything some sort of recursive function that checks if the previous code has completed?
<6> Sounds a bit anal heh.
<5> that's what you had in mind too?
<6> No.
<5> luckily :)
<6> Run things in sequence (in functions) and call the next "function set" with setTimeout
<5> so as in, run funct1() at the end of it's code call funct2, ect ect? cus i can do that without setTimeout too
<5> but i suppose i'm misunderstanding you
<6> Yes, but setTimeout gives you a delay. Your pause.
<5> ah yes, i see, i didn't explain my situation enough :P i wanted the pause cus i wanted to do this: funct1(); -> includes js in the page, and want to wait till the included script is done running; funct2() -> needs to wait for the ***yncronous inserted code to complete
<5> hmm.. but i could still use your solution tho i suppose
<5> ah yes, i think i see, just set timeout, call an empty function, and have it return to the main code
<5> hmm... no :P crap, that will just return and ***yncronously run the empty function
<7> got dc
<7> but, that sollution would mean chaining all my functions together, in stead of calling them one by one in the main file
<6> So it would.
<7> ok :) just wanted to get that clear
<7> hmm, what do you think of the involving PHP sollution?
<5> like... insert an img, and make the source a php file, make php pause and after x ms return the header to an empty image
<5> somthing like that
<5> no, that specific example won't work, cus the image is loaded in the background, but you get the general idea
<5> or there just aren't any functions in JS that will "wait" for anything and that's the whole idea of the script aspect? :)
<8> hello, how could i position a div always on bottom even when i scroll the page?
<6> Find the height of the viewport, find how far down you've scrolled and change the div's position accordingly.
<8> k
<8> document.body.scrollTop ?
<5> ^voLdo-: yep
<8> just grabbed a script from dynamicdrive and see how they did it
<8> :D
<8> so the there are different ways in getting the viewport height after all
<8> differs in nn and ie
<8> weird tho..
<8> innerHeight and document.body.clientHeight
<8> gives me different stuff
<5> document.body.clientHeight works in IE and FF and NS, no?
<8> but if you use the same thing in both they give you different answers
<5> oh... this might be causing that, this is how IE implemented it:
<5> Retrieves the width of the object including padding, but not including margin, border, or scroll bar.
<5> well, for clientWidth that is :P
<5> FF probebly does it slightly different, but it's less documented, not sure you'll find how they do it
<5> but you probebly just have to add the margin, border or scroll bar to it
<6> TheUndefined: Are you working in standards compliance mode?



<5> ^voLdo-'s having the problem
<5> i'm guessing he's in quirk mode
<8> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">;
<5> ah
<8> well?
<8> i dont knw what this is
<8> hehe
<5> like i do, let Pilum figuer it out, he's the local guru :P
<8> hehe
<6> That's a document type declaration, and is required to get the browser into standards compliance rendering mode.
<8> what mode is it?
<5> standards compliance
<6> The mode you would want.
<5> so the mode your in influences how javascript is processed?
<5> well, too, aside from HTML
<9> hello, I want to change this script but I do not understand it very well and I think it is not very well conceived. I would like to change it to start crooling automatically onload withought any click on the scroolbar and to come up, scrooling up back, when the page scrolls totally down. www.anadrago.com
<6> TheUndefined: It influences how height, width, margin, padding and borders works.
<8> oh!
<6> jumikan: Very bad indeed.
<9> yeah, quite experimental
<6> And the html is full of outdated and badly formed code.
<9> yeah, I am still learning
<6> You should find some tutorials which aren't over 10 years old then I think.
<9> can I use onLoad to start it scrolling?
<6> Yes.
<8> so Pilum, how would i standardize the height, with, margin, padding, border calculation in ie and ne?
<8> ie and nn
<9> what's the difference between window and document?
<9> we never use ; in js ?
<5> jumikan: http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/objects.asp
<5> you can look up the difference and other information on any object there
<9> we never use ; in js ?
<5> it's bad practice not to
<9> so you can use it.. hmm
<5> but you -could- not do it in most cases without running into problems
<8> i cant get the viewport height in ie
<8> its just returning the height of the document
<8> document.documentElement.clientHeight ?
<5> document.body.clientHeight
<8> document.documentElement.clientHeight gave me the right answer =)
<8> for ie
<8> and innerHeight for NE
<9> does window.scroll(var_x,var_y) work in most browsers?
<9> how to use window.onload= to start the script?
<5> jumikan: http://javascript.about.com/library/blonload.htm
<9> what's the difference of puuting js inside head or inside body of the html page?
<4> none
<4> but as a convention it is usually best to put it in the head
<10> furtive, are you sure about that?
<4> absolutely
<10> arf sorry sorry
<10> read too quickly
<10> yeah definitively better
<10> i thought jumikan meant the best between the script in the head or in a separate file
<4> best to put it in a separate file
<10> that's why I was surprised by your answer :)
<4> that way it can be cached and less for client to download if it's reused
<9> if i have two scripts in a html page and they do not have any timeline does it matter I put one first and the other one second? or the order does not matter?
<4> no need to be surprised, just in awe ;-)
<4> jumikan: shouldn't matter
<4> i gotta go to work, ciao
<10> +
<9> what is the timeline?
<5> what do you mean with that?
<5> the order the code is executed?
<9> yes
<9> is there anything like Basic goto ?
<6> Function calls.
<5> jumikan: maybe reading a small site introducing you to the basics of javascript first might help you? would you like a link?
<9> it's ok TheUndefined
<9> does the function call has to be in the same file as the function definition?
<10> no
<9> how do would you seperate them, then?
<6> Huh?


Name:

Comments:

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






Return to #javascript
or
Go to some related logs:

#chatzone
#MissKitten
#MissKitten
#linux
#MissKitten
#linuxhelp
#php
schrimp and the barbie
#c++
#AllNiteCafe



Home  |  disclaimer  |  contact  |  submit quotes