« first day (713 days earlier)      last day (4250 days later) » 

12:00 AM
That's crazy
Completly crazy
How can a country like USA accept that
 
sigh we've done much worse
I've given up on the current political system
 
@david it's comming
 
We need to redo the education system to ever see real change
 
you need to educate on more than just the us
there are other countries out there
afaik your education doesn't really go into anything about them other than they exist.
 
In NY, we get two years of World History (basically everything up until the 1700's) and one year of US (1700-now)
but that's only one state
AND the standards don't even cover our own country
i.e. The big state-wide test doesn't cover the civil war (thus, teachers don't teach it)
(U.S. Civil War, excuse me)
 
12:09 AM
lol
from an early age in canada we learned about world history and specifically how it impacted us. then in highschool there was canadian history and world history to choose from
 
Even so, I don't think history is our worst subject
I'm a bit biased here, but I think that the thing we're lacking in the most is technology
there are inner city schools with three computers, and all of them are for administration use
how are schools supposed to teach kids to do anything in the 21st century without computers?
 
@rlemon yay!
bookmarked
 
why this dont work alert(document.getElementsByClassName('date').getAttribute("value").length );
 
because you have no idea what you're doing
and need to look stuff up
 
i need in this alert , see how is the length of the attribute value
 
12:24 AM
v.v
 
@goodmood Do you have the four internets required?
I just checked the docs, you need four internets to perform that action
 
@SomeKittens what ?
 
Läs den jävla manualen
 
jag ska inte läsa :)
 
Då du kommer att misslyckas
 
12:25 AM
vilken manualen du pratar om
 
@goodmood The documentation says the user must have four (minimum) internets to access that variable.
 
@SomeKittens what four internets ??
 
@goodmood ...You don't know about them?
 
The first internet is the internet of wind
 
12:27 AM
hey!
is there a way in javascript to detect when a link wants to open another tab?
 
@MaxHasADHD target="__blank"
 
so i check that, if so open another tab? im a ios developer, and i have some javascript, understand it a little. thinking safari and other browsers open tabs when detecting with javascript
 
@SomeKittens i have this document.getElementsByClassName('date');
 
@MaxHasADHD the link (<a tag) should have the attribute target="__blank"
 
@SomeKittens and then want alert this alert(document.getElementsByClassName('date').getAttribute("value").length );
but didnt work
 
12:30 AM
ok ill try and see if i can detect it:D thanks for the help!
 
 
@david jag översätter inte dude
@david jag bor i kristianstad
 
@goodmood that didn't work either? Man, do you have any internets at all?
 
what internets i dont understand , yes didnt work
 
@goodmood You need to quest for more internets
 
12:34 AM
and here my inpute ` <input type="text" class = "date" name= "date0" value="" />`
 
kristianstad va?
det är vad alla säger.
 
@goodmood Yeah. More internets, like I said. I know you can get a few by acquiring 500 SO rep.
 
vem alla ?
 
0
Q: 2 Servers 1 Database - Can I use Redis?

AustOk I have a couple of questions here. First let me give you some background information. I'm starting a project where I have a node.js server running my application and my website running on another normal server. My application will allow multiple users simultaneous connections and updates to th...

 
@david var bor du ?
 
12:35 AM
0
Q: how to display thumbnails?

user1255049I'm using a plugin to "dress up" the NextGen gallery by displaying images in a slider/carousel. I would like to display thumbnails, and have the corresponding image display in the slider when the thumbnail is clicked on. Any ideas how to make this happen? I'm also open to alternative methods if ...

 
falska svenskar på internet
 
ok
 
Anyone mind talking in English? I'm the one using Google Translate...
(Yeah, I know, dumb Americans want everything in English....)
 
@david du är inte säker om jag är svensk eller nej :) ? jag tror det är du som översätter :) , men inga problem , du ville inte säga var du bor .
vad gör du nu din jävel :)
 
Jag skrattar så hårt jag gråter.
 
12:40 AM
i think everything will be in swedish , internet and php and all
bra :)
 
not if they can't figure out how to read input elements >_>
 
OH SNAP
 
Du bara fick höra syster.
 
rather: OH KNäPPA
 
