« first day (1524 days earlier)      last day (3429 days later) » 

9:01 PM
@SterlingArcher not unless you pass it to the other frame. Events are isolated between frames, it can break menus and stuff pretty easily.
 
@Luggage Could you come up with an example that has multiple ajax calls within callback 1, where the last callback within callback 1 is called before callback 2?
 
@rlemon I really like the Zirak humor sprinkled into Caprica
@rlemon Will it still bin if I edit to unonebox?
 
Maybe I'm asking the wrong question, though. It feels like I'm doing something wrong with how my ajax calls are set up
 
yes :?
I will patch that tho
right now it just starts the timer and doesn't care what happens to the message past that
 
9:07 PM
@NathanJones yea, it's all .thens all the way down
 
@Luggage @NathanJones technically not required. look at github.com/caolan/async
use async.parallel with a callback that is callback 2
 
async is nice... but it's just poor-man's Promises
 
@NielsAbildgaard I love async.js, but jQuery returns Promises, not node-style callbacks
 
@Luggage Well, jQuery returns "Promises".
 
9:13 PM
right.
 
@Retsam I think that's down to opinions.
 
I'm gonna store credit card information in localstorage
 
@Luggage fair enough
 
@NathanJones Link is above. What i've been doing in my samples is using the jQuery ajax events like "Promises" Look up Promises. You'll use them lots.
 
@NielsAbildgaard Oh, of course it's opinion, I'm just giving mine; but I find Promises to be both more powerful, more readable, and more concise than callbacks.
 
9:16 PM
@NickDugger Why?
 
I was kidding, but I think it'd be funny
 
Promise vs node-style callbacks is an opinion. Trying to use async.js with promises is objectively a bad idea that'll confuse.
and I LIKE async.js
 
Sounds like something Paypal would do
 
I'm also gonna set sessionid's as url parameters
 
9:20 PM
hey guys, what directory do you put your Angular directive template code in? partials/ maybe?
 
/recycle bin. use knockout instead.
j/k. :)
 
let me try to rephrase my problem: I'm working on a JS-only project for a proprietary framework that uses it's own tag system to expose data through embedded snippets of SQL (much like PHP, but much much worse). I have 3 tables (a,b,c), b is a 1:1 relation to a, c is a 1:M relation to a. So, in order to get an object that represents the relevant data from tables a,b and c for a single record, I'll have to make 3 ajax requests.
To make matters worse, in order to know which records in b and c, I need to know the result of my query against table a
 
@NathanJones You can do that.
 
If I have to learn another Javascript framework, test suite, library or plug-in my brain is going to explode
 
That's why I have 3 nested ajax calls
 
9:22 PM
just use the results in each .then to call the next one, gethering the data as you go.
That you describe is the intended use.
 
Setting up my code the way you did in your last fiddle, thens all the way down, I enter callback 2 before 1
 
is this code too sensitite to paste in a pastebin/gist/whatever?
 
@rlemon <3
 
@KendallFrey <3
 
Now why the fuck do you have a picture of Neil deGrasse Tyson making waffles?
4
 
9:25 PM
@KendallFrey ohh I didn't make that
sorry if I mislead you
 
@Luggage i don't think so. making gist now
 
@rlemon fair enough, but the question still remains
 
@Luggage gist.github.com/anonymous/4eda6400ff4e7da4c7c5 it's obfuscated, but hopefully that's enough for you
 
I see obfuscated code as just a challenge
am disappoint
 
I see challenges as obfuscated code
 
9:31 PM
The reason I'm using when.apply is I have 4 different "types" of datasets that all need to be called so I can just push them into an array without having to hard code them
but you guys prob already figured that out
 
> Kill problems, don't wound them
 
@SomeKittens sounds like that should be on defprogramming.com
 
euthanize all problems
 
> 2014: The Genocide in /bin
 
@NathanJones you aren't returning your nested .getJSONs
you need to return them so they chain.
 
9:35 PM
return .getJSON(...) or return the data?
 
return the $.getJSON
i'm also comign up with another example..
 
@Luggage adding returns fixed it. thank you!
 
I have a websites html data loaded into $data. How do I extract just the first innerHTML portion of the <strong> tag?
$data.prop("strong") did not work
 
define "first innerHTML portion"
 
text in html is <strong>Extract this</strong>
How do I pull "Extract this"
 
9:44 PM
.text()?
 
^
 
This is a classic case of jQuery use before basic javascript understanding
 
How would I use it?
 
The $.get data is stored in $data
 
9:47 PM
 
You're using jQuery?
 
user2620028
@taco you are a taco don't judge lol
 
Add an id to the element like this, then use that ID to identify the element. Then use the .text() attribute as mentioned by setting it to a var <strong id="extractMe">Extract this</strong>
@HatterisMad I'm not judging. I'm a noob myself
 
.
 
There is no ID and I cannot add one
and yes im using jquery
 
9:48 PM
.....
 
instead of an id, i want to use a tag
 
.........
 
user2620028
Yes monners?
 
0
 
9:49 PM
@Bijan then get a list of the span tags on the page, then grab the .text() from that one
 
