@# 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 8 9 10 11 12 13 14 15 16 17 18 19



Comments:

<0> but from accept-language I don't know
<1> how do I do that with html ?
<2> _beginner_: Generate textNodes and HTMLElementNodes (with document.createElement and document.createTextNode). Then append those.
<1> (my html code sent by server don't have language :'()
<1> _beginner_: you may use the innerHTML property of the element
<3> thanks i'll try
<4> if i have "name0=value0 name1=value1 ...........nameN=valueN" and want that in 2 arrays, named name and value. How do i go about. Regexp is hard
<0> so any one know if I can get the width of a text node or set a div to be "as tiny as possible" including its text ?
<0> stelt > why 2 arrays ?
<0> oh
<4> or can i do the foreach $array as $key => $value thing as in PHP?
<0> well.. your regexp should be something like "/name([0-9]+)/" Ithjink
<5> you could just split on spaces, then split each piece on =
<4> deltab: i know that part, i just don't know regexp syntax
<5> you don't need regex for that
<0> well with split you don't need regex ;)



<6> what function in javascript strips a string from all leading and trailing white spaces?
<4> trim?
<7> s.replace(/^\s*|\s*$/g,'');
<6> stelt: yeah, trim() is a function?
<6> Munter: thanks, I'll try that out
<8> hi
<8> how to dynamically hide a <div> ?
<8> hide / unhide
<7> http://fumle.dk/public/javascript/toggle/
<8> Munter thanks
<8> how to have multiple regions to hide / unhide ?
<8> any examples ?
<7> oh come on...
<8> never mind... figured it out...
<8> :)
<9> Is there a special way to avoid "marking" the text? Or do I just have to override onclick?
<10> I have an input box and it's content is printed to the page, how can I stop html/javascript that is entered from being rendered/executed but rather just displayed exactly as entered in to the text box?
<9> halibut: replace < with &lt; and > with &gt; ?
<2> and & with &amp;
<9> that one first :)
<11> "JSzou" at 66.180.175.30 pasted "a test" (1 line) at http://erxz.com/pb/2066
<9> I'm playing around with the DOM a little at http://www.b-a-l-u.de/tmp/D.php to make it possible to move rows in a table, but the text get's marked when you move the mouse clicked...
<9> How would I avoid that?
<10> balu, Dorward, is there a function already there that I can use to replace all the nasty characters?
<2> halibut: document.createTextNode will handle it automatically.
<10> balu, css on your table : -moz-user-select: none;
<10> user-select: none;
<10> Dorward, I am not using createTextNode, I am using google maps API which means I have to do things their way
<9> halibut: thanks, but I guess this is Moz-only...
<10> balu, first is FF, second is for IE iirc
<9> halibut: konqueror ignores it though
<10> not sure about konq
<9> I guess I need to stop the famous event bubbling, but I'm a noob with events :)
<12> how can I select all <select multiple>object rows from a clicked button ?
<10> form.select.options[i].selected = true ?
<12> thanks
<13> hello i would like to check if a string starts with some specified characters, in java its string.startsWith("foo"); what is the equivalent in javascript?
<9> string.indexOf() returns the position of the first occurance of a char or string
<9> 0 is at the start
<13> ok thanks balu
<14> indexOf matches a substring, not just a single character
<10> cvasilak, or string.substring(0)
<10> cvasilak, or string.substring(0,1)
<9> halibut: that is to get the string, not check if a string starts with something
<10> balu, first was mistake
<10> if(string.substring(0,1) == "a") { //starts with a }
<9> halibut: true :)
<10> do I need to do any character escaping when posting a form?
<2> halibut: No, the form does that automatically
<10> Dorward, oops, xmlhttprequest
<6> any XUL gurus?
<6> in XUL, how do you make a textarea stretch as much as possible to fill all available area instead of setting fixed width and height attributes?
<15> :)
<16> hey all, how do you check if a function is defined in Safari? I get errors about it being undefined hwen I use typeof
<0> question : how to set a div width to 100% when it's a children of another div with its width set to auto ?
<2> JSzou: width: 100%;
<0> i did that
<0> it's working with parent div when width is set (i.e. width=200px;) but when parent div has (width:auto;) it doesn't
<2> JSzou: It should do
<0> it doesn't :p