jag har ingen syster
 
12:42 AM
Min syster kallas inte Ingen
 
vad kallas da ?
 
javascript
 
@david j tr at du e int sven , förstr du de ?
 
is this right to check the target?
var anchors = document.getElementsByTagName("a");
for (var i=0; i<anchors.length; i++) {
var anchor = anchors[i];
return anchor.getAttribute("target")
}
 
the return in the for loop worries me
 
12:45 AM
lol its in a function in a .js file in my app
 
@david det går inte att översäta den !, hehehe
 
then i log it in objective c and the web view runs this function running this, i got it off a site becuase i dont really know how to check that
 
Om det är sant varför du testar mig genom att skriva roligt?
 
@MaxHasADHD "I got it off a site" Bad news for you
 
lol
well how do i check it then?
like this code i have gets password, which is more understanding:
function getPassword() {
return document.querySelectorAll("input[type='password']")[0].value;
}
but checking the target doesnt make sense to me
 
12:47 AM
ok jag försök lösa min problem , kan du hjälpa mig med den ?
 
Jag försökte redan. Jag tror inte att du vet vad du gör. Du skriver bara slumpvis kod och hoppas att det kommer att fungera. Din kod är så konstigt att jag inte ens kan räkna ut vad du försöker göra för att hjälpa dig.
 
first why this dont work
alert(document.getElementsByClassName('date').getAttribute("value").length );
 
@goodmood have you not been listening to us
 
this is the input <input type="text" class = "date" name= "date0" value="" />
 
@david yeah, i was pretty much thinking the same thing
 
12:52 AM
getElementsByClassName returns an array, you probably want an item in there
 
getElements.... ssssssssssssssss
multiple
more than one
 
why are you getting the length of a string?
 
a nodeList
 
yeah nodelist, not array
 
@rlemon thx i understand u now by this ssssss :)
@david i want check if its empty
my problem is i want check the value attribute if its empty
 
12:54 AM
var elements = document.getElementsByClassName('date');
for(var i = 0, l = elements.length; i < l; i++) {
   alert(elements[i].value.length > 0);
}
you likely want to check the value property not attribute
 
do .value instead of getattribute
yeah
 
so you'll need to check on all of the returned elements
 
im going home, laters
 
and i'm drunk!
 
@rlemon same here
couldn't sleep, snapped 5 beers, still can't sleep... fuck me
 
12:56 AM
I wanted to be productive tonight.. but getting smammered seemed more interesting
 
it's freaking 3am, i got a meeting at 8.00
 
i've got work at 8am
but yea
thats no biggie
 
well... i gotta work at 7.30, meeting's at 8.00
and it's not 3am in good ol' canada i suppose ;)
 
@rlemon i get 11 alerts which says false
 
so what do you think of this idea. a chrome extension that is basically a youtube extension that allows you to play your playlists. some basic key commands and scripting abilities
 
12:58 AM
so that's why you don't use alerts for debugging ;)
 
@goodmood ok so you have 11 date classed elements and all of them have a value of ""
 
yes
and if i submit one of them it will handle just this submitted input
 
@rlemon i'm not really a big youtube-user, but I'd pay you money for a grooveshark-extension like that
 
the other i dont submit
i submit by one input
 
@GNi33 well the idea would be to be able to use multiple services that allow me to tap into their api
 
1:01 AM
here my inputs
 
@goodmood I have given you enough to figure out your problem on your own
 
what would that look like?
 
ok please try now
<service> dropdown and you put in your ID and if need be your PW
 
for stuff like grooveshark or spottify, some small popup-window or anything alike would be so awesome
 
`<input type="text" class = "date" name ="date0" value=""/>
<input type="text" class = "date" name ="date1" value=""/>
<input type="text" class = "date" name ="date2" value=""/>
<input type="text" class = "date" name ="date3" value=""/>
<input type="text" class = "date" name ="date4" value=""/>......to date9`
those are my inputs
 
1:03 AM
when it comes to youtube and other video-services, i'm not sure if it would make that much sense
some basic question, would it be possible to bind specific keyboard inputs to some chrome extension?
i would love to switch between songs on grooveshark without having to open the damn tab every time
 
