« first day (362 days earlier)      last day (4597 days later) » 

1:00 PM
I will however tell you that you should learn ES5 before you do node
A rough guide would be knowing 80% of the content on the JavaScript Garden
 
Raynos, Im intrigued
whats your background?
own startup?
or Mozilla evanglist?
or similar perhaps?
 
Im no mozilla evanglist
I'm a node evanglist
I'm a student.
I want to found a startup within 2 years
But I need to grow in competence severely before that happens
 
a student as in late teens and early 20s ?
 
22.
 
cool, I have my own startup
about Fashion
www.coutallure.com
 
1:05 PM
Looks like either you can do design
or you know someone that can
 
no, I am a finance analyst by profession
working in fashion retail
so thought I have an amazing idea
so here I am
Im learning JS because we are short on capital and I've decided to help with the js coding
our application is html5
 
can I ask an HTML-CSS related question?
 
Yes you can
OO JS might be of help
 
I am a total newbie in HTML. I sliced a PSD in Photoshop and make it HTML. However, I have a problem, one of the table rows has a dynamic content. And when this row gets higher my other columns get corrupted and showing white spaces. How can I solve this problem and prevent showing blank or white spaces in other columns?
 
1:22 PM
I wouldnt know
Any auto generated HTML is a pain in the ass
and I refuse to deal with it
 
thanks .. what do you sugest?
 
thanks
 
MDN Learn html might be more friendly
 
1:42 PM
6 messages moved to bin
 
2:00 PM
39 messages moved to bin
 
yay!
what is all this cowbelljs stuff about?
 
cowbell is a slang term for jQuery
implying that using jQuery is bad. It is
 
ah, I get it.
 
2:23 PM
not gonna lie the jQuery hatred scares me a little :? I still like throwing it in if I am doing a lot of AJAX requests.
 
I use jQuery when I need to
 
ok as long as thats still acceptable then Im fine with it :P
 
until I finish the DOM-shim I will probably use it
Of course when I need to
is defined as when I need to support IE8
 
bleh yeah.
 
Spare time hacking !== supporting IE8
 
2:25 PM
we just got FF here!!
but its not madatory for users yet.
so exciting to potentially one day not have to support IE at work
since we are on an internal network
 
@Loktar by got FF
do you mean FF 7 or FF 3.6
 
its v6
 
Paul Irish is a dick
just sayin :P
 
@JimSchubert I know
There was another article
 
2:27 PM
22
A: Best way to detect that HTML5 <canvas> is not supported

Paul IrishThis is the technique used in Modernizr and basically every other library that does canvas work: function isCanvasSupported(){ var elem = document.createElement('canvas'); return !!(elem.getContext && elem.getContext('2d')); } Since your question was for detection when it's not sup...

 
@Raynos I wish Microsoft would quit trying to keep up.
 
^ My statement comes from that and how he treated @AndyE
 
There was a recent blog :\
it was better then paul irish's IE[x]
 
@Loktar He's a dick because he's succinct? That's not very fair.
 
He downvoted andys answer I think thats dickish.
and has an argument in the comments.
idk just tarnished his character in my eyes.
 
2:32 PM
Meh i agree with @Loktar
There is nothing wrong about AndyE's answer
 
@Raynos You'd prefer an answer that works differently in IE than one that works the same across all?
I'm not defending the guy, I just think that when you have more logical insight into an answer and outwardly share that insight, it doesn't make you a dick.
 
Sorry
how does it work differently in IE/
Clearly window.HTMLCanvasElement works in IE
It's simply that arguebly paul's method is slightly more future facing
 
does it work in IE6/7 though?
 
Trolls?
IE6/7 returns false
Like it should
 
I guess it would work :x
 
2:36 PM
yes it does work
paul irish is just being a pedantic dick
 
also note comment by @AndyE "interesting that the IE team posted on their blog today, showing both my method and your method as good examples of checking for <canvas> support"
 
I have trouble telling the difference between ignorance and trolling
 
Pretty sure we all do.
 
Some people don't actually know some things and other people are actively trollbaiting
That's the roundabout way of saying i expected you to know better!
 
2:42 PM
:'(
Some people enjoy the art of discussion and mean no harm by 'trolling'
 
haha I just watched the trailer for that movie on Sunday
looks so terrible. Cover is misleading! lol
 
No it's fine.
I seriously have problems with gauging how much people know about javascript or the host objects
 
@Loktar I think there are 4 of those movies. They are as horrible as you might imagine.
 
I watched trolls 2
waste of time
 
2:58 PM
@Raynos , well , i am pretty bad ad javascript in general and my colleagues at work suck at it
 
