« first day (1007 days earlier)      last day (3956 days later) » 

3:00 PM
@ChrisJohnson 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.
 
it's to create a new scope so that your functions don't pollute the global scope
@Cygwinnian your function pollutes the global scope.
 
i know
 
i will shove it in the jquery scope
 
also, provide a minified version :)
 
3:00 PM
but for now its fine
and i will
 
Your definition of "fine" differs from mine
 
lol @Zirak
im sorry guys.
i was a bit lazy
 
@Amaan Ahhhhhggh I could not resist listening the whole 2:04m
 
probably a noob question, say you have a div and a dropdown. Some javascript is initially loaded into the div. However if someone changes the dropdown, a different javascript should load into the div. What's the easiest way to do this?
 
how do you load javascript into a div.
i'm also a noob and this technique is new to me
 
3:04 PM
hey guys
 
Yeah... "loading javascript into a div" isn't really a thing.
 
@RyanKinal precisely :P
 
fuck, it's batman.
hides
 
Where?
 
-->
 
3:04 PM
I don't see Batman...
 
next to the NSA o_O
 
OH SHIT IT'S BATMAN
 
does anyone deal with jquery here?
 
@Crowz Can you elaborate?
 
@ChrisJohnson we're all Zepto people
Zepto4lyfe
 
3:05 PM
@ChrisJohnson "deal with" is the proper term. And yes, I do deal with jQuery.
 
can I have custom alert message for different browsers?
 
@RyanKinal shhhhh
@name why?
 
I'm the last jQuery loverboi around
 
@rlemon Sorry, sorry, trying to be less of a dick
 
that implies UA sniffing which is generally a very slippery slope to go down
 
3:06 PM
how can he talk?
 
Remember that time Resig showed up in the room? That was interesting...
 
Today is crunch day.
 
@rlemon I want to show a message if user uses chrome browser only
 
@name purpose? just curious?
 
3:07 PM
@ChrisJohnson don't repeat yourself
 
@name Why?
 
1 message moved to Trash can
 
I'm dealing with jQuery... just $100 for 2g
 
@RyanKinal say you have a div called "graphDiv" and three javascripts, "graph1.js", "graph2.js", and "graph3.js". Then you have a drop down menu with options for each graph. When the user selects one, it will be loaded into that graphDiv
 
@rlemon i am sorry but i need the answer
 
3:07 PM
@jAndy you're getting ripped off.
@ChrisJohnson ASK THE DAMN QUESTION
 
@rlemon I couldnt fix a swf error in chrome only (I was discussing wid you yesterday!)
 
but be careful, this shit is serious, don't inject it
smoke it
 
@RyanKinal couldnt fix a swf error in chrome only, it works in firefox and IE
 
i am waiting for someone to answer my post
 
@name then fix the error ;)
@ChrisJohnson ask the real question, no one is going to answer your loaded question
 
3:08 PM
Flash is a dying format
 
@rlemon working on it till then want to have a temp fix to my website
 
@Crowz My suggestion would be to "load them into different divs" (whatever that means), and then show and hide the divs when menu items are chosen.
 
@Shmiddty what never was alife, can't really die
 
@name well how do you determine the fix doesn't work for Chrome? is there an error message? also can you show us the issue? I'm pretty sure it is not a big problem
 
3:09 PM
Flash was a real thing at one point
 
My project has generated sets of HTML elements to which classes later get added. I'd like to search in the sets to see if any element has the class span1hr followed immediately by an element that has the class span0hr, and if so, change both of those classes to span1hrfor30mins.
 
@name @rlemon makes a good point. Why aren't you asking us to help you fix the actual issue, rather than putting in a notification about an error?
 
4 years ago, most of the jobs I saw wanted flash experience
 
$('.span1hr + .span1hr')
@ChrisJohnson look up the ~ and + operators in CSS
 
!!s/\$/querySelectorAll/
 
3:11 PM
@RyanKinal querySelectorAll('.span1hr + .span1hr') (source)
 
