« first day (971 days earlier)      last day (3977 days later) » 

1:01 PM
@FathahRehmanP if it's a JSONP API, that's done by inserting the script element by your main script
jQuery can do that behind the scenes for you
 
I just came back from eating at a German restaurant. Man, that place was the wurst.
 
note that JSONP is pretty bad, and you should suggest they implement CORS instead
@Neil at least you're not hungary now.
 
@JanDvorak - i think its JSONP API. can you please show how to do that
 
button.addEventListener('click', loadStuff, false);
function loadStuff() {
  var script = document.createElement('script');
  script.src = "some url";
  document.head.appendChild(script);
  this.removeEventListener('click', loadStuff, false);
}
 
@JanDvorak Could have had a light Turkey sandwich
 
1:03 PM
@Neil you better czech for a better place to eat
 
@Sirupsen Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
@JanDvorak I know, but I was Russian to get something to eat.
 
Can anyone explain this behavior? I'd expect it to look up the prototype chain for the method, and then execute it. eval.in/33532
 
@Neil Norway you guys are still doing this joke?
 
@Sirupsen look up the difference between prototype and __proto__
 
1:06 PM
@Jan
@JanDvorak any recommended resource?
 
@Sirupsen I've just found this:
28
Q: What is the difference between __proto__ and prototype in Java script?

0x90 This figure again shows that every object has a prototype. Constructor function Foo also has its own __proto__ which is Function.prototype, and which in turn also references via its __proto__ property again to the Object.prototype. Thus, repeat, Foo.prototype is just an explicit proper...

 
@rlemon I'm Finnished
 
@rlemon, I know right, it's getting a bit Sicily. Over
 
@Sirupsen Because you set Circle.prototype to be a Shape, not a Shape object. You probably meant Circle.prototype = new Shape
 
Potato ~ Latvia
 
1:07 PM
Also, as a tangent, I don't recommend this type of design.
 
@Zirak What'd you do instead?
 
anonymous classes FTW
 
@JanDvorak oh? Do you mind sharing?
 
@Zirak sharing with the whole room?
 
Yeah tell us! Over.
 
1:08 PM
@Sirupsen Actual, explicit prototypical inheritance.
 
Why is this bad design?
 
Look into Object.create and object composition
 
Ok. Thanks.
 
People y u no correct such titles?
 
man, so does anyone know anything similar to appjs?
 
1:10 PM
@OctavianDamiean, what do you mean, over?
 
I can just do it via the browser / local node instance.. but I would like to have a nice little application for them
 
@phenomnomnominal The question title. Over.
> What is the difference between __proto__ and prototype in Java script?
 
what are you making @rlemon?
 
@OctavianDamiean Ah, copy that old sport. Over.
 
it's a monitoring / reporting program for temperature cable systems
 
1:12 PM
Anyway, I've got to leave for now. Out.
 
there was something else I tried a few months ago... /me thinks
was along the same lines as app.js
 
literally, there is a service that will run once a day that will sweep some cables (via serial comm) and I need to store the data in a db, and show it in a nice GUI / w options et al.
 
If any of you haven't seen this yet: cubeslam.com Over.
 
currently written in c# .net winforms but the client doesn't like only-windows.
 
hmm I cant remember what it was called. But idk, I've had the most success with QT
 
1:13 PM
!!/summon 31719
 
QT has an example app called fancy browser
super easy to modify and insert your own html/css/js ect
 
@phenomnomnominal You know, every time I watch movies where military say something like over and out, I cringe a little.
 
people, im looking at (VIMEO API) just wondering what the f is on this line
$f(iframe)
there is no reference to it
 
@phenomnomnominal this is stupid and ugly
lol I kid, this is really cool :P
 
@OctavianDamiean, roger that, 10-4. Cheesy comms chatter, over.
@Loktar, impressive as hell right? And if you share the link, you can do 2 player over WecRTC. Over.
 
1:15 PM
@phenomnomnominal Affirmative. Out.
 
Well its really cool looking, but not to come off as a dick in anyway.. but its freaking pong :?
thats my only gripe
people keep making these cool things, but crazy simple gameplay
 
should have made it battle tanks
 
