« first day (1502 days earlier)      last day (3440 days later) » 

user1596138
6:00 PM
If in 20 years when I am CEO of the world everything I said in here comes back to kick my ass.... I'll schedule a press conference and just smile :)
 
user1596138
 
user1596138
Koding has some features that I wouldn't mind seeing on a desktop OS
 
@someDoge hmm
 
@someDoge Some features? Or a feature? :P
 
user1596138
@SecondRikudo There are more. :P
 
6:14 PM
by the way, with regards to the contributors army... I don't really have enough time these days to organize it. If anyone wants to take it up, I'd be glad. Basically, the easiest way is to go on codetriage.com and pick a decent js project.
 
user1596138
> Minimum RAM required : 4 GB
System RAM configured : 0.97 GB

Minimum number of processors required : 4 cores
Number of processors on the system : 1 cores
 
user1596138
Hell yes this is going to work great
 
hey guys, i am new to this chat room. can we ask our problems here or is it a room for a general discussion?
 
@ShubhamNishad 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.
 
user1596138
@ShubhamNishad Go right ahead
 
6:22 PM
@someDoge knowing how annoying multi-level dropdowns are, my only response to this is: for fuck sake !
 
I am trying to find out how to send an image here?
 
user1596138
@tereško Nah. Not annoying if you fucking do it right lol
 
user1596138
@ShubhamNishad Paste the image URL (no other content in the message) and it will "onebox" like above. Otherwise use the "upload" button next to the "send" button.
 
I am trying to upload an image with AJAX and I get JSON response in return from the server
 
can someone tell me when this onchnage event is not firing on a drop down list however if i place it in an inline onchange event it works

 var maritalStatusButton = {
    		onchange: function(evt){
    			maritalStatusChange();
    		}
    };

    dojo.on = function(){
    	dojo.connect(dojo.byId("maritalStatusId"), "onchange", maritalStatusButton, "onchange");

    };
 
6:26 PM
but I can't access the response
data.errorcode or data.filename
it says undefined
nothing works
 
user1596138
@ShubhamNishad Because that data is not on the global scope.
 
user1596138
You can set a breakpoint in your callback for the XHR, or you can store the response somewhere in the global scope where it will be retained.
 
user1596138
You can also just go to the sources panel and view the response there though
 
user1596138
Err, "Net" panel in firebug
 
LUNCH
!!afk suckers
 
6:28 PM
let me try
 
user1596138
@SterlingArcher you haven't even been here?? Hahaha
 
@someDoge That's that special agent training for ya
 
6:42 PM
Question:
I have this array:
arrayName = ["Apple","Banana","Orange"]
And I want to change "Banana" to "Grape"
Don't I just do
arrayName[1] = "Grape";
?
 
you can
 
That's what I thought, but My code wont lemme do that
 
!!> var a = ['apple', 'banana', 'orange']; a[1] = 'grape'; a;
 
@FlorianMargaine ["apple","grape","orange"]
 
user1596138
!undo
 
6:44 PM
@someDoge "ReferenceError: assignment to undeclared variable arr"
 
hey everyone, quick dumb question, but given a latitude and longitude, is there an easy way to generate a google map?
 
@corvid use the google maps api
 
user1596138
Dammit Florian you can help everyone :P haha
 
22
Q: How to get the Google Map based on Latitude on Longitude?

Gnaniyar ZubairI want to display Google map in my web page based on longitude and latitude. First user want to enter longitude and latitude in two text box's. Then click submit button I have to display appropriate location in Google map.And also I want to show the weather report on it.How to do that? Thank You.

 
can you just format a url to work?
 
6:46 PM
@someDoge nah, I just write faster than you :P
@corvid look at the link Deep just gave you
 
user1596138
Ugh. I thought "Hey Koding is actually useable now" and went to see the VM options...
 
same, ive spent the past 16 mis trying to boot my VM
 
user1596138
 
user1596138
Are they retarded?
 
user1596138
I'm not going to pay $10/month for 7gb of space...
 
6:48 PM
digitalocean is the best
 
user1596138
 
type "chosenWord" into the console to see the word
 
user1596138
@ShubhamNishad Yeah I just would rather pay flat rate still. I have cost myself some money on DO by forgetting hahaha
 
Hmm, I use the koding free tier as basically a full-stack jsfiddle/codepen. It's been working out pretty well so far
 
6:51 PM
@FlorianMargaine See what I mean?
 
user1596138
@aphazel Same. I just wanted more power. Couchbase doesn't like having basically nothing to use
 
ovh also offer good service for less price.
 
user1596138
But no matter what it's just 1core, 1GB RAM, that's shit.
 
@someDoge I've been lurking lol but people need to know when I'm hungry obviously
 
user1596138
Ok, yeah Koding is still a broken mess.
 