@tereško but your competent
also why dont you learn javascript :\
I mean who does your js?
If your bad but are the supremum of your coworkers
then well :\ your js must suck
 
"trollbaiting" == "playing devils advocate" (note the coercive comparison)
 
I play devils advocate a lot
I also troll a lot >_>
 
lol
 
But my definition of troll is different
Argueing about things out of my depth of knowledge is considered trolling for me
and a lot of things are out of my depth of knowledge
 
3:01 PM
The difference, of course, is intent. Trolling is malicious, playing devil's advocate is benevolent (IMO)
 
I have a bad habit of learning from stackoverflow rather then from personal experience
 
@Raynos Hah, I know what you mean
 
Its good
 
heh .. i learned css from freenode's #css channel
 
I treat stackoverflow as wikipedia
 
3:02 PM
not the most forgiving environment
 
accept things without reading references
Stackoverflow should force more references
@tereško your good at css & php but why is there no environment for you to learn js?
 
@RyanKinal And accusing people of trolling when in the midst of discussion is hurtful.
 
@JimSchubert Good point
 
@JimSchubert apologies.
 
It's dismissive
 
3:04 PM
@Raynos ain't no thang
 
@Raynos well .. can you suggest any ?
 
3:18 PM
lol, my streak continues. Every question I've gained rep from on programmers has been closed.
 
> If you like Java and can’t get yourself to like JavaScript, you program Dart. If you like Ruby and can’t get yourself to like JavaScript, you program CoffeeScript. If you like JavaScript, you program JavaScript. 2ality.com/2011/10/dart-launch.html
An epic win for 2ality
 
Indeed
 
user1385191
3:43 PM
I tried to drudge my way through setting up google dart last night
 
user1385191
oops, no windows support
 
@tereško node.js
 
@Raynos node.js is good for learning server-side JavaScript. I would think it'd be very confusing for someone who doesn't have a pretty solid foundation in JavaScript to begin with.
 
It forces you to learn javascript
 
stop using Dart guys!!!
 
3:49 PM
it forces you to learn modular code and javascript architecture
 
its a trap!
 
I kind of assume he knows javascript
node.js encourages proper architecture
 
@Raynos that is very debatable. Even Ryan Dahl says he wishes he didn't choose CommonJS's module pattern.
 
Meh specifics
the implementation of the modular loading system is a bit iffy
 
here's that interview for anyone interested: bostinnovation.com/2011/01/31/…
 
3:55 PM
But the require API isnt that important
Its the whole modularization of code
and structured javascript that you dont get in the browser
 
I agree modular code is important.
But, most people who move to node.js come from the browser. I haven't met one person who has never used JavaScript before and wants to learn on node.js.
 
Agreed.
I still think you learn more js from node then from the browser
 
hey can anyone help me with this?
http://stackoverflow.com/questions/7748625/jquery-colorbox-and-js-email-validation-integration
 
I agree, I learned a lot from node.js :D
 
$("#botonsiguiente").click(function () { // ATTACH CLICK EVENT TO MYBUTTON
$.post("/envioypago-prueba2.php", // PERFORM AJAX POST
$("#frmSS11").serialize(), // WITH SERIALIZED DATA OF MYFORM
function(data){ // DATA NEXT SENT TO COLORBOX
$.fn.colorbox({
html: data,
open: true,
iframe: false // NO FRAME, JUST DIV CONTAINER?
});
},
"html");
});



How can u add email validation to that?
 
4:05 PM
Good morning campers
 
@david o/
 
sup @raynos, check this out, javascript with <br /> tags! stackoverflow.com/questions/7756958/…
 
...
 
0
Q: Javascript reliance an issue for mobile optomised sites?

user793011Im mobile optimising a site with media queries. As I understand mobile browsers are generally quite modern and can handle CSS3 etc well. So does this mean javascript reliance for the mobile version isn't too much of a problem? I know how to find stats on desktop users with no js, are the same s...

 
DAMN THIRD PARTY SOFTWARE
 
4:29 PM
@RyanKinal agreed
 
I was sitting weird for 4.5 hours straight. When I stood up, I fell over. Don't judge me.
 
Jim thats perfectly normal
 
My seat at work is one of those business chairs that is meant to look professional and high-quality, but probably cost $25 at Target.
 
u can pass out if u are not pushing blood to ur legs for a long period of time, u were lucky and im not jk it can happen
 
whaaat
i need to run my own nameserver?
this is stupid
 
4:39 PM
@david for what?
 
i registered a domain name
actually that might be kinda cool...
 