@Loktar Dude ... it's pong against a fucking bear!
 
@rlemon yeah
 
Come on ...
 
1:16 PM
seriously, battlezone clone would be cool
 
BATTLE TANKS!
make bears ride the tanks
win/win
 
^
 
lol they seem super talented
 
1:17 PM
just weird theyd clone pong
 
end boss
 
I like bears, they're kinda like huge dogs.
 
haah thats awesome @rlemon
 
1:20 PM
ferrofluid
 
posted on June 13, 2013

var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); try { var pageTracker = _gat._getTracker("UA-3727700-1"); pageTracker._trackPageview(); } catch(err) {} 24 more days to get in on the new gamebook!

 
@JanDvorak Shut up! DARK MATTER!
 
Hi I want to wrap a div over group of p tags that has image
 
1:21 PM
I tried
find('p:has(img)').wrap(' <div class="column"/>').end()
 
 <div class="column"/>
^ don't ever do this
 
Why ?
 
HTML is not XHTML
 
because 1) divs don't self close
2) it's a bad way to make elements period
3) because some guy on the interwebs with more fake points told you to
 
also, column is a dumb class name. Over.
 
1:23 PM
@rlemon: Jquery warp will close it
 
@gowri after going through like 1000 ops
 
@gowri so?
 
when you know what the fuck you want it to do
so why would you make the lib try to figure it out.
 
$("<div>", {class: "column"})
 
also it makes you look (from the code reviewer stand point) like you don't know what's really going on
 
1:24 PM
<p><img></p>
 
I assume that, or "I'm a hipster"
so, for you benefit. don't make elements that way
 
I wish we could take away peoples rep points. Over
 
@rlemon There's very little difference between doing something stupid in code despite knowing better and simply doing something stupid in code
 
not mah reps
 
@phenomnomnominal you can
 
1:25 PM
@phenomnomnominal We can
 
<p><img></p>
<p><img></p>
<p><img></p>
<p></p>
<p></p>
<p></p>
I have element like this
 
It's an img of a p!
 
I want to wrap a div over group of p tags that has image
 
@phenomnomnominal I will take away your nose if you don't tell me what the heck is going on with the over today. :D
 
1:26 PM
Can I take away 3000 rep from gowri? 471 feels like a more appropriate number. Over.
@copy I think posted a video. Over.
 
@phenomnomnominal 1500 downvotes
 
Ah , yea that episode. :D
 
!!/daybreak
over
 
@rlemon That didn't make much sense. Use the help command to learn more.
 
1:27 PM
:O
 
@phenomnomnominal: I don't know y you wan to downvote
 
Didn't catch that @OctavianDamiean, over.
 
<div>
<p><img></p>
<p><img></p>
<p><img></p>
</div>
 
!!/learn daybreak '<>http://www.youtube.com/watch?v=XXvuUp-KY5g'
 
@rlemon, memory got deleted I think, over.
 
1:28 PM
@rlemon Command daybreak learned
 
@phenomnomnominal I'm aware of that hilarious episode. Over.
 
@gowri $("p:has(img)").wrap("<div class='column'>")
 
@OctavianDamiean, Loud and clear, I'm going to keep doing it til I get bored (which may be a while). Over.
 
@JanDvorak: it's just wrap of each p tags that has image
I want to group it
 
wrapAll, then
 
1:30 PM
@McKev Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
I keep confusing the two
 
@phenomnomnominal Solid copy. Over.
 
Looking for assistance filtering multidimensional array
 
Don't confuse wrap with rap, which creates a hip rockin' beat
 
Bye. I'm over. Over.
 
1:31 PM
@OctavianDamiean, need to come up with call signs, over.
 
Object.getOwnPropertyNames(jQuery.fn).forEach(function(n) {
  var supaName = n.substring(0,1).toUpperCase() + n.slice(1);
  jQuery.fn['supa' + supaName] = jQuery.fn[n];
});
best plugin ever!
$(elm).supaHide();
 
@phenomnomnominal Will think about one and get back to you. Over.
I'm oscar mike now. Out.
 
@rlemon $(elm).supaSupa();
 