:not(first-child)
 
@RyanKinal he started with "who deals with jQuery"
 
'strue :-)
 
@jAndy I listened to the whole thing too XD
 
@rlemon @RyanKinal I use django in backend heres my code jsfiddle.net/7y3TP
 
3:12 PM
Also, I lost the game.
 
POOT DAT COOKI DAUN !
 
ahhh i hate django
 
@name can I see not a hunk of crap?
i.e. a live website
or demo website
 
@Cygwinnian: It could be worse. imagine working with Drupal or any other PHP stuff
 
@rlemon i am using with two elements id 'row3' with the class .span1hr and 'rows4' with class .span0hr. i want to know how i can check on two elements with the classes to see if i can find the matches then change the class that match it on each row to change the class using with the loops?
 
3:13 PM
@name can't really 'debug' on that
 
@ThiefMaster what web framework do you use?
 
Flask
 
@ChrisJohnson your initial question was asking how to find elements bt only if they have siblings with a certain class no?
@ThiefMaster that is more of a lifestyle choice no?
 
@rlemon wizoku.com , you need to signup as a tutor :)
 
no, you need to provide me with demo login ;)
 
3:15 PM
I could use a flask about now.
 
one moment
 
Provided it's filled with whiskey.
 
Spiced Rum + a shot of gingerale
 
Rum
 
@ThiefMaster
 
3:15 PM
Rum is good too.
 
Get some kraken.
 
@ircmaxell: Are you trying to tell me something? :P
 
And release it into your mouth
 
How do I teach the bot to render a learned command with markdown? When I try inside the string, it gets parsed
 
3:16 PM
@ThiefMaster ?
 
@ircmaxell drop a new line and .*
 
@rlemon no i want to find on two elements with classes to see if i can find the matches then find the element with the class on each row and change the class using with the loops?
 
!!/learn irc **yoyo wuddup dog**
*
 
@rlemon Command irc learned
 
!!/irc
 
3:16 PM
@rlemon **yoyo
 
@rlemon Ahhh... Interesting
 
damn, that got changed.
 
Man... I should make a Caipirinha when I get home
 
@rlemon Command irc learned
@rlemon **yoyo
 
nope
ohh well @ircmaxell i'll play in the sandbox later and update you
 
3:17 PM
:-D Thanks!
 
@ChrisJohnson I'm finding it really tough to follow this.
 
@rlemon login:mail@gmail.com password:password
@rlemon the test class is not working for chrome alone
 
Hey. I am blanking right now. How do I take an item out of the middle of an array?
:-\
 
i have some functions in map.js that i'm trying to use in dashboard.js. this is in a node application but these are client side files. lines 117-129 of dashboard.js is how i'm doing it now but it just feels wrong. i'm trying to get some fundamentals down as far as sharing these functions.
with the setTimeout i can get it to work. without it i get a 'map not defined error' which makes sense.
 
@name there is a 404
 
3:20 PM
@rlemon eh?
 
0
Q: Feedback for my library's api and functionality

plleeI'm looking to get some feedback on how useful my library/framework is. I've put it on few sites and got some stars on Github but no feedback on whether it is terrible or not. I'm looking for some feedback on the api and functionality but any feedback would be great. I added a link to the sourc...

 
In this case, since row3 has a span1hr class and row4 has a span0hr class, I would want to change the class from span1hr to span1hrfor30mins. if each rows don't match it then i want to ignore it while find the rows that has row3 with a class span1hr and row4 has a class span0hr then find on row3 for each row that has span1hr to change it to span1hrfor30mins. how i can do that??

One additional complication: as you can see, I have multiple sets of row2 - row6 classes, and need to do this search within each set of rows.
 
@Neal splice
 
@FlorianMargaine thnx. just remember that one :-)
 
@ChrisJohnson best make a simplified fiddle for us to visualize the issue
 
3:22 PM
@rlemon i am sorry but i can't because it will be too large to post my code on jsfiddle
 
@ChrisJohnson that is why I said simplified
 