You guys wanna see what I just made?
 
#splash
 
user2620028
Faaaaantastic.... @SterlingArcher lol thats exactly the website i needed to see
 
9:50 PM
@Bijan var allSpanTags = $("span"); //if i remember right
 
Everybody in the office is really excited and happy now :D
@HatterisMad what do you mean? It's a website to inspire hope, man
 
user2620028
You actually made that? Thought you were just kidding.
 
That's where I work dude ._.
 
Oops
 
9:52 PM
I just built the splash page for our donation matching event
 
user2620028
Ahhh your the one that works at the place with the sex crimes and the stuff with the stuff
 
Don't know what happened there. Must have leant on the keyboard
 
We don't handle the crimes, we offer support to victims
 
1 message moved to Trash
 
user2620028
I actually am working in a DCFS office so.... i guess we get the other part of the job :P
 
9:53 PM
@taco: SUppose the HTML code is jsfiddle.net/gqsbgbq6
How would I just pull everything in the <strong> tag?
 
I need help on angularjs please
http://stackoverflow.com/questions/27535933/ngroute-not-working-when-refreshing-the-page
 
user2620028
Bijan it is all in a javascript var or it is actually in html on the page?
 
@Bijan I'm gonna stop you right there... please don't concatenate HTML in strings. are you aware of document.createElement()`?
oh, wait, that may not apply here
 
9:54 PM
its html on the page
 
either way, good info to have
 
@Bijan append those elements to the document, and then use a selector. As is, that's a string and you'd have to regex it
 
I feel like this is an XY problem
 
document.getElementsByTagName("strong")[0];
 
I did $.get('URL', function(data) { var $data = $(data)) }
Well its not on the current page, its on another page in the same site
 
9:55 PM
$.get('URL', function(data) { var $data = $(data)); console.log( $data.text() ); }
 
@rlemon: This pulls all the text though
 
I'm sorry I haven't been paying attention
!!tell Bijan jQuery .find
 
Is there a way to select everything in between <strong> and </strong>?
 
god fucking damn
I spent way too long on this
 
9:59 PM
Now how would I use .find on the text in $data? $data.find("strong")?
 
try it
!!afk gif binner is running. hope that is okay
 
"[prevObject: o.fn.init[42], context: undefined, jquery: "2.1.0", constructor: function, selector: ""…"
 
@SomeGuy Stop doing things on goodreads, I'm being spammed
 
ohh, and everyone remember to sign up for todays draw.
 
10:01 PM
GIF
 
that hair is glorious
 
@rlemon \o/ Thank you for posting here!
 
@SomeKittens ok you found a bug
hrm. why didn't that trigger
 
@SterlingArcher Are you using JPEG instead of PNG for text? JPEG compresses text
 
ahh it doesn't trigger on replies?
I'll have to check that when I get home
hrm, got that one
just not the first one
 
10:03 PM
@taco don't judge me, but it's an image map
 
1 message moved to Orphan GIFs
1 message moved to Orphan GIFs
 
@taco: That helps me. But I am still unsure of how to pull data from my $data variable, not the webpage it is currently on
 
@SomeKittens ok so 66% success rate
!!afk home time
 
Ah, image maps. I used those in the 90's lol
 
bye lemonnnn
lol shut up
They work just fine :P
 
10:04 PM
@Bijan jQuery isn't for strings. You need to look into a Regular Expressions parser
 
'@taco: I am doing that now :)
What is the best way to match RegEx in a string and pull data
 
!!tell Bijan mdn RegExp
 
@Bijan Something went on fire; status 403
 
wat
Baaaad
 
user2620028
lol - someone just broke the capricorn
 
Oh my dear caprica ;'(
 
!!google blah
 
jsfiddle.net/gqsbgbq6/1 is what ive done so far
except i realize i cant use 'replace'
 
!!are you alive?
 
@AwalGarg Of course!
 
10:13 PM
o...k
 
@Bijan Read the first paragraph of what I linked you to
It has nice links to some interesting functions
!!mdn on fire!?
 
@Zirak Something went on fire; status 403
 
!!should I true or false?
 
@AwalGarg You should true
 
I can access mdn... :/
 
10:15 PM
/* callback */foo({"responseData": null, "responseDetails": "The Google Web Search API is no longer available. Please migrate to the Google Custom Search API (developers.google.com/custom-search/)";, "responseStatus": 403})
Fuck
 
duh
 
oh no
 
@Zirak: What would be the most efficient method then. I can use search to return the index #
 
@Bijan Do you want the index?
 
Today I tried to write one line of code, which can be faster than any other method presently used, and jsperf says that I succeeded. Either jsperf is broken, or not.
 
10:18 PM
Or maybe you want the match?
 
No, id rather have what it returns (So I want (\d+), i want to return the # of what it returns)
Match is better but it returns the whole line
 
Perhaps you want to exec a regexp
Look into what these return
@SomeKittens The cool thing is they returned it as a file named unicorn.txt
It's actually a good idea
 
@Zirak: jsfiddle.net/gqsbgbq6/2 I have to be close
 
@Zirak Just what the world needs - another online dating startup
I like the premise though
 
@Bijan Swap alert with console.log, hit F12
 
10:26 PM
OH i needed [1]
Fuck that was way more complicated than it needed to be
 
@SomeKittens The world is riddled with crappy or standard ones, this may be good
 
@Bijan jsfiddle.net/gqsbgbq6/3 you might not need to use regex :/
 
LinkedIn meets dating. I unno...
 
(I feel ugly to insert that data in a div, but...)
 
I cant use that. What I gave was a very basic version of what the page has,
it has to be regex
 
10:31 PM
@Luggage when I try to do basically the same thing in a loop, it's not staying in callback 1 before going on to callback 2. gist.github.com/nathanjonesicsd/a04423ca9beca0402c91
 
The same can be done with very very complex data.
 
@Bijan for the record, match works like that in other languages like php or python too.
 
Yeah i assumed it returned first match
 
It returns the whole match, then the group matches
 
@Bijan That's be weird, what if you have multiple groups?
 
10:35 PM
Let me know if you need more details
 
ecma doesn't even have named groups, too bad :(
 
@NathanJones are they being called in parallel?
 
@Luggage it looks that way. say there are two elems in resp.record, then on one page load it might show the order being 1,2,2,1 then another page load shows them being in 1,2,1,2, so I assume that's parallel...
I hope that made sense...
 
1,2,2,1 sohudln't happen
@NathanJones you still aren't returning the $getJSOM promise objects
 
...nvm
 
10:42 PM
so it's going to be out of order
 
@Luggage ack, sorry, i updated my code but not the gist.
@Luggage updated the gist
Should I be returning resp in the inner-most/phone getJSON callback? I would think no because it would return before the next iterations of the $.each loop completes
 
@Zirak SFW?
 
@NathanJones $.each is not compatible with promises. It'll fire them all but not wait for a response and not return it.
 
@NathanJones Some slightly NSFW images, but it's a good story
 
10:47 PM
I don't think it's your problem with out-of-order, though
 
How do you suggest I iterate over the first getJSON's results?
 
@NathanJones To make it safe for work, open console, [].forEach.call($$('img'), Function.call.bind(Element.prototype.remove))
 
@Zirak Interesting...I didn't know about $$
 
Promise.map.. but i'm looking for jQuery's equivelent if it even has one
 
@NathanJones It's a console shortcut for document.querySelectorAll, quite handy
 
10:51 PM
Can there be a security issue in hosting on local pc, a dev server at port 80? Just wanna show something to a person...
 
@Zirak is that just a DevTools thing?
 
yep
Of course you can define $$ to be whatever you like in your code
 
Last day in the office
Party time! burn everything
 
$.when() is the closest I see and it has strange behavior.
 
@monners whaaaaa
 
10:54 PM
We're moving to a new office
A nicer office in a nicer part of town
 
So I can't stalk you via Google Maps anymore?
 
@NathanJones I need to go, but you'r on the right track. You just need to be mindful that you are dealing with "Promises" and that you need a .each that will actually wait for all the promises that are inside it before it resolves it's own promise. Promise.all() if you were using a real promise library and not jQuery's very simple "Promise-like" value
Most/all promise libaries are compatible with jquery though.. you can add features.
they only need a .then() which jQuery does.
 
11:08 PM
How do I have a for loop run but run every x seconds?
 
setInterval
 
@Luggage okay, thanks a lot for your help!
 
How would I integrate that with a for loop?
my loop right now is... for(int i = 0; i < 10; i++) MyFunc(i);
I want to have it run every 2000millisec
 
I'll certainly need to learn more about promises, but for now, does anyone have any recommendations on a good promises library? something that does what @Luggage was describing?
 
@NathanJones bluebird is the standard answer.
 
11:27 PM
How do I make an element align right in flexbox (and all others on the left)?
nvm, got it
 
I need to blow off some steam....
think anybody ever does the following search first?
 
11:42 PM
a Texan!
 
if you're referring to me, it's not by birth LOL
 
have you been here before and I just missed it?
 
I'll take a guess. ummm. MI ??
 
no NY
my wife is from MI however
 
Whereabouts?
 
11:45 PM
I'm from Long Island, my wife from Flint
we've been all over though, Nebraska, Colorado, Tennessee, Georgia and now Texas
 
oh, downstate.
 
yes
my sister went to SUNY Buffalo
as far from LI as she could get
 
We got a ton of LI'ers in Oneonta (Hartwick/SUNY Oneonta)
 
i'm in Canada, there are three of us up here. it get lonely sometimes, but then there is hockey and poutine. so there is that.
 
we lived within 2-3 miles of SUNY Stony Brook but my sister wanted to get away
The Islanders are kicking a little butt this year so far, I'm a huge fan going back to their cup days
 
11:50 PM
For the first time in ten years, it's mathematically impossible for the Bills to have a losing season.
 
flexbox. is magic.
 
Yeah great game against GB
Yeah the first google result for Flexbox says "currently a W3C Candidate Recommendation" that's impressive
 
Also: Google Chrome team is pretty crazy about physical security
 

« first day (1524 days earlier)      last day (3429 days later) »