Hi. cancelBubble is like stoppropagation for IE
but jquery docs only use stopPropgataion
 
@OctavianDamiean Roger that oscar mike, I'm tooti-frooti and reading you loud and clear, over.
 
1:33 PM
what about IE ?
 
@phenomnomnominal oscar mike means I'm on the move. Over.
 
@JanDvorak: You are SUPER MAN :)
 
@RoyiNamir jQuery normalizes it all to stopPropagation
 
@OctavianDamiean, that's confusing, would be a good call sign. Out. (Over).
 
So, they implement stopPropagation for all browsers
 
1:34 PM
like KEY.which thing ?
(normalized)
 
I'm not sure what you mean
 
(instead of keycode etc....{just use X.which}) ?
 
Ah, yes.
 
@JanDvorak: I never knew wrapAll, Thanks for pointing
 
oh . thanks. I didnt knowthey "modified"this object ( EVENT object)
 
1:35 PM
No problem :-)
And it's not really that they've modified the event object. It's that they've created their own event object that wraps around the actual event object.
 
how come ?
I have this element :
<span ... onclick="alert(Object.prototype.toString.apply(event))" ...>
and the result when click is [object MOUSEEvent]
not [object Object]
 
Because you're using onclick=""
And it's the devil
 
So are you talking about the [e] in the callback ?
*.on('click',function (e){});
?
 
yes
 
so you're saying that when its get called to this function it is wrapped ?
 
1:41 PM
The jQuery event object will only be passed to event handlers that are (surprise!) applied with jQuery.
 
haha
yeah , in the callback it's [object Object]
So how come it's still working for me when onclick ?
 
Because you're in a browser that supports stopPropagation?
 
oh...
 
you should not be surprised that a cat has the holes in its coat where its eyes are located
2
 
@jAndy o.O saywhat?
 
1:44 PM
@RyanKinal So if I wanted to implement stoppropagation with pure onclick , I couldn't do that ?
 
probably better now :p
 
@jAndy Nope, still confused.
 
@RyanKinal nah wanted to be sarcastic about your "jQuery passes the event object..." line :P
 
(Without *.on('click',function (e){});)
 
to cucumbers... pickles must be like mummies.
 
1:45 PM
@rlemon Okay, I get that one
@RoyiNamir Right. But you don't want to use the onclick attribute anyway.
Seriously. Don't use the onclick attribute.
 
Becuase of the [event] support of different browsers ?
 
when i give this code in my side then it's show 5 post in one time but i want it's show one bye one
<?php query_posts('category_name=wordpress&showposts=5'); ?><?php while (have_posts()) : the_post(); ?><li><a href="<?php the_permalink(); ?>">
<?php the_title(); ?>
</a> </li>
<?php endwhile; ?>
anyone can help me?
 
@rlemon nice motion detection demo, I was pretty surprised when I saw the code.. its so.. not much [nuff!]
 
@RoyiNamir Because it mixes JavaScript with HTML, and you want to separate your concerns as much as you can.
 
oh ok
Thank you +1.
 
1:47 PM
Also, @rlemon will hurt you.
 
:-)
 
Anybody having problems with this MDN page?
 
oh come on... I just didn't know that the event arg of the callback is not the same as the global event obj...:-)
 
Just kidding. We tend to discourage bad practice with idle threats.
 
2:03 PM
0
Q: Best practice javascript objects

user1503606I am basically looking for Critique on the following code as i know its not the best and i am trying to find a set way of building javascript objects. Be brutal as you way its a learning tool for me, basically i am pulling in a twitter feed via json and adding it to the dom. var TwitterTimeline...

 
@handy, thanks. I was also surprised.
 
2:15 PM
handy is @Jandy on my cell phone
boss: Rob, go buy me a new computer
me: What do you want it for
boss: Working
me: Ok, well what types of things do you want it to be able to do?
boss: Connect to my keyboard and mouse.
o_O .... I see...
@RyanKinal you might be kidding... but i'm keeping a list...
 
Who was it that was checking for uuid collisions in node? Zirak? What did you use for your collection?
 
2:32 PM
@rlemon is the muscle, @zirack is the brains, @shmiddty is the confidence man
I would make a terrible confidence man, I hate people and I'm bad at lying
 
