« first day (2111 days earlier)      last day (2835 days later) » 

12:00 AM
ok, then i'll search the rest of that tomorrow.. thanks so much for your help :)
 
@JoeSaad :D glad i could help in some way. you might console.log(this.http.get('friends.json').map(res => res.json()) to make sure it's an observable...? i'm kind of out of ideas without seeing more of your code
 
12:16 AM
@rlemon I got 58 i.imgur.com/9WfSUxr.png
 
12:27 AM
fun
 
But smashing pokestops from my desk is OK ?
 
12:47 AM
Right next to that someone should post a reminder telling you to get up from your desk every hour or so and take a short walk, for health reasons.
 
hi
 
@reyjoel Welcome to the JavaScript chat! Please review the room 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.
1 message moved to Trash can
@reyjoel Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
 
<div class="display"></div>
<script>
var json = [{"id" : "1"},{"id": "2"}];
</script>

how can i display my json into div display?
 
Pretty general question, I'm sure you can find answers by searching.
 
1. That's not JSON (which is a string), that's some JS code defining ab object.
2. To turn it into a JSON string, use JSON.parse(): (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse)
3. You'll need to get a reference to the div with document.querySelector: https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelector or document.getElementById: https://developer.mozilla.org/en-US/docs/Web/API/Document/getElementById
4. To set the text of a node (like your div) use the textContent property: https://developer.mozilla.org/en-US/docs/Web/API/
 
1:00 AM
im new to jquery and i dont know where to start can you give me a keyword on how to display it?
 
@CapricaSix you better not move that.
 
@Luggage i mean the json variable not the json(JavaScript Object Notation)
 
1:16 AM
I need help with angularjs's ngResource
 
@reyjoel me, too.
 
i just name it json ok ill change it into x
    <div class="display"></div>
<script>
var x = [{"id" : "1"},{"id": "2"}];
</script>

how can i display my x into div display?
 
My answer still applies
 
yes it does thank you sir
just clarifying things
 
1:57 AM
0
Q: Should ALL RESTful API calls be defined in an angular service?

joryI would like to call the following api routes /api/user/:id /api/user/inbox /api/user/blah Would all of these be defined in one angular service? And how would I do that? every tutorial I've looked at has a service where it immediately returns the resource and it's usually for CRUD operations t...

 
2:08 AM
@Loktar I realized I never game you my impressions. I'm having a ton of fun with the rift, despite not having much money to pay for games/experiences. Can still kinda see pixels if I look for them, but when Im in the middle of something I dont notice them
 
@BenCraig Check out the free apps on the Oculus store. There are some really good ones.
 
2:23 AM
morning guys
want to ask is there a way to fix this?
class SyncEmit extends EventEmitter {
	constructor() {
		super();
		this.emit('ready');
	}
}

const se = new SyncEmit;
se.on('ready', () => console.log("this never gets called. I want to be called"));
 
2:39 AM
@Ming by the time you register the event handler, the event has been already emitted..
 
@got it. thanks
 
can anyne help me with php curl?
 
@YoiMCoding This is the JS channel man. If soneone can help you it will be back in the PHP channel. If you don't get a response just post a question to SO or something.
 
thanks @Nimphious
 
2:54 AM
@Ming if you only want to emit one event, i guess you could pass the function in the constructor.. and do this.on('ready', listener) in the constructor.. before emit
 
I'm sure there's a bunch of people sitting there watching the new PHP questions feed feverishly pining for their next score hit from an accepted answer. One of them surely is familiar with cURL :P
 
@cswl thanks for that. want to ask, do u recommend learning nodejs as a need to know basis in a project, or learning all the essential stuff first before doing any project.
 
@Ming @cswl: But there's no real point to doing that, since simply having whatever code you're looking for below the new SyncEmit call will do the same thing.
The only time you'd need an event like that is if something asynchronous happens in the constructor that you need to be ready for when it finishes. Like loading data from somewhere, or throwing junk at a web worker to compute and throw back or something like that.
 
@Nimphious thanks Nimphious. will keep that in mind.
 
Oops.
    class SyncEmit extends EventEmitter {

      constructor() {
        super();
        var scope = this;
        doSomethingAsync(function() {
          scope.emit('ready');
        });
      }
    }

    function doSomethingAsync(callback) {
      setTimeout(callback, 3000);
    }

    const se = new SyncEmit;
    se.on('ready', () => console.log("This will be called 3 seconds after the constructor is called."));
Something like that.
 
3:06 AM
@Nimphious most of the stuffs i do, don't have a point.. :|
 
You and me both eh.
 
I should do something productive
 
@user3233074 Welcome to the JavaScript chat! Please review the room 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.
 
okies
i have a ajax response page as main index , so every page will request from ajax exp:about us, product page. all page are load from ajax and put the html tag back to main index.
the main problem was using ajax the url wont change.
so i want my url like this www.mydomain.com/main/aboutus
but cause it load by ajax so url wont change
what should i do ?
i have no idea about it
my url now www.mydomain.com/main
 
3:25 AM
@Luggage thats why I am always on the bed at 180 degree
 
@Abhishrek LOL
 
@littlepootis have you checked the node.js so-docs
 
Has anyone here made a uib-typeahead popup instead of down ?
So results are above the input, not below ?
 
@cswl No, but looking at the queue, it looks horrible. stackoverflow.com/documentation/proposed/changes/57324
That said, I'm not that into Node modules (And half of what's documented there is them).
 