@rlemon his last question says it all...
 
If you have numbers in your IDs/classes, there's a good chance you're doing it wrong.
 
@name this is what i'm seeing in Chrome
 
I want to play a primitive mmo survival game. Hucking spears and Shit. Animals will have better ai. After they kill you, the start eating your corpse.
 
3:24 PM
@rlemon do you want me to give you an example what i am trying to do?
 
Panthers and Shit will stalk you
 
@rlemon I got it...
 
Fixed font plz
 
I like how my phone capitalizes shit
 
if($('.span1hr').hasClass('row3') && $('.span0hr').hasClass('row4'))
{
  $('.span1hr').each(function(i,e)
  {
    if($(e).hasClass('row3') && $(e).hasClass('.span1hr'))
    {
      $(e).attr('row3'); $(e).removeClass('span1hr').addClass('span1hrfor30mins');
    }
  });
}
here ^
 
3:25 PM
@Shmiddty That would actually be kinda sweet
Here's the deal: You make the game, I'll play it.
 
anybody play age of empires?
 
@Shmiddty Don't Starve is pretty fun
 
I guess it would be civilization, but first person
First expansion brings you to the bronze age etc etc
 
here is my deal: you make the game, I sell it.
 
@rlemon can you try it in mozilla
 
3:27 PM
that means I need flash..
 
@rlemon what the code supposed to do they will find the two classes with the rows, span1hr with row3 and span0hr with row4, then change the class span1hr to span1hrfor30mins. the code will change the class using with the loops without checking on two rows with the classes
 
Do we know any 3d artists?
 
@rlemon can you help to fixing my code?
 
@ChrisJohnson maybe, let me do some other shit then i'll try to understand your problem
 
@rlemon if you want for better understand am i allow to post the link of my question on this site?
 
3:29 PM
Mmossg (survival strategy game)
 
@Shmiddty can we kill other humans?
 
Of course
 
 
@ChrisJohnson Yes.
 
@rlemon I just added the header
@rlemon in chrome it doesnt work with header
 
@RyanKinal can you check my post on stackoverflow.com/questions/17657168/…
 
he always starts his answers with: "in layman's words:"
 
@rlemon can you check my post on stackoverflow.com/questions/17657168/…
 
@OctavianDamiean ermergherd the laptop should arrive at my relative's place today.
 
works in Chrome for me
@name I can tell you have issues with offsets because the spinner is NEVER center
 
3:33 PM
@ChrisJohnson Did you just link them to a comment on why you can't post anymore
 
lol
 
There's nothing any of us can do (I'm a mod and even I can't do anything to lift your ban). stackoverflow.com/help/question-bans
 
@rlemon I tried wid some chrome browsers its not working, what is the spinner?
@rlemon can u see the header in the chrome in test class?
 
@BoltClock no sorry i don't
 
Chrome left, FF right
 
3:36 PM
@rlemon Ugh. Windows.
 
and spinner === loading icon
 
@rlemon its great, whats the spinner?
 
@FlorianMargaine get VS working for me in Linux
i'l gladly switch.
 
Virtualbox.
 
@rlemon mono
 
3:36 PM
there is mono.net now?
 
Well... idk
 
I used to have VS Ultimate in a virtualbox, using a shared folder.
worked flawlessly
 
you all still fail. I target windows, I dev in windows. I target a web server, I dev in whatever the hell I want
 
@FlorianMargaine So you're basically telling him to use Windows. In a VM
 
@BoltClock still better than windows on direct hardware
 
3:37 PM
@rlemon can you please help me with my jquery code?
 
fuck that
I have like 6 PCs in my office.
 
he's not using windows, he's using linux and vs in a vm
 
@FlorianMargaine Really.
 
I don't like VMs if I can have dedicated hardware
 
^
 
3:38 PM
@ChrisJohnson read up where I said I will in a bit
i'm busy
 
@rlemon ok no worry
 
@rlemon its weird, I tried in three different computers using chrome it doesnt work
 