<0> seems like auto width is define after the 100%
<0> so it does 100% from nothing, and then calculate the width of the auto
<2> JSzou: http://dorward.me.uk/tmp/width.html Width of the inner div is 100% of the width of the middle div - as expected.)
<0> looking :)
<0> you're cheating ;) between the auto and 100% div there is a width 200px div
<2> OK, now the outside div is 200px wide, the middle one is auto, and the inner one is 100% of that.
<0> the fact is you still have a reference to a parent div with a set width of N px
<2> JSzou: So now the outside div is width auto (the default). The middle one is width auto (explicit) and the inner one is 100%.
<0> now you're interesting me :)
<0> what about if you remove the first div (with auto as default) ? cause it's my case
<2> Then you get the two divs as expected
<0> damned
<0> trying to post my case online so you can see the problem
<0> here we are : http://gonnarule.info/temp/
<0> http://gonnarule.info/temp/parametres_tree.css for the css
<0> div#boutons_tree is the div I want to be 100% width of its parent (div#tree_liste)
<17> Hello... I don't know anything about dom scripting but I am looking for a simple way to show/hide content onclick (I was reffered to here from #AJAX)
<0> element.style.visibility = "hidden"
<0> will be hidden but still "taking place" in the page
<17> Ok... so how do I make it appear when the user clicks on it?
<0> = "visible"
<18> how do i get the style.color attribute of an <a> tag inside a <div> tag of id="xyz"?
<17> Thanks JSzou, I'll do some googling :)
<7> Is there a way to catch the keys pageup/pagedown/up/down/tab in IE onkeypress? They dont seem to send keyCode with the event
<10> Woosta, what do you use to parse your xml server side? The xml parser cl*** I am using for php seems to fail when tags include &gt;
<0> Dorward> damn.. it's my overflow attribute that is doing some mistakes to width:100%
<0> if I remove the overflow it works
<19> munter, onkeydown maybe
<20> halibut: that's crap! I use perl's XML::Simple
<7> exe87: It has to be keypress. I am trying to suppress the keystroke
<10> Woosta, what's crap?
<10> I have already done too much in php to use something else now
<0> simmerz> document.getElementById("xyz").getElementsByTagName('a')[position of tag].style.color probably
<20> That it interprets &lt; as a < rather than as text ..
<19> suppress, how do you mean?
<21> Guys, I'm opening a little script in a popup, and I need to p*** information from that popup back to the main window. How do I do that?
<7> exe87: I want the browser to do something other than the default thing when that key is pressed.
<0> window.opener
<18> how do i keep :hover attributes if i change the .style.color attribute using javascript?
<2> simmerz_: You can't.
<2> simmerz_: Inline style has maximum precidence.
<19> munter, read int+o event.returnValue=false
<0> simmerz > just change the cl*** of the css
<0> simmerz like : element.cl***Name = "otherCl***";
<18> ok thanks
<22> `js ref
<23> js ref: http://developer.mozilla.org/en/docs/JavaScript , http://devedge-temp.mozilla.org/central/javascript/index_en.html , http://phrogz.net/ObjJob/ , JScript@MSDN: http://tinyurl.com/9pk3l , www.crockford.com/javascript/
<10> hmm, Woosta, I was alerting the responseText so I think the <foo> where just getting removed
<22> shouldn't alert(td.innerHTML.match(/Select/)); return null if td.innerHTML contains "select"?
<21> Guys, where is the javascript API on the web?
<2> `js ref
<23> js ref: http://developer.mozilla.org/en/docs/JavaScript , http://devedge-temp.mozilla.org/central/javascript/index_en.html , http://phrogz.net/ObjJob/ , JScript@MSDN: http://tinyurl.com/9pk3l , www.crockford.com/javascript/
<10> Woosta, hmmm, how do you send & without php thinking a new post variable is starting? I think that's the problem
<10> even &amp still contains an ampersand!
<21> Thanks
<20> No idea .. that sounds like php being totally daft
<20> Encode it I guess
<20> submit the obj2xml as encodeURI( ... )
<0> is there a htmlEntities() function in JS ?
<0> the equivalent
<2> halibut: Since PHP expects form encoded data not HTML encoded data.
<10> Woosta, encodeURI("&") = "&" 0o
<20> no
<20> rather than submit obj2xml(blah), submit encodeURI( obj2xml( blah ) );
<24> how come some element styles will be applied correctly if there is an alert() in between the rendering in IE, but fails when the alert isn't there ?
<24> anyone had a case like that maybe before ?
<24> and what was the sollution ? :)
<12> how can I get the lenght of an array (SELECT object name : info[]) ?
<10> Woosta, yes, obj2xml returns a string of xml containing some &, but as far as I can tell encodeURI() does not convert the &
<10> (firefox)
<20> strange ..
<24> EdsipeR, what kind of code is that ?
<20> then call replace on it to turn & into %nn
<20> (where nn is &'s hex)


Name:

Comments:

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






Return to #javascript
or
Go to some related logs:

unmerging gnome gentoo
#fedora
qpspmanager on ubuntu
#math
UserWarning: wxPython/wxWidgets release number mismatch
#php
Can't connect to 127.0.0.1 port 10025, (Bad file descriptor)
r3vld
#css
what is compat20



Home  |  disclaimer  |  contact  |  submit quotes