user1596138
6:53 PM
Everyone is "a koding user" and half the links don't even have an href or JS event on them hahaha
 
@someDoge Yeah, I had to set up a 1.5gb swapfile just to be able to run 'npm search'... :/
 
user1596138
@aphazel Damn dude you must be something else if your presence can cause that kind of lag
 
Do you know whats wrong
 
@someDoge memory foam mattress my brother showed me this and I lol'd
 
user1596138
I'm dying subtly lol
 
7:01 PM
Any Takers?
 
I'll have some
 
The link above. Y no work? I can't see anything wrong with my code, and I have thoroughly abused the console for answers, all of which seem correct.
 
I'm not backtracking. in 25 words or less describe your issue
 
I'm attempting to overwrite a value in an array by going:
array[index] = newValue;
but the value doesn't seem to be being edited
23 words :P
 
Nitpicking, but that's not modifying an array value, it's overwriting it with assignment
 
7:07 PM
@Deep and what line do you change it on?
I just scanned the code and do not see it
 
line 41
loopArray[index] = guessedChar;
 
loopArray !== words
err, nvm I think I see it
 
because loopArray is a string?
 
bingo
well that, and it is actually assigning it
problem isn't with the assignment
 
do I wanna str .split("") first?
 
7:10 PM
split then join
 
console.log( loopArray[index] ); // _
oopArray[index] = guessedChar; // was 'a'
console.log( loopArray[index] ); // a
BUT
always consider this:
 
()
 
@rlemon but, strings are immutable in javascript... so the assignment, in fact, does not work :)
 
!!> var word = "apple"; word[1] = 'x'; word;
 
@rlemon "TypeError: 1 is read-only"
 
7:12 PM
@rzyns it assigns it to the property not the position
only in strict mode does it actually fail. otherwise it is unexpected behavior
 
BUT the assigment expression evaluates to the rvalue :)
@rlemon ahh, touche salesman ;)
 
in either case, he shouldn't be using the string as an array
 
I wasn't intending to
 
convert it to an array of characters and join them at the end.
or if you feel like being fancy you can splice the old value out and the new value in
 
I could do that, but my mate, a JS n00b needs to be able to explain the code
var loopArray = (Array(lengthOfWord+1).join("_")).split("");
fixed?
 
7:21 PM
@rlemon speaking of mates, how does your handle that mustache you got going on?
 
@Deep don't create the array like that then
@SterlingArcher that isn't current
Amaan just likes it
 
Why not?
 
!>> Array(4).fill('_');
 
!!> Array(4).fill('_');
 
@rlemon ["_","_","_","_"]
 
7:23 PM
Thanks!
 
!!> Array.apply(0, Array(4)).map(function() { return '_' });
 
@rlemon ["_","_","_","_"]
 
mine above is silly.
Array.fill needs a polyfill
 
so:
 
go for readability
 
7:24 PM
@rlemon well I loved it. I'm inspired!
 
two added lines of code are not going to be the death of you
 
var loopArray = Array(lengthOfWord).fill('_');
I'm going to write it first, then comment it thoroughly, ad newlines etc
(removed)
 
How do you handle a SO question where OP posted db credentials?
 
@SterlingArcher Link?
Usually edit and flag, but I'll pass it on to those who can wipe it (staff)
 
@SecondRikudo stackoverflow.com/questions/27157265/mysql-relation-slow I'm not 100% sure, but they sure look like it
Flagged for mods
 
7:29 PM
@SterlingArcher hey man , i still couldnt find a solution. Do you have any recomendations? to get ajax content crawlable? my backend is php and using jquery
 
What do you mean by crawlable?
 
he wants his ajaxed content index'd
 
@SterlingArcher search engine cant find content as i am using ajax to load the content. i read about using pushSate and htmlsnashots. but i havent found a good online resource that explains it well.
@rlemon yes exactly that.
 
it's actually pretty easy but the solution is shitty
as in: I'm sure there is a better solution but I know one that works
 
I might be underqualified bc index'd in what context?
 
7:32 PM
<!DOCTYPE html>
<html>
<head>
	<title></title>
</head>
<body>
<div id="page-contents"></div>
</body>
</html>
say you have all of your pages like this
 
@rlemon its been a 4 day headache. Documentation online is almost non existant.Whats your solution?
 
so say you build the site to function without ajax
your links would be <a href="/page1">page 1</a>
what you do is (using js) change those to hash links (#page1) and when they are pressed using jQuery.load you can specify the 'area' of the resulting page you want to include
so if all pages have a wrapper.
 
is str.split("").join(" ") valid?

Do you prefer it to
(str.split("")).join(" ")?
 
$('a').on('click', function() {
  $('#container').load(this.href + ' #container');
  return false; // blocks the current a navigation
});
but if you changed the href you don't need to block the navigation, and you don't include the return false.
sorry, I should have mentioned you don't need the hash
 
@rlemon is that how tabbed pages work?
 
7:35 PM
maybe?
everyone tends to implement things slightly differently.
 
@Deep why don't you try it? If it's not valid, the console/results will tell you ;)
 