@cswl Not sure what the goal of that even is
 
The number of proposed changes in JS has been decreased.. the rep distribution got balanced?
 
Well, nobody cleaned the topic request :|
 
too much for a Hello World example.
 
That thing can have it's own topic.. just need the Web Platform APIs tag
 
It's only the first line? Still no attribution.. so
 
Probably they meant to say. Enumerated types..
 
@Luggage You mean, take frequent short walk also helps catch more Pokemon, other than health benefits?
 
Hi all
0
Q: Trying to populate select with time of interval 30 mins

Mr_GreenI am trying to populate the HTML's select tag with time starting from 12: 00 AM to 12: 00 PM with Interval as 30 mins. As shown below: <select> <option value="00:00">12:00 AM</option> <option value="00:30">12:30 AM</option> <option value="01:00">01:00 AM</option> <option val...

 
4:43 AM
why
 
that is a requirement
 
I think that question should go to stackoverflow, if it is about a bug.
 
yeah requested for migration
I thought I could ask there
 
Hi. Any up for discussing how to synchronize file access in node.js
3
Q: How can I synchronize access to a file within a single process in node.js?

Evan P.I have a Web server that reads and writes to a data file on disk. I'd like a file only be written to in a single Web request. Here's an example program that illustrates my problem. It keeps a state file in "/tmp/rw.txt" and increments the integer contents on each Web hit. Running this program, a...

Should I implement a separate module just for file access where I have a queue to manage this?
 
5:03 AM
I have a small question is there anyway I can add something to this.id for example <p id=test></p> JS part - var example = this.id + "SOMETHING" then search array names[example] ?
 
5:23 AM
hey guys. im implementing nodejs fs.watch function to watch changes to a file. it keeps on repeating my console.log statements. any ideas how to stop that
watching file now
the file has changed
fileA.txt
the file has changed
fileA.txt
reading file contents...
reading file contents...
 
@Hobolandjacob It's unclear what you are asking
 
Are there any free HTTPs API to search the geolocation of IP addresses?
 
8
Q: Good Geolocation API by IP

ventsi.slavI am looking for a good free API that will return me at least the country of the IP. I found a couple of that will work but they seems to be unreliable. The main problem is that I have to make about 50000-100000 requests for a day. Is there some good script that I can install on my server and us...

 
m59
@deostroll is this relevant? github.com/mafintosh/mutexify
 