yes it is
8
Q: Chat Easy Input Tools - Provides keyboard shortcuts for common text formatting commands

rlemon About Provides keyboard shortcuts for common text formatting commands, reducing the dependency on mouse usage. Current version does not have a configurable set of hotkeys but later versions will. How to use. All of the following commands are run if the user has focus in the chat input area. ...

 
so... all i would need is an API? i think they offer that.... that would be awesome
 
same basic concept
 
great. i never had a look on chrome-extensions before, maybe i should
 
why does document.links[1].href work and not document.links[1].target work?
 
1:06 AM
they are super simple
 
oh, that looks nice
i rarely install any extensions, be it chrome or firefox
 
its difficult to reach the inputs by the class ,
maybe by the name better
koz they have different names
koz class is elementssssssssss as rlemon said , and i cant check which input is submited
rlemon ur javascript is advanced :)
 
which input is submitted?
basically, you submit a form, which contains inputs
 
yes , if i use getElementsByClassName
no i have many forms and every form has its own input
 
you got a form for every input?
am i allowed to ask why?
 
1:16 AM
yes i have a form for every input , because i dont want submit all inputs , user choose which input submit , so i submit by one
only one input is submitted
 
alright, and every form has an id?
 
because that would make this really easy for you
 
ok well is there a way to even do what im describing? a way in javascript to detect a url click wants to open another tab? dont really know how to get that target information. i have the tags, like A, or IMG to tell that, and can get the url, but cannot get that href line with target="" part
 
var form = document.getElementById("formId");
var input = form.getElementsByTagName('input')[0];
@MaxHasADHD why don't you just use .href instead?
 
1:22 AM
i did, that just gets me the url, but this is a ios app so i already have that info. but its a web browsing app so i have lots of javascript for restoring user names and passwords, saving them, and when holding a link getting the url and other info.
but i need to know of it wants to open another tab, so i can add that into the app
 
oh, now i get what you mean
.getAttribute('target') ?
 
i think i tried that, but ill try some more
 
ok basically all attributes map to properties as soon as the document is evaluated. so you don't need to worry about attributes unless you are reading data-* or care about state data
otherwise use the property equiv. or element.prop
eq. element.title
element.id
element.style
element.target
element.href
element.src
etc.
 
yeah. target should be property, right?
 
yes
 
1:26 AM
so document.element.target?:P
 
again unless you care about state data attributes are rarely ever cared about
nooo
var element = document.getElementById('id');
element.target;

Javascript Resources.

Sep 4 at 13:36, 2 minutes total – 8 messages, 1 user, 1 star

Bookmarked Sep 4 at 13:40 by rlemon

 
@GNi33 this form = document.getElementById("formId"); i will make 10 code like that by every formId ?
 
no, actually i would bind a submit-handler to all the forms and catch the submitted form when it's being submitted
but... that's probably just me
 
var forms = document.forms;
for( var i = 0, l = forms.length; i < l; i++) {
   forms[i].onsubmit = function(e) {
       // code for form submission here
   }
}
 
@rlemon thx for this but this it doesnt check the value if its empty of this input
 
1:38 AM
> // code for form submission here
 
ok
 
:D
 
40
Q: The Help Vampire problem

Barry KellyWhat is SO's long-term solution for the Help Vampire problem? Quote from article follows: Identifying Help Vampires can be tricky, because they look like any ordinary person (or internet user, whichever is lesser). But by closely observing an individual's behavior using this handy checklist,...

just throwing this out there
 
thanks for the help, still not working for me.. weird. it hates meXD
 
@goodmood in all honesty, just asking people to provide the whole code for you, will not help you at anything
it's perfectly fine if you're looking for some assistance in basic understanding of javascript, the DOM, or a specific problem
 
1:40 AM
did you look here
 
but what really matters, is that you take that assistance and try out for yourself, research for yourself
if you get stuck again on a specific thing, feel free to ask
but wanting people to provide the whole code for you is stealing our time and isn't helping you anything at understanding the problem.
just wanted to say that
 
