| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Comments:
<0> b0at, shh <1> No <2> pstickne: if the markup is coming from a script, say from a Forum set or Blogger set, like Drupal, it may not be reliable to have it in the markup <0> b0at, to what? working or being good practice? <1> No <0> CommandPrompt, reasons? <2> reasons is the markup is changing and you may not have much access to keep your event handlers in the markup :) <3> pstickne: thx. that does it. <3> i watched superman today <3> most boring. <4> Superman Returns? <4> I enjoyed it. <5> qq <4> rr <5> Yeah <6> whare are some lightweight multibrowser happy javascript libs that I can check out to move a div around like it was a window with a title bar?
<6> hey buu :) You ever use something like what I'm after? <1> `js dragdrop <1> `js drag <7> js drag: http://www.walterzorn.com/dragdrop/dragdrop_e.htm <1> sorta <5> Supaplex: prototype maybe <1> bleh <5> b0at: Implement dom for buubot. <1> nevar <5> =[ <6> heh :P <8> hi folks <5> tcc: "foo" <9> buu: Return: -1 tcc: file '/usr/local/lib/tcc/libtcc1.a' not found <5> =[ <6> tcc? <8> if I call a function that returns an array, and the name of the function is colorHex can I say color = colorHex[2] and get the 2nd item of the array? <5> Tiny C Compiler. <1> dwees: No. <8> I'm a javascript newbie <5> () <8> so if a function returns an array, how do I get the individual elements of the array? <1> Normally, you save it somewhere. <0> dwees, you need to use ()'s to call functions <5> jseval: function foo(){[1,2,3]} foo()[1] <9> buu: Error: Error: TypeError: foo() has no properties at line 0: (null) <6> just one element? <5> =[ <5> jseval: function foo(){[1,2,3]} (foo())[1] <9> buu: Error: Error: TypeError: foo() has no properties at line 0: (null) <0> dwees, without the ()'s you reference the function, not call it <8> well I want to run through the entire array 1 element at a time <5> b0at: js ****s. <1> Tell me something i don't know. <5> Why isn't my code working? <5> oh <5> jseval: function foo(){return [1,2,3]} foo()[1] <9> buu: Return: 2 <5> js++ <0> buu, no, JS ****s ;) <6> dwees: then ***ign the result to something, and itterate through the array. foo.count I think. <5> implicit returns++ <1> count? <1> Count ****ula? <0> (builtin iterators that don't ****)++ <5> Can you do foo().each? <0> (arrays that are cheap emulations over objects)++ <1> `js hoj # With this you can. <7> js hoj: http://interglacial.com/hoj/hoj.html <0> boo, with Prototype :) <5> YOU ALL SUX <1> HOJ++ # Perl or bust <0> boo, [1,2,3].each(function (i){ alert(i) }) # :)) <0> HOJ? <1> See the link <8> so suppose i call the function when the window.onload = foo, and it returns an array <8> is this array available to all my other functions? <1> Whatever that meant, the answer is likely to be no <10> dwees, if you declare it var bar = foo() in the global scope <8> okay <10> I think
<8> I'll try that, thanks for being constructive <10> dwees, sounds like your using a global though, stay away from em' <8> well I'll tell you what the plan is, and maybe you can make a suggestion <8> I want to create an array of all the websafe colors <1> guh? <8> and then create a function that takes each color from the array and uses it as the background color of a new div <8> and place all of these divs next to each other, with the different background colors <8> and have a nice color selector <1> For one thing, that doesn't require it to be global <1> And "web safe" is pretty mcuh meaningless <1> `colors <7> colors: http://color.sharewonders.com/ , www.wellstyled.com/tools/colorscheme2/index-en.html <8> well I don't want to run through all 16777216 different hex colors <8> I thought I'd reduce to only 216 colors by going up in levels of 3 <0> there are more colors then that :) <8> isn't it 256^3? <0> oh, my bad then <0> I don't know <8> Each of the RGB colors has 256 possible choices, and 3 RGB colors = 256^3 <8> what I want it to reduce the RGB choices to 6 so 6^3, anyway that's easy <8> that's just math <8> hunh <8> is there a breakkey to end a script in Javascript? I think I have 256 alerts coming my way... <11> hi <12> dwees: You can kill the browser <8> I'm using HTMLKIT so if I kill the browser I lose my script <8> anyway i solved that problem, thanks though...was missing a break; in a switch/case <8> do I use newdiv.style = '"background-color:#345342;"' to set the background color of a new div? or is there a difference reference for style like there is for cl*** <1> You use .style.cssPropertyCamelCapped = "value"; <12> dwees: element.style is not a setter <13> hello there <13> in DOM, can we do a parent.insertBefore(newElement,parent.firstChild) ? <8> someone said something about .style.property not being a something? <8> I had to kill a bunch of programs because something was hogging memory and making my computer slow down <8> so I'm reading about setting CSS with Javascript, and it looks horrible complicated <8> I have to use different code for this for IE and Firefox? <12> dwees: no <12> dwees: And try to keep the styling via JS to a minimum. Do as much as possible with css <8> well I'm trying to make rainbow of 216 different colors <8> and I know I could do it with CSS but that seems time-consuming <12> right, that might not be the smartests thing <8> how do I set the background-color of a div using Javascript <12> Element.style.backgroundColor <8> and width and height are similar? <8> ie Element.style.width = "2px"; ? <8> invalid property value on line 21, does this accept hex values for colors? <0> dwees, maybe your browser doesn't support setting inline styles <8> hrmm <8> so I should test it in Firefox eh, I'm beginning to hate this less than useful preview function in HTML-KIt <1> You used a string, right? <8> yeah <0> dwees, ohh, IE? <0> dwees, your element might also be not what you expect <8> the preview is supposed to emulate IE, but it's not exactly the same as it, and it's way different than Firefox <14> anyone around? <0> no <8> well at least Firefox doesn't complain about the script like HTMK-Kit does, but it usually shuts itself down as soon as it finds an error <8> hunh interesting <8> I loaded the file up in Firefox and it says "Expected Colour but found '#undefined' etc... <8> so my code for creating the array of colors doesn't work <8> hrmmm <0> dwees, maybe it's "#" + undefined_var you're using <8> yeah that's exactly what's happening <0> well, make it sensible <8> is there a way to output the value of a variable easily in JavaScript? so I can debug a bit? <8> like in PHP you just say print foo and it does, right to the screen <14> is there a null function to use with setTimeout <14> dwees: alert <8> yech, I have 216 of these things floating around, I'd prefer not to have 216 alerts showing up, is that the best way? <0> tlhiv, null function? <14> just write out to the HTML then <15> hey guys <15> anyone in here? <14> pstickne: setTimeout requires a function right?
Return to
#javascript or Go to some related
logs:
monospace knx servermgr_dns: Bad zone file for zone ubuntu i850 dapper python unexpected end of regular expression convert jpg to text libresmgr fedora #web etch xine segmentation fault gentoo winzip ppmd #css
|
|