Any angularjs pro's got a few mins to help me understand how a uib feature works ? (only code I will need to share is the uib js :))
 
m59
 
ES2015 for Object.entries(obi) ?
 
@m59 which bit am I missing :\
 
m59
Just post the code and your question. You asked to ask.
 
my if statement is not following operators can someone help me?
 
m59
If it's a lot of code, use a link to it
@Hobolandjacob that isn't an operator =D
 
5:38 AM
whut
if (c => b) {
 
m59
That's a function
c >= b
c => b is a function that takes c and returns b
 
THANK U SO MUCH
 
In the following code: https://github.com/angular-ui/bootstrap/blob/gh-pages/ui-bootstrap-tpls-0.14.3.js

There is a template called: typeahead-popup.html
It has a line: `ng-style="{top: position().top+'px', left: position().left+'px'}"`
It is loaded by uibTypeaheadPopup directive.

Question is: what is the position function that it is calling. Trying to find that code :)
 
m59
That's going to be in the controller
 
Alas I wish answer was as easy as that :) That directive does not have a controller. position gets onto scope as a variable. see here [line 7527] (github.com/angular-ui/bootstrap/blob/gh-pages/…)
 
There is loads of controllers / stuff in that file :) So can't just search for scope.position :D
 
m59
Angular and such is junk.
 
Line 7816 - https://github.com/angular-ui/bootstrap/blob/gh-pages/ui-bootstrap-tpls-0.14.3.js#L7186

This is where it creates the element with uibTypeAheadPopup directive. But the parameter is: `position: 'position'` ... a string.
Shaving a yak today :( I just want the silly typeahead to popUP not down, when not enough room.
 
m59
I'd create my own. If you can understand that disaster, you can do anything =D
 
hmm getting close to writing my own. but that has its own perils :)
 
m59
5:54 AM
on the off chance that anyone is awesome at nginx... I have a simple config and am screwing up some way. domain.com/.well-known/acme-challenge should be proxied to the same url but on port 13135
http {
  server {
    listen 80 default_server;
    include /etc/nginx/mime.types;
    root /app;
    location /.well-known/acme-challenge {
      proxy_pass 127.0.0.1:13135;
    }
    # any uri that ends with .something, serve existing file or 404
    location ~* \.(.+)$ {
      try_files $uri =404;
    }
    # everything else goes to index.html
    location / {
      rewrite ^.*$ /index.html;
    }
  }
}
13135 definitely has a server listening. It doesn't get hit at all. :/
Ooo, the plot thickens. /foo is proxied... I bet I got this figured out
It's the .
 
Rubber duck debugging is an informal term used in software engineering for a method of debugging code. The name is a reference to a story in the book The Pragmatic Programmer in which a programmer would carry around a rubber duck and debug their code by forcing themselves to explain it, line-by-line, to the duck. Many other terms exist for this technique, often involving different inanimate objects. Many programmers have had the experience of explaining a programming problem to someone else, possibly even to someone who knows nothing about programming, and then hitting upon the solution in the...
Glad we could be the duck :)
 
m59
haha, well I was just doing random things =D
But, I can't figure out why it's the dot or how to fix it. It won't proxy it.
so yep... it's the next block for trying files. I figured they would process in order.
Booom. location =/.well-known/acme-challenge duh
The other one is not specific. It would have matched multiple things, so nginx goes for the more specific regex first, then tries to match that. = makes it match exactly that path. Woot.
 
6:20 AM
I hate engines that try to guess importance based on some heuristic rules rather than go from top to bottom or bottom to top. Yes, this includes CSS.
Haskell is an interesting case. It goes top to bottom, but the compiler also tries to find all cases where that means some case can never be reached, and throws a warning in your face.
 
m59
+1 o/
 