@rlemon that makes more sense
but i guess the id is always returning nil. im logging it and tried alert to see, always blank. because(maybe i didnt clarify) this is on link click, so user taps, it send it to me, so i can tell if its a click, if it is, then i did the code you guys gave me, so maybe document isnt right?
wait, ok i see it. so in the code there it says foo, which is id. so i need to find the id title, then check the element and then get the target
 
you want to find the id of an element.... to get the element?
 
:5542931 sorry again rlemon , do u mean like that ` var forms = document.forms;
for( var i = 0, l = forms.length; i < l; i++) {
   forms[i].onsubmit = function(e) {
          e.value.length < 1 )
                {  alert('Please select a date');


             return false;
             }

   }
}`
 
well i need to find out the value of id="" to then do document.getElementById('foo');
 
1:48 AM
but if you find out the id-property of an element.... you already have the correct element
you know what i mean?
 
@goodmood no not at all
e is the event
the submit event
 
@gni33 ya i get it, just a bit confused on all of thisXD
 
tip: in a fired event-handling - function, this will refer to the submitted form element
 
@rlemon u know what i mean in my submit, i want check the value attribute if its empty
 
VALUE PROPERTY!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
1:50 AM
dude, he's a beginner
 
yell-type is good for everyone
 
i dont know much here.
 
the difference between property and attribute does not have to be obvious at that point i think
 
@MaxHasADHD was for @goodmood
 
:( , u cant go easy with me :(
 
1:50 AM
in the markup it's an attribute
 
@goodmood this is easy
 
on the object it's a property
:P
 
@canon gets it!
:P
 
ok well anyways i know this: document.querySelectorAll("input[type='email']")[0].value; so i have to do same thing, get the value of the id, put that in where foo is for var elm = document.getElementById('foo'); and then i can get the target?!?!?:D
 
1:51 AM
why can't everyone‽
document.getElementById('foo').target
document.getElementById(document.querySelectorAll("input[type='email']")[0].valu‌​e).target
 
@rlemon oh my god :D
 
:)
 
yes, so how do people know the id though?:/ now thats an issue, and the email thing is a totally other issue, its for trying to restore and save username and password.. it works, just also fills in other search boxes like google.. lol
 
I know. i'm a master
 
`var forms = document.forms;
for( var i = 0, l = forms.length; i < l; i++) {
forms[i].onsubmit = function(e) {
if (value.length < 1 )
{ alert('Please select a date');


return false;
}

}
}`
 
1:54 AM
@MaxHasADHD do you have multiple elements with the same id?
 
no
 
@goodmood omg
jsfiddle.net please provide us with your html and you attempt at js
 
@rlemon well its not me, its websites. so i have multiple javascripts that check different things and it will replace the text fields with the value of the email
 
@MaxHasADHD example html please
 
@goodmood you'll need to target the element inside the form
 
1:56 AM
@rlemon im writing it , wait pls
 
i need the javascript for a app, so i dont know the id to get the right element to get the target. its just a url clicked, so the only thing i know in the code is the url the user clicks, now i need to check if that url wants to open in another tab or not. so i have to get the element by touch location i guess?
 
document.addEventListener("click" function(e) {
  if(e.target.nodeType === "A" && e.target.target) {
    alert(e.target.target):
  }
}, false);
 
not sure if starting with event delegation is the best way to make the concept clear.... but yeah :D
 
> if ( "<?php echo $userid ; ?>" == 0 )
no
 
2:00 AM
document.addEventListener("click", function(e) {
    console.log(e.target.nodeType);
  if(e.target.nodeName === "A" && e.target.target) {
    alert(e.target.target);
  }
}, false);
 
javascript (in most cases) is executed on the client side
 
fuck i'm too drunk to be helping people
 
the javascript parser will just go WTF on your PHP stuff
 
if (
var forms = document.forms;
for (var i = 0, l = forms.length; i < l; i++) {
    forms[i].onsubmit = function(e) {
        value.length < 1) {
        alert('Please select a date');


        return false;
    }

}
}​
WTF?!?!?!?!
 
@rlemon :)
u nice rlemon i like you :)
2
 
every field gives 3 alerts succefuly
 
it's not checking for anything
it just alerts the values
 