bash help: why is bash ignoring the end of my line?
(after the 1>)
 
Okay i amma make a snake game :D
lets brush up canvas :->
 
@FlorianMargaine doesn't sed normally need a -e arg to supply a sed command on the command line?
 
PS anybody has cc2e on pdf ?
 
@Alnitak nope, when I copy the line in the shell it works perfectly fine
plus, I can't use the i option
# sed -V
GNU sed version 3.02
 
2:44 PM
Is $SETTINGS_FOLDER set in the script, or exported from the parent environment?
 
set in the script
and it's perfectly finely set in the first time
$SETTINGS_FOLDER/$vhost 1> $SETTINGS_FOLDER/$vhost
what's before the 1> is well set, not what's after :|
that's really weird
maybe it's related to a special character?
what's even weirder is that the file is empty after this sed
 
that's not weird - that means the 1> worked, but sed didn't
 
how come bash -x doesn't show it then?
 
anything on stderr?
 
Okay guys.... do we have some resources about DOM ? as in video tutorials and etc ? Dont link mdn i need for absolute beginners
 
2:48 PM
0
Q: Embed literal html inside of bbcode

bbcode GuestI'm not sure if this is possible, because it may pose a security risk if it was possible BUT - I have embedded HTML I copied from http://www.tickcounter.com/. Quite simply, I'd like to make this countdown show up using BBcode as I'm restricted to bbcode. the embedded html looks like: <div id="...

 
@Alnitak nope :|
 
@Darkyen document.write('I canz hack teh DOM?')
 
@Alnitak lol
i dont want for myself :-P , i want for somebody whose trying to learn and is too low on SO
but phone called me asking for it
 
oooh, I have new behavior.
... building a pastebin
 
@darkyen someone else... Right...
 
2:53 PM
:P
yes
 
@Alnitak what obvious thing did I miss? pastebin.com/ZXXPVqaf
 
hahah
@FlorianMargaine did you figure it out, or are you asking me?
 
I'm really asking :(
 
you're overwriting the input file
before you read it...
 
then I should > tmp.conf && mv tmp.conf original.conf ?
 
2:55 PM
yes, or use "inplace" editing (without redirection to stdout)
 
you mean sed -i ?
13 mins ago, by Florian Margaine
# sed -V
GNU sed version 3.02
I wish I could...
 
use perl -pi instead then ;-)
(back soon)
 
3:15 PM
how can I use sed with perl?
I should learn perl.
 
@FlorianMargaine ew :P
 
back
 
nah, honestly, perl looks great every time I need it.
and it's just available everywhere...
I'm working on a 2000ish server, sed is an old version, yum isn't available, but perl is already v5.
 
your sed line can just be replaced (AFAICR) with perl -pie 's/.../' and it'll work
or maybe perl -pi -e
 
3:18 PM
something like that
 
@RyanKinal ?
 
yeah, perl -pi -e 's/...//;
see man perlrun
 
beep
 
I think this is an interesting question. I don't understand why it was closed. — Benjamin Gruenbaum 6 secs ago
 
@BenjaminGruenbaum should be on programmers.se
@Alnitak thanks
 
3:22 PM
Maybe, maybe I should ask it there myself
 
$1000 later, now time to put it all together.
 
I feel like $1k gets a lot more than mouse and keyboard support
 
Corsair CX500M PSU
win7 pro
cheap asus dvdrw
Vengeance blue 16GB(4x4)
Gigabyte GA-Z77X-UD5H
i5-3570
WD black 1TB
OCZ Vertex 4 128gb
some generic mini tower.
 
That's 1k?
 
Why a mini tower?
 
3:29 PM
sounds a little expensive for that lot
 
@ShotgunNinja it's a 'mid-mini' it's a mid tower really.
 
Also, you did get cooling equipment for the CPU, right?
 
and the bulk of the price was
i5 - 220
windows 7 - 150
mobo - 180
 
@rlemon Would probably get a previous generation, faster intel processor. Maybe a 2700K or something similar? Not sure how thy fare against each other
 