@name version? Os?
 
I have so many anti-IE comments on my pro-IE answer it's funny
 
is chrome caching anything?
 
3:41 PM
41
A: How do I target only Internet Explorer 10 for certain situations like Internet Explorer-specific CSS or Internet Explorer-specific JavaScript code?

BoltClockInternet Explorer 10 does not attempt to read conditional comments anymore. This means it will treat conditional comments just like any other browser would: as regular HTML comments, meant to be ignored entirely. Note, however, that conditional compilation in JScript is still supported, as shown...

 
Also, consider moving this to canvas / HTML
 
@rlemon version is 28.0.1500.7, i tried windows and mac both
i cleared cache too
 
strange. you can see the screenshots I posted.
looks the same in both for me
 
what should I move into canvas / HTML
 
all of it
flash is cumbersome
 
3:45 PM
ok
 
I realize that is quite a task. but if you are going to be further developing this, html5 allows for it to be done flash free.
 
I am using scribblar API need to check if they allow it to do in html5
 
and i'm sorry I can't help debug further :P every thing seems to work for me
well the API I imagine returns XML or json
so the short answer is: yes.
 
thanks a lot :)
 
3:49 PM
@Zirak That is an excellent answer
 
it is adding bloat to the processing... not that it would be noticed, but Neals comment is still kinda valid. however his use of the .click alias is equally as silly. — rlemon 15 secs ago
Neal you are a troll.
bitch about .each then use .click alias
don't be a tool
 
oh damn it, image didn't go through
 
This isn't remotely funny. — Rayne Dec 23 '08 at 7:02
 
@rlemon It's been established that his javascript knowledge is actually very poor.
 
