IRC #javascript chat snippets
The wisdom of the really wise crowds.
Privacy concerns • Only a sample, no code written.• Aim: To try to manage tons of useful info in IRC chats.
• Nothing logged yet for this, but do see "IRSeek"• Names replaced with random names (similar can be done for
timestamps, signatures, “away” messages).• Anyone should be allowed to opt out.
• “Chill effect”?• Knowing the possibility of logging might actually reduce junk on
the official channels• Newbies might get scared off initially seeing nicknames on
presentations - just till it becomes a routine - like Facebook and MySpace.
• If ops don't like it, it isn't going through anyway :-)
IRC #javascript chat snippets
17:39 Bob is there a method that creates a new stylesheet such as "document.createStyleSheet()"? i found all the methods for adding rules, but what if my pop up window doesn't have a stylesheet to begin with? 17:39 Bob document.styleSheets is undefined 17:40 Jonny Bob: var style = document.createElement('style'); style.type = 'text/css'; document.getElementsByTagName('head')[0].appendChild(style);
IRC #javascript chat snippets
17:49 Alex another newbie question: how do I find "that" element's parent's class? $('.someLink').click(function(){ var className = $(???????).attr("class") })
17:49 Karl $(this).parent().attr("class")
17:50 Karl that might give you multiple classes though of course
IRC #javascript chat snippets
18:07 Bryan how do I access all elements in a form at once? 18:07 Jonny what do you mean? What are you trying to accomplish? 18:08 Bryan i want to check if any of the form's elements are empty 18:08 Bryan if at least one is empty, i want to abort the submit 18:09 Jonny You have to loop through the form's elements collection 18:09 George Then iterate over the ones you do want.
IRC #javascript chat snippets
17:50 Bryan hi, i am having problems accessing an html form and its object in JS :( 17:50 Jonny `forms @Bryan 17:50 jsBot Bryan: forms: Accessing form elements via JavaScript: Don't use document.forms[index].elementName or document.formName.elementName. Use document.forms['formName'].elements['elementName'] or document.getElementById('formID').elements['elementName'] or document.getElementById('elementID')
IRC #javascript chat snippets
18:16 Larry hello, does anyone know how i might iterate through all of the attr's of an element? Karl Larry: $("el")[0].attributes
IRC #javascript chat snippets
18:27 Bryan can i join an array now without delimiters? 18:27 Bryan so it stays empty? 18:27 Jonny arr.join('') 18:27 Jonny In your case, that will only test against all fields being empty, tho 18:27 Bryan oh yeah 18:29 Jonny var pass = true; if (...elements['name'].value === '') { pass = false; } and so on for each of your fields. Then return pass
jQuery UI draggable demo
Was this useful as a tool to learn javascript?
FAQ 2.0?
That is all, thank you!