Tom
Anyone knows why require.js doesn't seem to cache my modules? As in, when I require a module twice it seems to be also run twice, rather than just returning the already loaded module in the node.js-way
 
Because require.js is trolls
Maybe if you require jQuery twice you want two versions of jQuery \o/
$ === $; // false FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF---
 
in my system jQuery !== $ :D
 
4:55 PM
@david is this because you have prototype and jQuery on the same page
 
nope
it's because $ is jquery scoped to a specific subset of elements on the page
 
Oh
$.sub() ?
 
yeah
 
does the return keyword alone (e.g. without false) do anything?
if I just use return; will that exit function?
thanks for response
 
It returns undefined
 
5:08 PM
ah
so it doesnt exit function?
 
(function () { return; alert("Booya"); }()); //undefined
Why wouldn't it "exit" the function?
 
your right, I dont know what I was thinking
 
user1385191
fun with linked lists:
 
If you see an exit sign, you exit. Doesn't matter if it's exit to highway or to the endless abyss
 
5:09 PM
thanks for response
 
Enjoy
 
5:19 PM
I have code:


<html>
<head>
<script type="text/javascript">
function showUser(str)
{
if (str=="")
  {
  document.getElementById("txtHint").innerHTML="";
  return;
  }
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
    document.getElementById("txtHint").innerHTML=xmlhttp.responseText;
Each time I choose a different user from dropdown it shwos that user's info
how can I change this so that when I choose a different user the info displayed from previous one is not deleted
 
user1385191
feature testing axiom #1: never use if/else for detecting multiple feature cases
 
user1385191
instead, use an if/else if/else (do nothing) pattern
 
user1385191
if(document.getElementById)
{

}else if(document.all)
{

}else if(document.layers)
{

}else
{
	//do nothing
}
 
document.getElementById("txtHint").innerHTML += xmlhttp.responseText; ??
 
@MattMcDonald You supporting Netscape and IE 5 now?
 
user1385191
5:22 PM
it's an age-old example
 
document.getElementById("txtHint").innerHTML += xmlhttp.responseText; ??
 
rlemon it queries a php file that searches for the user you choose from a MYSQL DB
when PHP finds that user it responses with user info
PHP part is here if you want to se
 
I know what it does. Thats my solution
append the responseText instead of replacing the innerHTML contents.
 
oo
 
I'd like my else statement to notify users. Instead of getting nothing, they know what went wrong
 
5:24 PM
WTF kind of software doesn't support IE9? RAGE
 
@rlemon thanks!
 
GRRR wtf every second message of mine comes back as 'timeout' retry/cancel
 
that happened to me once
 
user1385191
you could throw an error if desired
 
user1385191
the pattern allows graceful degradation
 
5:25 PM
rlemon try relogging
fixed it for me
 
But, well, isn't it sort of obvious? What other way is there?
 
thank you for validating what I already know :)
 
user1385191
that site is really annoying
 
The article is decent though
Okay, we’ve seen in that out-of-flow AJAX example how a setTimeout-loop doesn’t act on a strict schedule, but gives even slow tasks a breather, whereas setInterval is a relentless bitch. Let’s have a look at how this works with in-the-flow actions:
hmm block quote fail
 
@rlemon that works but now the only problem is that when more and more users get added each one gets an email and phone number label added above their name
<?php
$q=$_GET["q"];

$con = mysql_connect("egerg","User","Jpswfw3");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("UserLogins", $con);

$sql="SELECT * FROM PersonInfo WHERE id = '".$q."'";

$result = mysql_query($sql);

echo "<table border='1'>
<tr>
<th>Email</th>
<th>Phone Number</th>

</tr>";

while($row = mysql_fetch_array($result))
  {
  echo "<tr>";
  echo "<td>" . $row['Email'] . "</td>";
  echo "<td>" . $row['PNumber'] . "</td>";
  echo "</tr>";
  }
echo "</table>";
 
user1385191
5:33 PM
mind the whitespace on block quotes
 
because of the table,
 
user1385191
any line breaks will foul it up
 
@Loktar I love how he automatically assumes the reader uses jQuery
 
since that php script gets called each time onchange is called that table gets added too
 
I'm reading all of these 'install guides' for node js, but they assume i'm hosting the server.. How do I install and run node js from a third party host?
 
user1385191
5:34 PM
> Okay, we’ve seen in that out-of-flow AJAX example how a setTimeout-loop doesn’t act on a strict schedule, but gives even slow tasks a breather, whereas setInterval is a relentless bitch. Let’s have a look at how this works with in-the-flow actions:
 
user1385191
did you add the space after >?
 
ah no :? I thought it was the | not the > lol
 