3:31 PM
$220 for an i5? Jeez.
That's not a bad case though.
I like simple cases.
 
Yeah, the I7-2700K pretty much rips the i5-3570
The big advantage of the I5 is the GPU, I'm guessing that won't be an issue.
 
@BenjaminGruenbaum yea but at my local shops it's ~110 more for the i7
 
Really? It's a generation older.
 
yup
 
yeah but people see i7 and think it's worth more :D
 
3:34 PM
does anyone know if doglas crockford has ever done a video talking about node js
 
@Connor He mentions it a few times. Mostly saying how awesome it is, and how he regrets Yahoo! didn't pick it up.
@rlemon That's odd. ~110$ more is an i7-4770K , Why would a 4770K and a 2700K cost the same o_o?
 
@BenjaminGruenbaum good, just trying to find out if node.js is good or bad, there seems to be the same amount of people who think its good than those who think it is bad.
 
@Connor It's a tool in your tool set, it's an extremely good tool for some use cases and an extremely poor choice for others.
It's definitely a technology worth learning
 
The smoke seems to be clearing out, so hopefully the fire is dying down.
 
@Shmiddty wat
what fire?
 
3:45 PM
@ShotgunNinja wildfire in colorado
 
hello! everybody hope you doing well. Please i need help over here if you please. i have this link lasiestajersey.com and am trying to navigate with pages with ajax am new to ajax its my first time and have no idea how it works.

here's my code for the ajax

$(function() {
	//row-fluid page
	// #primary-menu a

	$(".home li.home").removeClass("home").addClass('.current_page_item');

	var
		$mainContent   = $('#wrap'),
		siteURL        = "http://" + top.location.host.toString(),
		$internalLinks = $("a[href^='"+siteURL+"']"),
 
@Shmiddty didnt realize you were in CO
man you guys burn down every year it seems
 
what am doing wrong here or how can i make it works, thanks!
 
Just kidding. Don't go there.
 
@Loktar yeah, it's ridiculous
I can't remember the last year that there wasn't a fire.
 
3:48 PM
@Mahmoud I'd stay away from using $.ajaxSetup(), you can do everything there with just the standard $.ajax() or $.get() call...
 
@Shotgun thanks for answer. to be honest i even have no idea what am doing so this why am asking. thank you
 
@Mahmoud Have you looked through the jQuery online documentation? That's where I'd start.
Warning, you may actually have to read some of the documentation before using the function properly.
 
i read it but am pretty confused in my case :/
 
Well, are you trying to access an AJAX hook on an external site, or just an internal AJAX hook?
Do you know how AJAX works, actually?
I'm just trying to figure out how much you know.
 
its my first time ever to use it
 
3:53 PM
Okay. You are aware that you will need some kind of system on your server to provide the AJAX with meaningful data?
 
simply what am trying to do it. navigate the pages without reloading because there's a song plays auto. so to navigate the pages with loading it will make the song re-start over and over.
 
@Mahmoud ಠ_ಠ
Why in the hell do you have a song that plays automatically?
That shit is extremely annoying.
 
@Loktar CO?
 
In order to actually use AJAX, you need to have the server generate parts of a page upon request, so that you can take those parts of a page and fill them into the existing page using Javascript.
 
its not my own website dude. i know its shit but should i kill the client :)
 
3:55 PM
oh, Colorado.
 
@Mahmoud Well, do they have server-side scripting or code on their site?
How is it built?
 
WP
 
Fuck.
 
:)
 
Yeah, good luck, dude.
That's about the time I'd find a new client.
 
3:56 PM
Cheers. thank you matt
 
That being said, if you really want help, one way would be to make a bunch of static pages with JUST the content, and use AJAX to request those pages and fill a blank <div> with the entirety of the retrieved files. It's dirty, but it'll work.
And you don't have to futz with Wordpress' terrible PHP code.
 
lol
Are we really having a discussion on which is faster? Performance would be meaningless in this case (Or do you intend to run over 30K arrays with 100 elements through it every second?). If you're worried about performance, all three options are very slow compared to a native loop by at least a factor of 10. — Benjamin Gruenbaum 4 mins ago
 

« first day (971 days earlier)      last day (3977 days later) »