eh it hates me, thanks for help:]
 
FFS, it's 4 am... one last cigarette
 
@GNi33 thats the spirit!
i think i need to goto bed
<plug type="shameless"> codepen.io/rlemon/pen/jurIw </plug>
 
2:09 AM
dammit, robert! don't make me play around with codepen now!
 
:P
night yall
 
good night. i'll hit the bed too now, see you
 
2:25 AM
CURRY
in my belly
 
 
4 hours later…
6:03 AM
hi good mor9ing
Current Format is like this 09/14/2012
I want like this 2012-09-14
:/
 
6:47 AM
To whoever flagged @FlorianMargaine's comment: It's not "not constructive" (by any definition), it's absolutely correct. HipHop's static compiler, HPHPc, translates PHP code into C++, not C#, and then seamlessly compiles C++ with g++. — Yannis Rizos 10 hours ago
Epic win! ^
 
Hi there
 
can't we report people like her?
@LilKimNews, Alpine, NJ
Tweeting everything about the QUEEN of Hip Hop, @LilKim. FUCK YMCMB, blocked by @NickiMinaj, @ScaffBeezy & @BirdMan5Star.
41.8k tweets, 17k followers, following 515 users
 
7:05 AM
Ahoy hoy
Anyone there?
Well if you are there, I've got a quick question
I'm currently using
<body onload=setInterval("someFunction()", 50)>
 
it's baaaad
 
That's what I was thinking
So what's a better way to continuously initiate a function call?
Ideally without screwing with the markup
 
window.onload = function() {
    setInterval( someFunction, 50 );
};
 
Seriously? It's THAT simple?
head-palms
 
in your js code though
 
7:10 AM
lol, obviously
Many thanks kind sir
 
then yeah, it's that simple :-)
@monners I like your profile ;o)
 
Umm, thanks...
It's pretty basic :S
 
> I've taken it upon myself to put my degree in psychology to good use. Trouble is, the price of admittance for technology fields is a familiarity with, well, technology. I have no formal training, but I'll be damned if that's gonna stop me from becoming the best web designer/developer that I can be!
that's the spirit!
 
Oh, lol
 
fwiw, spending time in this room has been the best training I ever got about javascript
 
7:12 AM
also, sometimes setTimeout can be preferable to setInterval:
var loop = function() {
someFunction();
setTimeout( loop, 50 );
};
window.onload = loop;
 
That's been my experience so far, although people can be a little short at times.
What're the pros/cons of both methods?
 
that keeps your loop iterations from stacking up when the page is inactive
 
setInterval doesn't wait for the function to complete, which may run the next iteration too quickly if your function takes more than 50ms to run
it's usually worth thinking about if you have ajax calls usually, that's pretty much it
 
if an uncaught error occurs with the setTimeout method, it's never getting called again
which could be a pro or a con
 
Ah, that'd be why I saw my error numbers heading skyward when I was testing
 
7:23 AM
RT @mapagella: Now that vertex and fragment shaders are supported within CSS I highly recommend you to read this: http://www.lighthouse3d.com/opengl/glsl/
RT @stevefaulkner: stats- web sites using ARIA http://trends.builtwith.com/docinfo/WAI-ARIA top sites using ARIA http://trends.builtwith.com/topsites/WAI-ARIA #ARIA
RT @arnog: CSS Filters in Edge Animate… Awesome… http://blog.terrenceryan.com/combining-edge-animate-content-and-css-custom-filters/
 
Hmmm, I foresee a potential problem. I'm using a summation loop to set the 'rotate' value of an object. Is there a limit to the range of values that 'transform: rotate()' can accept?
I know that's not strictly a js question, but if you know...
lol, that being said, it's already past 40,000deg, so I guess not
 
hm
you know, you shouldn't have to use over 360 as value
 
Well, I guess I could reset the value when it reaches +/- 360
If it'll make more sense, I can quickly upload the example to my remote server and show you?
 
not sure I'll have time to look, but why not
 
Hi
 
I have a quick question : I am reviewing a buggy Javascript code a coworker wrote, and I'd like to be sure of something : Is there a point of storing a dictionary in the localStorage instead of using its native dictionary structure ?
 