I personally don't really like this approach, but if JS is disabled the links click through just as they should
 
I am in the process of trying it, I just wanted to see what you think
hence "do you prefer"
 
@LukeSmith did that all make sense to you?
 
And i does work, thanks
 
7:39 PM
dude
@rlemon never heard of the escaped_fragment?
 
nope
 
@rlemon i am going to try it now thanks. pushState i have been reading about alot, whats your thoughts on this .. this explains it moz.com/blog/…
 
yea I've never gotten into the history api myself
 
sorry
 
7:41 PM
by google ^
 
@rlemon is this approach suppose to display links in view source?
 
yes
JS changes everything
but read the article @FlorianMargaine sent
he's much smarter than I am
 
uh?
it's google's article...
 
and you linked it
smarts++
 
@FlorianMargaine @rlemon thanks will check it out. The approach you gave me does not seem to work tho for me.
 
7:54 PM
damn
 
@FlorianMargaine which method do you use to make your ajax content index by google?
 
I'm not lucky enough to make ajax-based websites
or when I do, I'm lucky enough to not care about google
 
Worth remembering in the future
 
@FlorianMargaine all i am using the ajax for is just autoload scroll :/
 
then have links for normal content and block them using js...
this way google doesn't have any issue, and you don't either
 
8:07 PM
Infinite scrolling is annoying anyway
 
@LukeSmith Drop autoload scroll, I say.
 
@Zirak @AwalGarg but having lots of content on the index will make the load time really slow. Thats why i thought ajax was my only solution but now its become my biggest problem
 
I don't want my page to be 10000 miles long, actually.
@LukeSmith you know there could be a "next page of search results" button?
 
google tried the infinite scroll
they dropped it
 
@AwalGarg it seemed more user friendly to be able to load content as user scrolls.
 
8:11 PM
@FlorianMargaine Except for images
 
@AwalGarg does that not use ajax too?
 
Also, I can't remember when I last clicked the "next page of search results" button. What I want would be available on the first page, or it doesn't exist, or the search sucks. But that is my personal opinion.
@LukeSmith You can ajaxify pretty much everything, if you want to. It doesn't necessarily use ajax though.
 
@LukeSmith It's less user friendly to not be able to go back where you left off. With infinite scrolling, if I leave off on "imaginary page 10", finding my way back is horrifying
 
@AwalGarg this is just a series of articles,like stories. its not about searching really.
 
@LukeSmith omg!
autoload scroll for "articles"???
 
8:13 PM
@AwalGarg its like headings with pictures and user can click. which story to read.
 
Is there any problem with "next" buttons that I am not aware of?
 
@Zirak your right, i did notice that too.
 
@Zirak I guess that could be solved with pushstate?
 
@AwalGarg when you say ajaxify pretty much everything ? what do you mean?
 
@AwalGarg You can combine infinite scrolling with pagination
 
8:16 PM
@Zirak combine infitite scrolling with pagination? and not using ajax??
 
@Zirak yea right... but I still find it annoying to have a ridiculously pathetically awfully long page.
 
@LukeSmith You can use xhrs!!
It's not mutually exclusive, Wanda
 
WANDAAAAAA
 
Have regular pagination, and your js automagically loads the next one.
 
and then scrolls up :p
I don't like auto scrolling either :D
 
8:18 PM
@Zirak never heard in my life.? what is it ?
 
Hi! How many of you use node.js ?
 
o/
 
And now in a sentence please
 
(I never did)
 
@Basj 7 of us
 
8:18 PM
lol
 
I thought only 6
ok
 
@Zirak don't forget me. Exclude the shit out of me. It's only 6.
 
@SterlingArcher I didn't include you
 
GOOD I DIDN'T WANNA BE INCLUDED
:cries on the inside:
 
lol
 
8:19 PM
:)
 
@Zirak so my solution is a awfully long page? haha
 
@Basj Are you some.... survey guy? I see you doing that a lot... just asking, nothing bad.
 
@LukeSmith Do whatever you want. I'd go for regular "pagination"
 
@AwalGarg No ;)
 
ok
 
8:21 PM
I hear more and more about node.js, so I just wanted to know if lots of you use that.
 
Why does it matter?
 
Nov 18 at 17:03, by Loktar
@AwalGarg lol we are not important (the room itself I mean)
^wise words by @Loktar
 
@Zirak I like to know people's feelings about this or this.
 
@Basj There are backend languages out there that handle the job better
Depending on the job, of course
 
Do you think this is just a "trend" or something really important ?
 
8:25 PM
cant someone here make a search engine that supports ajax? lol
 
@Basj It's not "just" a trend
 