3:54 PM
.click alias and .onclick alias directly call .on('click', - you have added useless bloat. — rlemon 9 secs ago
 
@rlemon I just copied and pasted the OP's code morons...
 
no your comments are moronic.
 
@Neal eh it smelled like a witchunt
 
also, complaining about the .each bloat is moot - the other methods being used are WAY more expensive than .each
bitching about it just makes you seem toolish, considering the other code in play.
 
@rlemon like what?
 
3:58 PM
So... why not $(theButtons.join(', ')).on("click", ...)?
 
@Shmiddty why not? but then he would not get the array index of the button in question in the alert.
 
jQuery.each is a lazyloop
it is literally a for loop
 
@Neal why would he need the index?
 
so the bloat added there vs the $() lookup and the event handling is moot point
 
@Shmiddty Did you read the question? stackoverflow.com/q/17750163/561731 <-- he is alerting the array index
 
4:00 PM
If it wasnt tagged jQuery and the OP didnt use jQuery in his example your downvote would be warranted.
 
@Neal right, because that's OBVIOUSLY his end goal.
 
But you were complaining about the use of jQuery in a question that had jQuery..
 
@Shmiddty Who am I to know that?
 
.each only has one major problem. argument order.
 
4:00 PM
@Loktar arrrg....
 
it is actually quite performant
all i'm saying is that you bitched about the most performant slice of jQuery he is using
 
Ok. Sorry
 
instantly makes me think you have never looked at the source code, and therefore are just jumping on the "no jQuery" train
 
^
 
Oh I use jQuery all of the time.
 
4:02 PM
0
Q: Jquery ajax loader and messy if else statements?

vimes1984Ok, I have written the following but I am sure it can be done better, my two main worries here are the awful use of the if else statements in the check variables and the usage of setinterval to set the i variable. my problem with the i variable is that the check's run after the i has been set for...

 
lol I love ninja's comments
Wow this question has the most amount of answer with down votes I've ever seen... — defaultNINJA 12 mins ago
 
Also @Loktar you don't just downvote out of "spite" that is not how the Stack Exchange works. if you find the answer correct you upvote, wrong downvote -- otherwise nothing. Keep the complaining crap to chat and/or meta
 
qq
his answer worked fine as well and you downvoted it.
 
@Loktar How do you know I downvoted anything??
All I made was a comment
 
He didn't downvote out of spite, he had a reason.
 
4:05 PM
^
 
Im man enough to comment when I downvote
alpha downvoter.
 
I didn't downvote, I just call out BS where I see it
 
reps not counted on closed questions is it?
 
It is
 
'course it does
 
4:07 PM
ah ok wasn't sure.
 
Also, one time I did actually downvote every other answer to a question after answering it myself. I also upvoted the question
 
lol
I rarely downvote at all tbh
 
@jAndy Is that a guido douchebro standing next to you with the hairsplosion?
 
Good morning from the Bay Bridge!
 
@Shmiddty no it is Sonic
 
4:11 PM
anyone pageY || offsetY || y ?
 
what is the question
 
:innuendo:
 
@xManh 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.
 
what if any of the values are 0, this will step to the next.
only stars for connor sucking
@Shmiddty you are getting strange....
I'm going to have to warn my GF for the next time she sees you on Diablo
 
@rlemon like December?
-webkit-margin-before: 1em;
-webkit-margin-after: 1em;
-webkit-margin-start: 0px;
-webkit-margin-end: 0px;
-webkit-padding-start: 40px;
wut.
 
4:20 PM
Yeah. WebKit is strange like that
 
user1596138
This may sound stupid and small-minded at first.
 
nah, that sentence is fine.
 
user1596138
Does anyone else get annoyed when sites like Wikipedia are always asking for donations?
I know they need money. But that's what ads do for online businesses. Why can't they just run a few non-intrusive ads down the side? Surely with the traffic they have they'd be on top in no time.
 
user1596138
I don't mind ads at all when they're needed. And in Wikipedia's case I think they are.
 
@Jhawinsss wikipedia isn't a business
 
4:24 PM
Because they're an encyclopedia, a hub for knowledge; ads don't belong there.
 
user1596138
Poor wording on my part. But you get what I meant I'm sure.
 
Including ads admits failure
 
^ what zirak said
 
It's strafing from their goal.
 
user1596138
Including ads is not failure. Non-intrusive and relevant ads are a good thing.
 
4:25 PM
It's not much different from the money I donate to planned parenthood every month
 
It's definitely a failure, because if they need the ads to stay alive, then apparently people don't care enough. And it is a failure because, again, encyclopedias shouldn't contain ads.
Because they're not a business, they can be idealistic.
 
@Jhawinsss on a fundamental level, you are wrong. Ads are information polution.
 
user1596138
For example. We are a print-publication based solely on music. So on our (shitty) website we run ads for local music venues/performers only. It isn't spammy, and they don't take away from the functionality of the website, or distract from the content.
 
user1596138
Obviously the venue that can afford to run a $1,300+/week ad in our paper and online is one of the nicer venues. I'm not sure if that's how everyone else sees it, but that's how my head works.
 
4:27 PM
Again...you're not an encyclopedia. You're not a place where people go to learn things from how a dung beetle rolls to how to make a warp drive.
 
user1596138
@NagaJolokia Perfect! I was looking for something like that. I'll read through it for sure.
 
Schools don't contain ads.
Universities don't.
 
user1596138
@Zirak Schools take my tax money, they don't need ads.
 
But we aren't talking about practicality, we're talking about ideology.
 
user1596138
@Zirak Universities over-charge students to get the money they want.
 
user1596138
4:29 PM
I can see where you're coming from though.
 
Again...not ideology. If you tell a tenured professor you're going to put an ad on his web-page, he'll decapitate you.
 
user1596138
@Shmiddty This on the other hand I don't agree with in any way. Ads are not information pollution by any means.
 
Because more money > less money, right? That's only practical, so why not hang posters on school walls so they'll get better labs and sell school-books at a cheaper price?
 
user1596138
@Zirak But again, his University has money coming from elsewhere, and is a University. Wikipedia is an online only source of information.
 
To the University's treasurers it might also be a business, but to that professor it's a sacred ground of knowledge.
 
4:33 PM
I'm gonna check out of this conversation
 
user1596138
I see a University very differently from Wikipedia, though.
 
I've got shit to do.
 
That's the result of business-ification. Higher-education is about education, it should be free. The fact that it's not is disconcerting.
5
 
Very disconcerting.
 
user1596138
A University has actual cash revenue from students on campus. I can go to a University and spend my physical money out of my wallet.
 
4:35 PM
If a lady with 8 kids who lives in the slums wants to get a degree in applied physics, she should be able to.
Without all this extra bullshit on scholarships or what have you
 
user1596138
@Zirak This is true. Although I don't think it should be free. That just isn't possible. It shouldn't cost half of what it does though.
 
Again, ideology, not practicality.
 
Hey all I was hoping to get some other minds on a google maps API issue I am having. Anyone quite versed in it??
 
Wikipedia is an ideological foundation
 
user1596138
I can understand your point of view. It makes sense. But there's a grey area in my mind that overlaps with running ads. Just wanted another opinion.
 
user1596138
4:37 PM
@matt Not at all. What kind of problem are you having?
 
o/ good morning folks
@matt i'm also working through it, what issues are you having?
 
Can I post a link to my question on here? Is that allowed?
 
user1596138
@matt Absolutely.
 
user1596138
1
Q: Geolocation service failed on Mobile with google maps api

mattI am using the following script on my site: <script type="text/javascript"> var map; function initialize() { var mapOptions = { zoom: 3, mapTypeId: google.maps.MapTypeId.ROADMAP }; map = new google.maps.Map(document.getElementsByClassName('map-canvas'), mapOptions); var km...

 
user1596138
This one?
 
4:40 PM
Its driving my nuts.
Yes thats it.
Thanks @Jhawinsss
 
@jhawinsss how did you link the question like that?
 
lol
 
@matt where are your nuts going?
 
reminds me of an old pirate joke.
 
@Samuel The chat has an FAQ: chat.stackoverflow.com/faq
This one's in the formatting.
 
user1596138
4:42 PM
@Samuel Posting only the link to a question will "one box" it. It also works with pictures uploaded to imgur. See the FAQ here
 
lol.
SO yeah everything should be fine, but on mobile its just not geo-targetting.
 
@jhawinsss, @zirak thanks guys, I guess I had only scanned through the rules when it came to what no to do :P
 
@matt what is the value of errorFlag?
er
 
Im not sure.
 
figure it out
 
4:45 PM
ah the reason why I was never able to look at the faq is because for me the link is not working
it just returns me to the javascript rules page
but correct me if i'm wrong, if I post code in a separate message with fixed font selected the code will be formatted, correct?
 
@Shmiddy im not even sure where I would start on that, im a newb to google maps api and not very versed in JS
 
function handleNoGeolocation(errorFlag) {
  if (errorFlag) {
    var content = 'Error: The Geolocation service failed.';
  } else {
    var content = 'Error: Your browser doesn\'t support geolocation.';
  }

  var options = {
    map: map,
    position: new google.maps.LatLng(60, 105),
    content: errorFlag // <---- change that right there.
  };

  var infowindow = new google.maps.InfoWindow(options);
  map.setCenter(options.position);
}
 
One sec
thanks btw.
 
user1596138
@FlorianMargaine I bought one. We'll see what the boss says when he comes downstairs to find a plastic dog humping his MBP.
 
@Shmiddty ok I aded that in, let me pull it up on mobiile.
@Shmiddty please excuse my newbness but that did not seem to do anything, I added "errorFlag" in place of "content" it still pulls up the error "The Geolocation service failed." breifly.
 
4:54 PM
clear your cache
 
I tested it on a incognito window.
let me try another browser
 
doesn't incognito block geolocation...?
 
no it still asks you
 
mmk
 
4:57 PM
on browser it works, on my iphone its still doing the same.
let me try another phone.
 
/afk smoke
 
OK....its asking me for use of my location, and im giving it access but its not zooming in...
 

« first day (1007 days earlier)      last day (3956 days later) »