o.O
I couldn't tell ya. But why would you need to? Validating the spelling of words?
 
hi all im new to javascript i have a small query
i wana to add class to DIV whn i click on a button in another place
will this work ?
function clickme(){
var set2 = document.getElementById('set2');
set2.className = 'set2move';
}​
 
My coworker uses localStorage.settings['some key'] instead of localStorage['some key']. I'd just know if there is any valid reason for that ?
(and there is no other key in localStorage)
 
hey guys how can I populate data and declare gridview using Javascript?
 
7:37 AM
please help me with javascript basic question jsfiddle.net/ajinkyax/b6mt8
 
@STEEL You could do that pretty easily with jQuery
 
i wana to do with javascript only, homework
pls guide me
 
Don't ya have to create the class attribute and append it to the target element before you can change it?
 
<style type="text/css">
#set1, #set2, #set3 {width: 100px; height:100px; border: 1px solid #333; position: relative;}
.set2move{top:100px; left:200px; background-color:red;}

</style>

</head>

<body>

<div id="set1">Box1 - <a href="#" onclick="clickme()">Click</a></div>

<div id="set2">Box 2 - Move
<br><br>
<a href="#" onclick="moveme()">CLOSE</a>
</div>

<div id="set3">Box 3 - click</div>

<script>
function clickme(){
var set2 = document.getElementById('set2');
set2.className = 'set2move';
}​
pls help
 
8:00 AM
@ereOn so that all settings are stored in a single key? might be more semantic, but definitely not the best solution since localStorage stores values as strings
@STEEL 1/ fix your html
2/ don't add javascript code to html
3/ links have a default behavior (linking to another page), you have to prevent it if you want to use it for another purpose
 
but why javascript is not working ?
 
Because you haven't disabled the default link behaviour me thinks
Yep, the javascript's working fine. It'
s the event trigger that's screwing it up
 
But how do I run the function onclick ?
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>

<style type="text/css">
#set1, #set2, #set3 {width: 100px; height:100px; border: 1px solid #333; position: relative;}
.style1{top:100px; left:200px; background-color: #960;}

</style>

</head>

<body>

<div id="set1">Box1 - <input type="button" value="Click" onclick="toggleClass();"/></div>

<div id="set2">Box 2 - Move
<br><br>
<a href="#" onclick="moveme()">CLOSE</a>
@monners But my query is I want to run that function from a button only, how do I do it ?
 
Gimme a mintue
minute*
 
8:19 AM
okay
 
8:32 AM
0
Q: object detection in bitmmap javacanvas

user1538127i want to detect clicks on canvas elements which are drawn using paths. so far i have think of to store elements path in javascript data structure and then check the cordinates of hits which matches the elements cordinates. i belive there is algorithm already for thins kind o cordinate search. re...

 
@monners found any solution ?
 
There were a couple of problems. First, one of your functions wasn't defined. Second, all of your links were directed to the current page, so that undefined function was trying to execute no matter what link you clicked on. And third, you hadn't disabled the link's default action.
@STEEL you said this was 'homework'?
 
yes, thanx it works :)
 
So a teacher specifically asked you to get a link to behave this way?
 
8:43 AM
if the teacher sees the code there, he might learn something
 
Now you're just showin' off
 
not so much actually
 
I know I know, was just messin'
 
removing inline javascript and using addEventListener shouldn't be showing off :(
 
^^
 
8:46 AM
and that's caching: jsfiddle.net/b6mt8/81
 
quick question... how to disable a single <option> in a <select> ? and then re-enable it.... I was able to disable it via selectBox.options[3].disabled = 'true'; but am not able to re-enable it selectBox.options[3].disabled = 'false';
 
disabled = false
@ShyamK by using 'true' or 'false', you're setting a string, not a boolean
use true and false, you'll be fine
 
oh... crap... didn't notice that
thanks @FlorianMargaine
 
and since 'a' == true... it thinks .disabled = 'false' is actually .disabled = true
 
thanks again :D
 
8:55 AM
I don't understand why this doesn't work jsfiddle.net/b6mt8/82
 

« first day (713 days earlier)      last day (4250 days later) »