Are there many websites with traditional Apache+PHP (server) / JS (client) that are "converted" to node.js (server) / JS (client) ?
@copy ok
 
Rumor has it @copy make a copy of google in haskell alone
 
My new favourite language is Erlang
 
How come?
(I've actually never heard of erlang before)
 
8:28 PM
copy shoots Sterling
Even I've heard of Erlang
 
Sterling knows how many bullets copy has shot
 
It has some very interesting concepts (fault tolerance, actor model)
 
Awal enjoys the show
 
But REBEL has interesting concepts too
 
What should I google for this problem?

I have a load of spans, all with the same class, call it foo. I want to store the innerHTML of a span of class foo, when it is clicked on, in a variable "un". however I can only run my code through a js bookmark, so I cannot give each one a Id
 
8:30 PM
@KendallFrey Interesting and useful
 
wat
 
@copy REBEL is useful. In niche situations like minifying brainfuck...
 
Any example of famous site you know being converted from Apache/PHP to node.js ?
 
@Deep iterate over all those spans? event delegation? (the latter, I would say).
@Basj yahoo answers, I think. Not sure.
 
@Basj PayPal, although I'm not sure they started with PHP.
 
8:31 PM
!!afk Googling #Likean00b
 
I know that they use node.js today.
 
@SecondRikudo Hum, okay! Interesting example!
Do sites like Twitter etc. use good old PHP or node.js or their own specific tool ?
 
they use a lot of languages
I also like to read about these things, just that I google them ;) jus sayin...
 
twitter has a page where they show all the languages they use
 
user457812
Is brainfuck in it?
 
8:46 PM
I'll have a look! brb
 
The most popular (i.e., the most visited) websites have in common that they are dynamic websites. Their development typically involves server side coding, client side coding and database technology. The programming languages applied to deliver similar dynamic web content however vary vastly between sites. t popular (i.e., the most visited) websites have in common that they are dynamic websites. Their development typically involves server side coding, client side coding and database technology. The programming languages applied to deliver similar dynamic web content however vary vastly between sites...
 
Why do people write "awesome work 'as usual'"? Those last two words make me feel like I just keep repeating the same mistake :/
 
@Retsam This JavaScript is very popular, must be a good language
 
erlang is not very popular, only facebook uses it.... it must be a terrible language
 
ikr
 
8:54 PM
@copy For YouTube, that column should really say "Javascript, 'Screw You Apple'"
 
@Retsam oh yeah! That is where I read yahoo is transitioning to nods.js...
hold on MSN is visited more than Twitter??? Is that page from... like 10 years back?
 
is there a way to inject additional data into a form when submitting it?
 
javascript
 
ffs dude stop doing that
we're trying to give the room a better rep
 
who, me?
 
9:03 PM
alright
 
@corvid not you
 
bind an eventlistener to the submit button
or to the form itself
 
@AwalGarg I suppose I am a bit confused by this csrf_token, and how the submit will work given that
 
@corvid What is the data that you want to inject to the form?
 
Geolocation, basically. It's for a school project, so the fact that that is a bad idea is... okay
 
9:07 PM
The csrf token should be loaded with the page, and not be generated while submitting the form.
 
yeah but, do you alter the submit data, then submit it again? I feel like that will not make any sense
 
Are you submitting the data via ajax?
 
Here's a small sample
$("form").submit(function(e) {
            e.preventDefault();
            var updatedForm = $("form").serialize() + "&lat=" + latitude + '&long=' + longitude;
            $.ajax({
                type: 'post',
                url: '{{ url_for("events.create") }}',
                data: updatedForm,
                dataType: 'json'
            })
        })
 
cool
 
I think I should just remove flask-wtf, which is the major roadblock in way of the js
 
9:13 PM
I would do it with the FormData api actually, but you are using jQuery, so it's fine I guess.
 
does that include validation?
 
nope, it is just a wrapper.
 
my logs are saying this post isn't quite going through. Hrmph...
sorry about the huge inability to into javascript
 
form.addEventListener('submit', function(e) {
    e.preventDefault();
    var fd = new FormData(this);
    fd.append('lat', latitude);
    fd.append('long', longitude);
    // now create a new XMLHttpRequest here
    // open it to your url with the POST method
    xhr.send(fd);
    xhr.onload = functionToHandleTheResultFromBackend;
}
@corvid ^ a basic mockup
 
9:28 PM
seems like posting isn't working as intended.
 
You can inspect network logs in dev tools.
 
oops sorry, I'm just an idiot who didn't check the console right away
 
;-)
 
but this FormData thing is extremely helpful
 
9:43 PM
!!caniuse FormData
 
make sure you are aware of support
and if you need additional support you have to include a polyfill
 
yeah, or you know, just build a custom query with urlencoded parameters...
 

« first day (1502 days earlier)      last day (3440 days later) »