I mean, CSS usually does the right thing. But when it doesn't, things get ugly. Though I'm yet to add an ID to <html> and go #html#html#html#html * {/*this really should be applied everywhere*/}
As in, "I'm dead serious. In print, everything should be black. Maybe a bit of gray. But no animations!"
 
@rlemon @ssube well that was fast. Already got a new date. She's a redhead too 😂😍
 
Hi Anyone here having experience in MVC Insight Screen ?
?
 
6:37 AM
Anyone worked with sticky.js?
 
m59
@littlepootis daaaaaanngggg #REKT
 
7:14 AM
Any WebStorm users? Just wondering if this is an issue and should it be requested from JetBrains. Issue description: function A, defined in function B is considered local function iirc, and therefore it shouldn't be visible in functions C, that is on same level as function B, right? Example: gist.github.com/jeserkin/ec49e4e47a7ffdf94cc27fa7213abf42 So my point is function, that is not reachable shouldn't be clicable in IDE and shouldn't point to function described elsewhere, correct?
 
m59
I would think you're right
 
Okay.
 
m59
It's linking the A() inside of C to the one inside of B ? Seems like they went out of their way to do that wrong.
 
Anyone here worked with AWS Lambda?
 
no keyboard shortcuts to arrange Chrome tabs... really :(?
 
7:25 AM
@MadaraUchiha sry. No experience with that.
@FilipDupanović what do you mean by arrange?
You can activate tabs from 1-9 with Ctrl + [1-9]
 
@Eugene You can't move them around.
 
yeah, but you can't change their position if you want to go mouseless... thankfully, someone wrote an extension, but this is super useful I'd expect it to be built in superuser.com/questions/629432/…
 
@MadaraUchiha can you in any browser with keyboard shortcuts?
 
@Eugene Yes. In Firefox you can use keyboard to rearrange tabs. Ctrl+Shift+Page Up/Down.
2
 
TIL
 
7:38 AM
FF here I come!
 
@Sheepy okay. Didn't know that. Mostly using Chrome, plus described topic wasn't/isn't an issue. But good to know. :)
 
thanks @Sheepy, that Chrome extension didn't work for me
 
7:53 AM
If anyone is interested can +1 this issue youtrack.jetbrains.com/issue/WEB-22568. So it would get noticed.
 
morning
 
👋
 
morn o/
 
hi i have a question anybody there
 
@modestandcutegirl Welcome to the JavaScript chat! Please review the room 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.
 
7:59 AM
we're all here
who's there?
 
ok
i will be happy if someone helps
in my index.html i add my javascript code like
<script type="text/javascript" src="scripts/myjavascript.js?v=1.20"></script>
but i cannot see this file but can see other javascript files in my script folder while debugging so that i cannot put a breakpoint
why it doesnt show while debugging?
 
@CSᵠ we are all there :D Exept noone knows where there is :D
 
@modestandcutegirl no network errors?
 
there you go
 
no network errors
i use chorome
 
8:04 AM
Might be generated on the fly? Should still be visible IMO.
 
it shows in the resources tab but does Not show in the sources tab to that i cannot put a break point
 
Weired
 
but when i put console log inside the myjavascript.js code it shows in the console
but it doesnt show in the sources tab
 
Console, should reference a file and line number from where it is called
 
what can i do? any idea
 
8:17 AM
10 mins ago, by Eugene
Console, should reference a file and line number from where it is called
 
8:39 AM
yes it shows but when i pres that line it goes to the resources tab ! Not to the sources tab!
so that i cannot put a breakpoint
but i noticed not that when i refresh the page it apperars in the script folder in the sourcess tab
 
Have you tried another browser?
 
now*
no
i use chrome
maybe can check it this case happens with firefox
ok thanks
 
@modestandcutegirl Edge's tool is also pretty nice. And if they all can't help, the script you are debugging is perhaps not designed to be nice to debuggers.
 
8:57 AM
help me guys on this
3
Q: How to multiple filter list using jquery/javascript

Storm SpiritI have a html where I can filter based on their data but I don't know how to combine it. This is my script and the search name is working already but the radio button isActive still not working and need to add on my filter. I don't know how to and it on filter. $('input[type=text][name=sear...

 
@StormSpirit You just asked it 29 minutes ago. Give people some time to see and test and answer. Stackoverflow is a Q&A site, not "solve my problem for free now" site.
 
I already solve it, but I don't know what to do more.
on the isActive
 
Well, you get two more answers now. Good luck.
 
9:12 AM
any one know how to solve this one ? stackoverflow.com/questions/38605318/…
 
greetings, programs! \o/
@Newbi you wanting people to login into your website with a Facebook login? or actually redirect the user to go to FB and register an account there?
 
second
ups
if user login with fb and didnt have account in my website it's direct to register
if thy have account in my website and login in fb it's direct to account
 
then you might want to look at developers.facebook.com/docs/facebook-login which also allows account creation if they don't have one already
 
it's already work
 
9:19 AM
ealry it's f Log In
 
then i mis-read what the problem is
 
the image
 
" the pop up only works if I click icon fb, not the button."
 
i try change to f Register With Facebook
 
9:20 AM
btw the plugin register not available anymore :(
 
so i made it self with css but can't combine with function js
 
Hi there :)
 
i jsut want change the word from f log in to f Register With Facebook
 
well the code is doing exactly what you ask it to... it is triggered on the inner div, not the button. you could try moving the data-size="icon" data-show-faces="false" data-auto-logout-link="false" data-scope="public_profile,email" onlogin="checkLoginState();" up to the button
then the whole button is used and not just the inner div...
 
9:22 AM
y i tried make button work like the div js
already try change to button but result more worst.
 
sorry but there is a break down in communication.... try again please?
 
y i tried make button work like the div js
already try change to button but result more worst.
 
@Kikus have you tried changing the overflow in the CSS to scroll, instead of hidden?
 
Hi guys just curious to know... some sites redirect to login using fb account... how they check the account is valid or not?
 
@Kikus ...for the record, adding a horizontal scroll bar to a tabbed navigation system is really bad user interface design. If you have sooo many tabs, you should consider rethinking your navigation and probably use some sort of drop down hierarchy to group like-type menu options together.
@astrosixer the fb login pop up just normally checks the login with the FB database and if ok, redirects a token (probably JSON token) back to the starting websites authentication code to say "yep she is good to go"... then the starting website just stores the token as proof of a valid login.
 
9:29 AM
@astrosixer as well i know you need login and auth the website.
 
@astrosixer and could store it in a database, or as a session or cookie
 
err so it's possible? combine button with js (pop up)?
 
@Newbi from what i can see, there is no need to change anything but the 'data' properties... move them up to the button tag instead of the inner div tag... then the whole button can be clicked to trigger the login, instead of just the inner div tag (which has the 'f')
 
user6524633
hey guys! I am trying to learn JS and I came across an online test with this problem
 
user6524633
9:33 AM
-4
Q: set a password for an email account with two restrictions, It has to contain at least one uppercase character and it cannot contain any digits

BashirI want to know, where is my code is not correct? anybody can help? because my Score for this code was 12% out of 100% -------------------the question------------- You would like to set a password for an email account. However, there are two restrictions on the format of the password. It has to ...

 
user6524633
how would you do this in JS?
 
user6524633
I am thinking of creating a regex and then test if the substring matches
 
user6524633
but not sure if it is the right way to go
 
Both are easy as regexes, but really bad ideas as far as password requirements go
 
@Newbi or just the onlogin="" property, since that is what does the action.
 
9:35 AM
or at least the latter one is
 
@thedigitalmouse do you mean move the onlogin="checkLoginState() or data to button?
 
user6524633
@JanDvorak can you give me a hint on how to proceed
 
user6524633
I am struggling with this
 
I have
 
user6524633
so I first create a regex
 
user6524633
9:35 AM
that matches
 
user6524633
an uppercase
 
user6524633
and numeric/alphanumeric numbers
 
user6524633
and how do I find a substring
 
user6524633
of the regex?
 
@Newbi yes, try just the onLogin part... move it up to the button.. if not work, move all the data properties too, just in case
 
9:37 AM
@thedigitalmouse i already tried it, still same
@thedigitalmouse already move all part or the pary 1 by 1 to button and result same
 
Is this feasible? jsfiddle.net/h8xo94y2
 
user6524633
var regex = (/^(?=.*[A-Z])[0-9a-zA-Z]{1,}$/);
 
user6524633
does this look ok? @JanDvorak
 
user6524633
it should match any alphanumeric and at least one Uppercase..
 
You don't need to fit them in the same regex
Also, you don't need the outermost parentheses
 
9:44 AM
I am using DOM Element object to store custom properties
^ Is this feasible?
 
hello world
 
@GeoffreyD Welcome to the JavaScript chat! Please review the room 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.
 
@Mr_Green Can't recommend. Though if you have jQuery, .data does something similar.
It doesn't work in old IE, for one
 
@JanDvorak I am considering only modern browsers.. in that case can I use?
 
I guess so
have you tried?
 
9:51 AM
yeah working in chrome (which I only care)
check the above fiddle
working in firefox too
9
Q: Javascript DOM: Setting custom DOM element properties

rampionIs it ok to set custom properties on DOM elements, and rely on them persisting? For example, given <html><body><div id="foo"></div></body></html> Would it be fair to do document.getElementById('foo').bar = "baz";, and expect document.getElementsByTagName('div')[0].bar to equal "baz"? Note ...

^ Don't use :(
but that is kind of old post which talks in preference to HTML4
still searching..
 
10:07 AM
@Mr_Green What I do in Miaou is using a WeakSet mapping DOM elements to values. It's fast, let you use any value type and doesn't leak
 
Thanks I will consider that :)
 
turns out that I need to support IE10 too :(
 
This absolutely doesn't prevent our customers to 1) require we support it 2) go on installing it
 
10:18 AM
I would think it to auto-upgrade to IE11
 
@JanDvorak Big companies often have this disabled
 
^ yes
 
yuck
I've also seen someone force IE7 emulation in IE11, company-wide
 
that is purely for torture
 
I would add an omnipresent message in the document for IE10 and below users that their system is at risk with a link where they can install either IE11 or Edge
 
10:20 AM
^
 
The worst is that most sales people will just ignore you when you tell them that supporting IE10 is only possible with a higher price
 
Nah, it's to support ancient legacy intranet websites. Our website has been exempt from the policy, but only because we asked nicely.
 
are people from sales responsible when NASA loses a ship? no
it's the engineers
 
bbl food
 
everyone is responsible indirectly
 
10:22 AM
as professionals we must not look towards sales for technical excellence
 
Are they just explaining that their browser takes more time to do the same thing ?
 
uhh, think it's battery life
they've had a lot of marketing lately related to battery life on Edge
 
Who cares about the battery for a browser which doesn't run on Android or IOS ?
 
laptop
 
huzzah \o/! finally getting an opportunity to use PostCSS exclusively
@DenysSéguret hmm, that may change in the future (just a guess)
.NET Core, MSSQL Server are now available on Linux... mayhaps they'll be inclined to throw Edge onto Android in the future
 
10:32 AM
@DenysSéguret laptop and PCs like mine which run on battery power
Although it's always plugged in.
 
10:43 AM
I wish I could use Edge, since I'm on Windows; it's up to speed with the standards, but without any of the upcoming goodies :(
 
10:59 AM
Are there anyone here who is familiar with webcamJS (github.com/jhuckaby/webcamjs)
 

« first day (2111 days earlier)      last day (2835 days later) »