@# 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> CSS: Valid - http://jigsaw.w3.org/css-validator/validator?uri=hm ?
<1> what's the best way of placing a new table into an html file with js ?
<2> document.createElement to make it, and .appendChild or .insertBefore to add it to the documen
<1> how to create an array that starts with 0 and end with 24 - but so that the numbers are sorted different each time so i have a different array each time i run it
<1> (example: 2,5,3,1,0,24,13, ...)
<2> create an array of 0-24, then create a second array which picks a random number from the first array
<2> then remove the number from the orginal array if you want to prevent duplicates
<1> kicken: how to create random numbers from 0-24 ?
<1> kicken: i'm a realy javascript newbie (i've read about dom and stuff but need a bit training)
<3> "Caffeine is an addictive drug. Among its many actions, it operates using the same mechanisms that amphetamines, cocaine, and heroin use to stimulate the brain."
<2> defbyte, Math.random()*24
<1> herkeios: there is a big differenz in how they turn ...
<1> kicken: thank you
<2> That'd give some decimal number like 18.128236649
<2> use Math.floor() to make it an integer
<4> I need some help, in Firefox everthing works as it should, however in IE the calculation doesn't work. Can somebody give me some insight why it isn't working under IE 6? http://pastebin.ca/76419



<5> The paste 76419 has been moved to http://erxz.com/pb/1821
<2> what error do you get in IE?
<4> The script is simple... Client put some numbers in, then the total is calculated and the getTotals will give the total of all
<4> kicken, non!
<1> kicken: var tmp_rnd = new Array(); var tmp=Math.random()*24; tmp_rnd.push(Math.floor(tmp)); ??
<2> var total = Number(0); Just do var total = 0
<2> no need to use Number()
<4> aha ok let met try that thanxs
<2> defbyte, that would make one number somewhere between 0 and 24 and put it in the array.
<4> IE does give an error on rule 71
<2> enquest, what are the elements you are getting with document.getElementsByName() ?
<2> rule 71?
<4> line 71
<2> well, that paste only goes to 69
<4> I guess that is the funtion function replaceElement( string, item )
<6> jseval: var foo=[];for(var i=0;i<6;i++){foo.push(Math.floor(Math.random()*24));} foo;
<5> b0at: Return: 3,22,21,9,11,11
<6> There will be dupes with that method, but it works.
<4> How can I find out in IE what the exact line is in the script?
<6> If you need no dupes, you want a shuffle algorithm
<6> Or some other way of keeping track
<2> line numbers in IE are generally close, the filename just might be wrong.
<4> Is the line numbering starting from the <script tag> or from the header?
<2> from line 1.
<4> html header.... man why is IE making my life always diffucult
<4> kicken, is that from the <javascript> tag = line number 1?
<2> line 1 is line 1. the first line of the file.
<4> kicken, this is line 71 from html discount = getTotals('discount');
<1> can i output an array with alert ??
<2> defbyte, yes
<1> kicken: how's the syntax to show the complete array in one messagebox ?
<2> enquest, try using 'new Number' rather than just 'Number'
<2> alert(arrayVariable);
<6> defbyte: alert(array) is like alert(array.join(','), it prints the elements for you
<4> on what line?
<1> kicken: so i can take a look at my random numbers
<2> enquest, anywhere you use Number() to do your typecast
<4> I'll try
<4> kicken, could it be that I'm calling the function replaceElement more then one time... He does make one calculation correct but doesn't do it the 5 times I ask only the first time
<2> doesn't matter how often you call a function
<2> what type of elements are you getting when you call getTotals. What elements have name='discount'?
<2> <input> elements?
<7> Ha. I was vaguely thinking about doing something like this for ML. I wonder if it's any good: http://www.bluishcoder.co.nz/jsscheme/
<7> (I suspect the answer is a very definite No)
<4> kicken, now he gives NaN back
<7> (Actually it's not quite what I thought it was, but I'm sure it could be trivially adjusted to be so)
<4> FireFox still does it correct
<1> how to get the number of indexes in an array ?? array.lenght ?
<6> You mean elements?
<6> Yes, array.length.
<4> Can I combine a Number type with a variable type?
<6> What is a variable type?
<6> And combine how?
<4> like "Subtotal: 15" ... 15 is an integer
<4> I think IE blocks on this?
<6> That's a string.
<4> b0at, in Firfox I get what I want,,, but in IE it gives "Subtotal: NaN
<6> Oh. So you're concat'ing "Subtotal :" with what should be the number 15.
<6> Alert the thing holding the number and see what you get in IE. Also, where is this thing getting its value?
<4> test = "Subtotal: " + total;
<4> b0at, A function http://pastebin.ca/76419



<5> The paste 76419 has been moved to: http://erxz.com/pb/1821
<6> Ah.
<6> enquest: Do a parseInt() or parseFloat() on all the values you're grabbing form text boxes.
<6> from
<6> e.g., var foo = parseFloat( element.value );
<4> b0at, ok I do that but I don't think that that is ther reason why it won't work in IE
<4> should I do parseFloat because its money?
<4> like this? var orders = parseFloat(document.getElementById('o' + id).value);
<4> b0at, ok I did that but it didn't solve the IE question... Thanks for pointing me this out parsFloat out!
<4> b0at, making parse float breaks my application. It is also possible to empty a field. As that isn't a float it will return NaN
<1> http://rafb.net/paste/results/MleYa362.html
<5> The paste MleYa362 has been moved to http://erxz.com/pb/1822
<1> can someone take a short look ?
<1> i need a random array (with the numbers 0-24) where each number exist only one time
<4> defbyte, between 0-24 or all of them?
<1> all of them
<1> so an array of 25 elements where each element is from 0 to 24 but in random order
<1> so tmp_rand[0] = 20; tmp_rand[1]=0; ...
<1> is there a way of debugging javascript (line by line to follow the steps ?)
<8> defbyte: you can try venkman in firefox
<9> Hello
<9> Im trying to hide/unhide table <tr>s hidding is easy display: none but unhidding is a problem FF works fine with table-row while IE with block, is there a setting that will work on both?
<8> SunShineLady: add a cl*** to your css, then toggle that cl***
<8> `js cl***
<0> js cl***: http://phrogz.net/JS/AddCl***KillCl***_js.txt
<9> I already managed to fix it by trickary, when i want to unhide the TR i ***ign it the display value of some other not hidden TR
<8> what I just told you will work on any element anywhere
<9> What the "cl***Name.replace(new RegExp("^"+cName+"\\b\\s*|\\s*\\b"+cName+"\\b",'g'),''));" does?
<10> !v http://chtitux.ath.cx/~chtitux/phh.html
<0> HTML: Not valid - Errors: 11, http://validator.w3.org/check?uri=http://chtitux.ath.cx/~chtitux/phh.html
<0> CSS: Not valid - Errors: 42, Warnings: 96, http://jigsaw.w3.org/css-validator/validator?uri=http://chtitux.ath.cx/~chtitux/phh.html
<10> 42 errors, perfect \o|
<10> well, I've a little problem with Ajax script
<10> I've a XML doc with something as "<test>Hello !</test> <test>Bye!</test>"
<10> my scrpt extract the content of tags test with node.data
<10> but there is sometimes html tag in <test> tags
<10> there are*
<10> and javascript displays "undefined"
<10> Is there any solution to that ? (something as node.cdata ?)
<4> b0at, I found the problem... IE and Firefox do not speak the same language.... innHTML is something diffrent for IE then FireFox subtotal = Number(price[i].innerHTML);
<4> In IE innerHTML give the tag element + content in Firefox only the content
<4> How do I solve this?
<8> it shouldnt
<8> anyway, the way to solve it would to be to use the DOM instead
<8> `js innerhtml
<0> js innerhtml: http://slayeroffice.com/articles/innerHTML_alternatives/
<4> I look into it
<4> RTFS, thanxs for the link
<4> frb-work, the problem is this: var price = document.getElementsByName(name);for(i=0;i<price.length;i++) subtotal = Number(price[i].innerHTML);
<8> you're doing that all wrong
<8> first, get a reference to the rom
<8> err form
<4> I calculate a total?
<8> yes, but you're doing it wrong
<4> there is only one form... It all works in Firefox
<4> Ok frb-work I'm all ears
<8> first off, use prince[i].value
<8> err price, whatever
<4> Aha, but price is plain text...
<8> second, formref.getElementsByName is much safer
<8> if you are using name attrs on non-form elements, you are even more broken
<4> Well its now a form element... Lots of them and I need the total calculation
<4> It used to be plain text
<8> I'm not helping anymore without a url
<8> in fact, I have to get back to work, so validate your html first
<4> frb-work http://pastebin.ca/76419
<5> The paste 76419 has been moved to: http://erxz.com/pb/1821
<11> Is there an easy way to get a reference to the PARENT object of an object? for example, suppose I have a <table><tr><td>, and I have a reference to the <td> object and I want to get a reference to the <tr> object so i can append a new <td>...so var foo=[reference to <td>]..what command do I use to get <td>'s parent(<tr>) into foo?
<12> EmilyLove: .parentNode
<11> thankds dorward
<11> so ( googles it) it would be foo=foo.parentNode?
<9> What "invalid label" error means? Im getting it while setting tag.innerHTML = "moo";
<4> if I want the contents of getElementsByName("foo"); and the element name is <b name="foo">bar</b> ... How do I get the result bar ... I know to loop it but I seem to fail to get the content of the <b> tags
<13> enquest, getElementsByName?


Name:

Comments:

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






Return to #javascript
or
Go to some related logs:

#kde
#linux
#xorg
how to print damn small linux
setc %dil
kernel panic- not syncing: I/O error reading memory Image
#php
z10n0101
#perl
fatx driver for ubuntu



Home  |  disclaimer  |  contact  |  submit quotes