| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
Comments:
<0> black_Nightmare, of course it's possible, bad for bookmarks, bad for search engines <1> as bad as some news site using robot.txt and refusing to allow their articles searchable :p <1> basically in a word..I don't see why not <1> heh as if that <2> i'm having trouble with setTimeout <2> it seems to be returning immediately instead of waiting until the timeout to return <3> tlhiv, that's how it works <3> tlhiv, it's nonblocking <2> hmmm ... i still can't get this timer to work <3> tlhiv, your *callback* will be executed when the timeout expires <2> i'm doing something simple now <3> tlhiv, setTimer(function (){ alert("hello! " + DateTime.now)}, 2000) <2> just trying to place a 1...2...3...4... in a textbox by using setTimout in a loop from 1 to 10 <3> err, setInterval <2> can i make it stop once it reaches 10? <3> var i = 0; var timer = setInteval(function () { i++; if (i <= 10) { alert(i) } else { clearInterval(timer) }}, 1000)
<3> note the use of a closure <2> clearInterval ... that's what i seem to need <4> pstickne, so "anonymous function" would be an ok description of a "closure" ? <3> stelt, only if it binds to one or more lexical (local) variables <2> pstickne: once i reach 10, i want to pause for 5 seconds then count back down to 0 <3> function () { alert("1") } //not a closure <3> tlhiv, make some different discreet functions say, countup, countdown, and pause <2> yeah ... but the pause is what i don't know about <2> it's the same old thing ... no wait/sleep function in JS <3> function pause () { var timer = setInterval(function () {clearInterval(timer); countdown}, 5000) } <3> oops <3> countdown() <3> function countdown/countup could look very similar to my first example <3> you could also chain all of these together using function parameters <3> tlhiv, you need to remember that setInterval's first invocation is _after_ the time duration so for countdown/countup you might want to do something before the second is up <3> tlhiv, otherwise the pause will seem like 6 seconds and it'll take a second to start the countup <5> hey there <3> function startcountup (from, to, fn) { var i = from; fn(i); var timer = setInterval(function () {i++; if (i <= to) { fn(i) } else { clearInterval(timer) }}, 1000) } <5> I've created a little color hex converter, but in Firefox it converts to RGB, and in IE it converts to HEX <3> then call: startcountup(1,10, function (i) { alert(i) }) <5> it's at http://www.unitorganizer.com/download/hexcodecalculator.html if anyone will take a look at it <5> I need to figure out how to line the colors up properly <3> dwees, what's wrong with that? <5> well I guess its okay, but it kind of goes in and out of blue <5> I've made the divs a bit wider so they are easier to see <3> rainbows are rainbows. it's just how you're defining your color layout <5> it's weird to me how Firefox switches the original hex colors to RGB mode <3> ? <5> do you have IE and Firefox installed? <3> no IE <5> check it out in both <5> aah <5> in IE it shows hex values, Firefox shows RGB <6> can I see cookies real-time in IE ? <3> dwees, in the changing display? <5> yeah <3> ks, document.cookies or something. <3> ks, it's in the DOM specs IIRC, see the moz dom reference <5> also I need to create a larger div with all of the colors inside it, and when you onMouseOut of that div it should clear the textarea <6> thanks pstickne <3> dwees, maybe your conversion is whack? <3> `js cookies <7> js cookies: www.quirksmode.org/js/cookies.html <3> oooh! <3> ks, that will probablly tell you how they are misbehaving or nonstandard in different browsers :) <6> cool <5> It's not actually converting the color into any code <5> it's literally reading the color from the div's style <5> the RGB is just an unintended side-effect <8> hidelly ho <9> hey all, quick DOM question. I have an AJAX call that returns XML. One of the tags is <Argument name='foo' value='bar'/> I need to check the argument name and if it is a certain value set a variable equal to the argument value. I tried getAttribute('name') but that didn't work apparently. Any help? <6> use json <4> berko, use getAttributeNS <10> dwees: I don't understand your problem .. you want to show hex there no matter what? <5> well I wanted to make the rainbows look nicer, and yeah ideally I'd like to show hex there nomatter what <10> How can they "Look nicer" ? <10> Getting the hex is simply a matter of parsing it <5> nod, and sniffing at it to see what it was in the first case <10> Either use a library (I have one) or as it's only ever RGB -> Hex, write it yourself
<5> it may not be worth it <9> stelt: how do I know what the namespaceURI is? <9> sorry, I know this is so n00b <4> there's always more noobs than experts <5> the trick is the noobs turn into experts over time <6> and experts turn into wizards :) <5> and the javascript experts in here become experts in a different area <4> berko, can you get a reference to the element with that attribute? <5> god I hate IE <11> I feel you, brother. <5> get something styled to fit Firefox and IE renders it completely differently <8> I hate browser incompatibility.... <5> Here I do have a question <5> can someone check out http://www.unitorganizer.com/download/hexcodecalculator.html in IE and tell me why the divs are the wrong height? They should be 6px, but it looks like they are 30px in IE, but 6px in Firefox <5> I used newDiv.style.height = divHeight; where divheight = 6 <10> At a guess .. you have an in them .. ? <10> Mmm .. nup .. <10> Off to get breakfast .. wife calling .. <5> nod thanks for looking <5> maybe I need to set them to "6px"? <5> no difference... <5> maybe IE doesn't let me set the height of the divs? <3> dwees, maybe they have a margin <3> dwees, or border <9> stelt: yes, I do xmlDoc.getElementsByTagName('argument'), which of course returns an array of argument tags <4> loop through the array and check every item for its attributes <5> can you get an array of all of the elements of a HTML document? <5> I don't need it for my current project, but it would be useful later <12> document.getElementsByTagName('*'); <5> merci beaucoup <5> and I ***ume that gets all of the elements currently being displayed, including ones that have been created dynamically? <10> It's a DOM function .. it searches the DOM, not your HTML <5> cool <13> If I have a function that is an object prototype, and make references to variables that belong to the object (but not with this.*), are those references to those feilds that belong specifically to the instancited object, or if not what? <13> Like this: <13> function foo(bar) { this.bar = bar; this.bar_inc = function(i) { bar += i; }} <13> Does the reference to bar in this.bar_inc refer to the instancited object's bar? <9> stelt: right, but what is the method for accessing the attributes? <13> Oh darn. I just realized that my hopes for accomplising what I was hoping to accomplish were somewhat misplaced. <13> I will have to do it differently. <8> if I set an event such as onmouseup on "document", that will fire on any child node of "document", right? <14> that depends on the browser <14> events 'bubbling' can be stopped by handlers on child elements <14> but generally, yes <8> Ah, I just figured out what I'm doing. <8> IE doesn't like onmousemove set on "window" <14> although it seems that things like flash movies swallow all events <8> so I inadvertently set the event on "window", then set the null event (to stop it firing) on "document" <3> GarethAdams, they do that even for FF browser key shortcuts :( <14> pstickne: huh? <15> flash <3> GarethAdams, when flash is playing I can't use things like Ctl+W to close window unless I explicitly focus <3> GarethAdams, same problem in windows and linux varients <14> oh <14> well that's one of the features of a plugin <15> scroll wheel too <14> when it has the focus, it takes control of all input <3> GarethAdams, annoying features :x <3> GarethAdams, it seems to get focus by default then <15> it could p*** it on if it's not going to use it <3> GarethAdams, even with never mouse over/select it will steal my keys <16> hello, i want to use the method replace(regex, pattern) can i set a variable as regex like /metobereplaced/ ? <16> with be both slaches on the side :) <10> string.replace( new RegExp( varName ), 'replace with') <10> No need for slashes in the varName <15> /xxx/yyy is basically short for new RegExp('xxx', 'yyy') <16> ok, but i want to find something many times in a string <16> hmmm <15> new RegExp(pattern, 'g') <16> perfect i think that should be it <16> YESSS <17> how do i wrap a image around in div tags?
Return to
#javascript or Go to some related
logs:
#lisp eth0 does not exist 8139 gentoo ubuntu lpstat: Unable to connect to server: Connection refused web irc gateway efnet maknod #suse gtkgaim.dll how to get edubuntu to be icelandic dvdrip transcoder problem suse 9.3 #linux
|
|