> Yippie! formatted
 
>[space]Something something. Also, be sure to remove new-lines
 
user1385191
yep
 
5:36 PM
> Won't
work.
 
user1385191
that's what I meant by "line breaks"
 
@rlemon where are you hosting it?
 
@Nadal, i don't understand what the problem is (i'm sorry), please re-word
@JimSchubert iPage
 
@rlemon each time I change the drop down the user gets added right...But they get added with in a new table...not the same table...also, I can keep addign the same user over and over....Ill show pic
 
@rlemon have they told you that they support node.js? Why don't you use heroku or something specific to node.js hosting?
 
5:44 PM
@JimSchubert, Ok so they do need to support it, someone told me the other day that I shouldn't need any special requirements from my host. I thought I had to be missing something
 
@Nadal, ok I understand now. Give me a minute.
@JimSchubert, Ok so they do need to support it, someone told me the other day that I shouldn't need any special requirements from my host. I thought I had to be missing something
 
CAM
Yo what up my peeps?
 
@rlemon someone lied. They need to install node on the server for you. You could check with them to see if they'll do it, but its doubtful.
 
CAM
I have a geolocation Q legalmarijuanadispensary.com do you think they are using Gmaps JS v3
i see their scripts are pretty intense
 
5:48 PM
@rlemon here's instructions for running a node.js app on heroku: devcenter.heroku.com/articles/node-js
 
CAM
but I have a site that i am building and I want to display markers based on current location, and I have a DB of members that I can grab Coords from
 
just be sure to run heroku env to see environment variables. Generally, when you're listing for incoming http traffic, e.g. in express, you'll have to do something like app.listen(process.env.PORT || 3000); or whatever port you might use for development
 
ugh, this has been happening to me now for a few days. Chat is super laggy with updates and most of my messages as telling me "timeout"
i've relogged, restarted my browser, cleared my cache, nothing.
 
does it happen in all browsers?
 
5:55 PM
haven't checked. FF is my go-to browser of choice.
 
if I leave the chat going for a few days I seem to end up getting a massive mem leak
and have to reload the tab
 
I'm in FF 6.0.2
Seems pretty snappy.
 
user1385191
it's been pointed out that jQuery's AJAX method has a memory leak
 
it's ok 90% of the time. ugh, I can't even repo without spamming the room.
 
user1385191
not sure if they're using it
 
6:02 PM
you could try the test room
 
well, I apologize if I double post, i've noticed some times it says timeout but the post has gone through.
 
I thought you were just really thorough with your replies.
 
@MattMcDonald Well, it depends at what level you just assume support.
 
 
1 hour later…
7:08 PM
I'm dealing with single elements and arrays of elements all over my code.

function hasClass(source, className) {
//.. if source.className.contains(className) return true else return false
}

Would it be useful to extend this such that source can be an array of elements, and if one failed all fail?
I don't have a use case for that, just wondering what people think .
 
you could just do a foreach over the array and call hasclass in that
actually there is something other than foreach that you're meant to use for that...
basically what I'm getting at is that you don't want to extend that function
 
user1385191
Array.prototype.filter builds an array from elements that return true from a callback
 
@rlemon I'd say no. That's what [].filter and [].every is for.
 
yeah, every is the one i was thinking of
_.all works too if you're using underscore.js
 
7:16 PM
Ok cool, thanks.
One of those times where I was looking at it, it didn't make sense, but better to get a second opinion
 
do you understand the right way to do it rlemon?
 
i'm not going to.
 
if (elementArray.every(
    function(element){
        return hasClass(element, 'classname');
    }
)){
    alert('yay');
}
 
thats a nice elegant approach.
 
'every calls callbackfn once for each element present in the array, in ascending
order, until it finds one where callbackfn returns false. If such an element is found, every immediately returns
false. Otherwise, if callbackfn returned true for all elements, every will return true.'
 
user1385191
 
user1385191
work your way down
 
@MattMcDonald I saw that page not too long ago, then I couldn't find it again. Thanks for sharing it.
 
7:44 PM
 
user1385191
when a button and a closure can't get the job done...
 
buttons are nowhere near as much fun
 
I can't stop clicking those.
 
change the .click to .mouseover for even more funs
 
Tom
What'd be the optimal jQuery syntax to remove all li elements in an ul list except for the last one?
 
7:56 PM
var ul = document.getElementById('myUL');

while (ul.childNodes.length > 1)
{
	ul.removeChild(ul.firstChild);
}
</troll>
 
anyone familiar with AnythingSlider, a JQuery plugin by Chris Coyier?
 

« first day (362 days earlier)      last day (4597 days later) »