« first day (1915 days earlier)      last day (3051 days later) » 

12:16 AM
Can anyone please guide me on how to update a query string in the URL using JS, without reloading the browser?
 
crl
History API
 
@crl Its not working correctly for me. It routes to the default angular route: /
my URL looks like: http://localhost:8080/#/B2B-details?accountId=390522838&boId=101305064339764743‌​5347593950220&strDSID=1390027076
 
crl
so it's not a querystring, it's a fragment
 
I am updating the strDSID in the controller after some user interaction and then I just need to update the URL, I have data for that particulat strDSID already.
 
crl
you can do it from location.hash but that practice smell deeply bad
 
12:25 AM
Even with location.hash the page is reloading
 
crl
yea, angular shit, it has a hashchange listener I guess
but if you want to update your url manually, you're taking it from the wrong direction
 
lemme check
 
12:41 AM
@SterlingArcher still around :?
@Luggage React's way of doing scoped css is css-layout
which is imho suitable for react's immediate use case but they definitely need to come out with something smarter than css layout.
Which reminds me @Loktar what do you think about having a higher level @Layout component
 
never played with css-layout.
 
such that you can pass the entire style to the highest level component and they just get applied using classnames ? More like a css parser in javascript that acts as a mediator between css and jsx-css-layout.
 
crl
scoped css would be so cool, if that wasn't just a FF thing
 
12:56 AM
I thought about the approach for a while but immediately realized that the browser's own handling of css files and optimizations will be garunteed to be better. In a longer run, also implementing entire css parser over the top of style="" sounds stupid to me.
 
just name your classes.
 
yea
or bem
 
css collisions are pretty rare for me.
 
@Luggage so how far were you from DC again ?
also are you free on this friday :D ?
// css collisions never occured for me
 
crl
imagine you have an admin interface that use some css framework, and aside from it a page with another css framework, with scoped css, no issue. But that's a rare case
 
12:59 AM
@crl if you actually end up doing it, you will eternally be hated by co-developers.
 
if you have to embed other apps in your own, at least use an iframe
 
also the simplest way of doing that will be yes you guessed it
use 2 different pages !
 
crl
@Luggage meh, that's what my boss wants for the cms, and it's a pain, (passing events in the iframe)
 
The only place where scoped css made sense to me so far have been cases where stupid embeds from other websites have messed my css.
 
crl
so I'd prefer without an iframe, that cuts the app in 2
 
1:01 AM
@crl why does your boss want 2 different framework ?
A/B testing on developers or what ?
 
crl
@Abhishrek now he finally want only one, that's a progress
 
sigh
 
crl
will try to tell him we just need to produce our own CSS like milligram.github.io (someone posted the link earlier)
 
I'd quit the job if my boss forces me to do such thing, in protest !
CSS is holy to me !
@crl or Skeleton CSS
 
crl
thanks good to know
 
1:09 AM
@crl one more of my favorite : Purecss.io although the project is dead now
 
1:23 AM
Please say no cap.
 
@Abhishrek hey, going to college. don't talk to venky until I say, cool?
 
@AwalGarg why ?
!!should i write my own http-parser ?
 
@Abhishrek No
 
did you dig grave for me ?
 
@Abhishrek sorry can't explain right now. nothing serious though, just don't want odd things to happen. I'll be back in 8 hours I think.
!!afk
 
1:26 AM
@AwalGarg hell no tell me what you did
@AwalGarg hell no tell me what you did
or i will talk to him
 
hell, even i want to know why now and I know none of you.
 
@rism lets just say some really strange people have really lot of power and stupid people like me and awal got trapped into one such person's event-horizon
 
oh, we call that 'life' where i come from.
 
@rism if ( you.location !== '3RD_WORLD' ) "you don't"
 
like the analogy though
third world weirdness, now i am intrigued.
does it have anything to do with diamonds and Leonardo DeCaprio?
 
1:39 AM
Indian version
India is still in 3rd world ! Gosh!
 
And here i was thinking you guys were a rapidly emerging global power. my bad.
 
@rism honestly we are not -_-
 
though "we" is a pretty big number in your case
 
xD
 
well you can still save the world from itself, if you can find an alternative to coal fired power stations on your way to the "first world"
i appreciate the hypocrisy, but still, help a brother out will ya?
 
@rism Well after visiting USA once, I think it will take us at least educating everyone to even think of that dream. Also in dependencies is the module 'road-sense' which we cannot just npm install, although we should try cow pray
@rism sure, whats up ?
 
What the heck? Does a focus event prevent a click event from firing? I'm gonna have to manually dispatch a click event... strange.
 
yeah you must live a bizzarre existence. paradoxes everywhere. some of the most high tech companies in the world and then people living in straw huts. all in the one country.
(i imagine) never been to India.
 
@ndugger are you preventing default ?
 
1:49 AM
@Abhishrek nope
 
@rism Most high tech companies are in SF, not India. We are essentially an outsourcing hub trying to boom into the next startup hub.
 
well, dispatching the event seems a bit odd to have to do, but it worked beautifully
 
@ndugger eXtremely weird
 
Sure but outsourcing ala InfoSys style is still pretty high tech... compared to straw huts. The juxtaposition must be wild.
 
Not really, average developer wages for a developer are less than macdonalds part time jobs :P
 
1:57 AM
My CustomElement/Shadow Dom UI kit is coming along nicely
 
@ndugger wat
such lorem !
 
lol
What's nice about doing the List component first, is that the ContextMenu extends List, and I'm sure plenty of things can extend List later
 
@ndugger more like UI table view ?
 
Nah, that's not remotely close to a table
 
2:01 AM
state of the onion
 
pfft
 
I'd rather watch some FO4 gameplay
 
"yes we can" - "but we didn't"
 
If you think anyone else would have done a better job, you don't understand how the position of the President works. Nobody every gets shit done
 
Ello everyone.
Any Angular developers available that can help me out with a small predicament?
 
2:04 AM
Oh, he did a fantastic job.... for the people who bought him the position.
 
The President basically has two responsibilities: Take credit for the good things, and dodge the blame for the bad.
 
I'm creating a very simple slider directive that relies on $interval
I'm wondering if theres anyway to reset the interval timer when I manually modify a variable dependent on the slider.
Is there any subsequent function linked to $interval, that I can use to achieve this?
oh wait
Yeah, is there any subsequent method of resetting the timer interval within the interval's callback function?
$interval(function(){ if(someBool){ /* reset timer back to 1000 on this itteration */ } }, 1000)
 
When .close is called on an HTTP server, I should simply just call .close for all the clients without any warning or message right ?
or header status, right ?
 
 
@rism Thanks for the response, but this details how to stop the recursion all together. I want to reset the delay given a specific condition.
I'm thinking it may not be possible given Angular's parameters for the $interval module.
 
2:19 AM
Yeah, i think the pattern is to kill it, then start it again.
 
"urgent challenges like climate change" wtf Obama welcome to the 21st century you must be new here
 
so start. stop.start.stop. etc. So you'd call the cancel on the promise and then rinse-repeat.
 
I see.
Oh that actually makes more sense!
 
@KendallFrey He says it that way because half of the US still doesn't believe that climate change exists
 
Thanks a bunch :)
 
2:21 AM
I'm an Angular noob tho, so take my thoughts with a grain of salt.
 
@ndugger oh, right. Amurica...
 
It feels like the Republicans choose not to believe in it just for the sake of arguing against the Democrats. They're all a bunch of morons
 
god, shall we not even go there
 
That and all that fossil fuel money.
Either way, it's in the hands of the Indians and Chinese now. Without them on board, we're screwed.
I had someone tell me global warming was complete BS because "look at the record snowfalls".
 
the Indians will try to solve climate change with jquery plugins
 
2:29 AM
I said "yeah, water evaporates when you heat it up", just go sea.
 
Is jquery ajax + php question allow here?
 
@Noobie 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.
 
@Noobie We will probably criticize your use of php, but if your question is javascript related, feel free to ask
 
alrite thanks.
i am trying to find out which is a better way to handle my situation.
The user is supposed to be brought back to the page where they decide to make their payment. (This happens when user cancel payment on the 3rd party payment gateway site)
 
Hmm. How is that related with ajax?
 
2:36 AM
but because the site is loaded step by step with ajax to the payment page... once they are redirected back to the page. The user would need re enter their data again
 
I see.
 
I am thinking of copying the whole html with $('.container').html(); store in session and then replace the current .container class I had
 
local cache
 
local cache?
 
That may work. But object events are likely to be lost.
I think rism means localStorage / sessionStorage. (session should fit your case better)
 
2:39 AM
ah ya.... i am trying to find out if there is a way to reattach all the events
 
I see two objectives: 1) remember user data. 2) return page to previous (after ajax) state.
 
3/ consult api documentation - it's likely handled.
 
@sheepy what is the ideal way i could handle this?
 
!!ban NBOT
 
@ndugger NBOT added to mindjail.
 
2:41 AM
Thanks ndugger.
 
ignored - but yeah a ban would be great.
 
Well, he was only banned from accessing caprica; take it as a warning. If he keeps spamming his own bot's commands, I'll kick him
 
I see two ways to do it:
1) Put them in PHP, and dump the whole page instead of using ajax (this is common in many open source carts)
2) Save data with JS. When going back, re-issue the ajax request and populate them. Saving the HTML is an alternative and may or may not be simpler depending on your design.
 
user5722584
!!ban ndugger
 
@NBOT You iz in mindjail
 
2:43 AM
Any suggestions on how to handle huge files on in my http serve? r
I seek advice on how to implement it.
 
Define "handle".
 
Currently I emit a request event after the http headers and url have been parsed
I seek advice on how to implement it.
 
12 messages moved to Trash can
 
and then expose a method to start handling the body
 
Do you mean you are implementing a web server? Do you mean in Node?
 
2:45 AM
@Sheepy meaning to say, I should reload with ajax request from start again with the session i saved?
 
user5722584
@ndugger join the Trash can thing NOW
 
@Sheepy I am implementing an http server
 
user5722584
@ndugger got a few words
 
@Noobie I personally prefer PHP. It really depends on your design, but reproducing the steps would be a sure way to work - just make sure you show a loading screen :p
 
using TCP sockets available in google chrome / cordova / React-Native / *other non node environments for IoT
 
2:47 AM
@NBOT No, and if you keep pinging me, I'll not only kick you from this chat, but I'll ping a moderator to take action
 
user5722584
BYE
 
@Abhishrek And the current problem is... you cannot serve the content? data too big to read? timeout? you want to support range request?
 
Currently I only support small requests
and no file uploads
Just don't wanna mess up at this stage to mess up in future.
 
@Sheepy php to load everything would be easier for my case, but to use ajax to load is to reduce the loading time user would experience
 
@Abhishrek As long as you do not try to read the whole file at once and serve the whole file at once, it should be fine. Use a fixed size read buffer and read/serve it block by block in a loop.
 
2:49 AM
Ok :-)
 
@Noobie Have you actually measured the loading time difference? Is it caused by PHP or by HTML/JS?
 
@Sheepy the site is not lagging, just that it would appear to be load faster since the process is load by per request rather having user to see the whole page loading to a new 1
 
Writing this has been the single biggest learning experience in past 6 months.
Wow HTTP :P
 
@Noobie I take that as "no I didn't measure it". Because each ajax is a new HTTP request, often done until after main page's DOM ready, and need to go through all PHP again. For small form(s), when done correctly, static is likely faster.
And for large forms, I usually make the form static and load dropbox data in background.
 
> Emitted each time there is a request. Note that there may be multiple requests per connection (in the case of keep-alive connections).
 
2:54 AM
Yes. HTTP is pretty complicated now.
 
So if the connection type is keep alive, i still keep listening for .data
and check if new http connection request is made ?
 
You'll need to spend some good man years if you want to support it all :)
 
right ?
 
Yes.
 
@Sheepy not all !
I just intend to write enough to polyfill node's http api
after which point I will just use express / connect.
 
2:56 AM
Most parts, at least. For example, if you do not support range (or not support it correctly), Adobe Reader and PDF.js may have trouble reading big PDF.
And don't forget HTTP 2.0 ~
 
@Sheepy thanks for sharing. I will think more on it
 
@Noobie My pleasure.
 
@Trasiva lol I was at my computer and everything and I still missed your message
 
@Noobie By the way, having the whole form in HTML does not mean you need to show them all. Magento's one page checkout, for example, use an accordion to hide most parts.
 
@Sheepy, do you know/use angular too?
 
3:07 AM
@Sheepy uh christ.
HTTP 2.0 :-| yikes
but all i wanted to do was :'( shim node's and thought express / connect should take care of that stuff.
 
@Sheepy i somewhat did it in that manner. Renewing the whole html with jquery after a new request is made
@Sheepy or rather a section of the html.
 
@rism Nope. Too busy gaming to learn Angular :p
@Abhishrek They may handle that stuff. I don't know because I have not used express yet.
 
@Sheepy If i were to continue my method, do u know of any ways I could have the object events reattached again?
 
@Noobie You can make all functions global and use HTML event attributes, i.e. 'onclick="..."'
As attributes, they can be preserved by innerHTML / outerHTML.
 
@Sheepy I thought you knew everything. I'm disappointed. ;)
 
3:16 AM
@Sheepy Alrite i will give it a try, thanks :)
 
@rism I know the answer to life, the universe, and everything ;)
 
Ah, my faith is restored.
 
3:45 AM
Do not use innerHTML and do not use "event attributes" like onclick... that's terrible advice
 
just save the data then repopulate the form later. no point in storing the html with the data.
-1
Q: Why does $(document).getElementbyId not work in this function while just document.getElementbyId works?

Code_CompleteThis is the function. I am including Jquery library from Google CDN and it is before this script. { $(document).ready( function() { function displayTime() { var currentTime = new Date(); var hours = currentTime.getHours(); var minutes = currentTime.getMinutes(); var seconds = ...

 
@ndugger It is not like the ajax content is that far from innerHTML, and I think event attributes are ok for simple cases. Java EE may be stuffed full of best practices, but spring struts hibernate won with their simplicity.
 
4:06 AM
🕷
 
Cute bug.
 
4:25 AM
^ interesting new program from Origin
$5 and you get unlimited access to those games
nothing I really want but an interesting idea regardless
 
"Origin Access isn't available in your area yet."
Humble Bundle has a similar but different plan - subscribe and it will gift you one (much more expensive) game each month, which you can keep after the subscription.
Between Steam, Gog, and Humble Bundle Store, I am staying away from Origin despite my interest in Mass Effect 3. Currently busy with Valkyria Chronicle.
Does have an Ubisoft account, for the Child of Light demo. But eventually got it on Steam.
 
4:42 AM
Origin is actually pretty decent
great customer support, and the client is solid
I just don't play many Origin games though
 
Good. That is what I heard too.
But I also have CJK game clients. Enough is enough. I do have a full time job...
 
@MichaelDibbets so this is not a proxy issue?
 
5:04 AM
Is there a valid/common use case for a synchronous xhr? For instance, what sort of situation would require a blocking call like that
 
Try not to do that even if you can find a use case. It is deprecated. It may not be supported 5 years later, like showModelDialog.
 
I know it's not suggested, and deprecated -- just curious of past use cases. It was made for a reason, be it even a poor one
 
@SterlingArcher XHR comes from MSXML, a cross language library at a time when XML is mainly processed by desktop / server programs which mostly use synchronous processing (we can simply move the whole process, including the request, to another thread).
 
I knew it originated from XML but not to that extent.. interesting.
 
No, it is MSXML, an ActiveX library for processing XML. XML itself is another cross platform thing.
In fact I think Java and PHP still use do it in sync. Java at least allow you to take matters into your own hands and do it async, but PHP...
And even now, if you use MSXML in IE instead of native XHR, you can still get around COR and other JS limits.
 
5:32 AM
@SterlingArcher where I saw it used was when people didn't understand async
everyday I load our app... I see a deprecated warning
and it frustrates me so much
but haven't been given time to redo that portion yet unfortunately.
 
If it is working and will take a while to rewrite, I usually leave it alone. To be honest, it is unlikely that sync will be removed. Technically it is no more trouble than alert or prompt, unlike showModelDialog.
 
6:02 AM
 
 
1 hour later…
7:11 AM
@deostroll yea, the proxy resolves just fine. it's just that the certificate google gives doesn't get handled properly by curl. You might be missing the right libaries for it in curl to handle it properly(basically the same as trying to request a modern ssl encrypted site in IE8, it won't work) So you can either painstakingly configure curl to handle the proper ssl(I don't know how important the ssl is to you) or just say to curl to accept all certificates.
Personally I think it's that the proxy doesn't allow access to the verifyers so the certificate can't be validated. if that's the case
 
user3119231
7:45 AM
Fuck. Just noticed that I was in php room the whole time
 
user3119231
So good morning (finally)
 
user3119231
Just wondering why they pasted php links...
 
user3119231
 
lol
well, that certainly would have helped you with javascript problems :P
 
user3119231
Solved it myself - Learning by doing.
 
user3119231
7:53 AM
But there is a new problem: I can't redirect the client because I don't know their path
 
what do you mean?
where they came from?
 
pages where you will be redirected generally take a parameter indicating what page to redirect you to
like say oauth
 
user3119231
	$actual_link = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
	echo($actual_link);
 
user3119231
this will give: localhost/server.php
 
ohhh, for oath
are you testing then on a localhost server?
 
user3119231
7:57 AM
yep. Want a php free login html.
 
user3119231
And I want to run the .php external (Developing cordova chat app)
 
then set up your router to route requests via a port to your webserver
and then request your page via your public ip:port
that way you can test the full oath stack on your own homebrew server
and when done you can close your router port
you could even consider using a server like duckdns.org
to test with a domain thingy
 
user3119231
Hm, my plan was: I have a html form. If submit -> .php: Checks username and password and if success do a header("Location: ...") what means that the client gets redirected local to another file.
 
user3119231
Maybe it isn't necessary. I could simply do something with sessions and then redirect the user local ...
 
8:00 AM
yea, basic login script
header("location: home.php?id=".$id);
no need for http host
 
user3119231
Won't work. Cordova can't handle .php
 
crl
checking room title
 
user3119231
header("location: home.php?id=".$id); -> localhost/home.php (which is wrong)
 
user3119231
client file is here: C:\Users\mbambenek\Dropbox\private\-\index.html
 
user3119231
I think this is because security.
 
8:03 AM
oh
then do a javascript history.back()?
takes a bit more time to render
but you could make a page
login successful
 
user3119231
Or I could just give the local url as parameter $_GET
 
you will now be redirected after 5 seconds
yea
 
user3119231
But how safe is this method?
 
anyone can spoof the local url ofc
 
user3119231
I have that feeling that I should use $_SESSION
 
8:05 AM
your local html file doesn't do sessions
 
user3119231
That is the problem.
 
and the local html doesn't get hte session
 
user3119231
But I can set the session on the server and request is session is valid via ajax
 
since it's static
yea, but the html doesn't. and HTTP_REFERRER isn't reliable either
with all those anonimity plugins
 
user3119231
What should I do?
 
user3119231
8:07 AM
Do you have an idea how to make a secure login?
 
user3119231
Docs about this are rare
 
aliensguymeme_security.jpg
 
crl
Guys do you know of an online 'cdn' service where you can host images and files with an API?
google drive, but.. anything more dedocated to just hosting files?
 
@BenjaminGruenbaum don't cry bby
 
secure login? use oath and have facebook/google/twitter/reddit,etc.. handle login and auth
 
crl
8:14 AM
yes secure also
 
@Mosho write dem tests.
son
We gonna hunt us some 'coons
 
when handling security is so tricky that the best way to do it is to let other people who know what they're doing handle it for you
 
nobody likes creating a new user for a webpage these days anyway
 
8:21 AM
yes what @Neil said, majority of websites offers third-party authentication and creating new users username-password but users nowdays prefer the one-account (gMail/etc) to N websites
@Maurize what do you have on backend? PHP?
 
user3119231
Yep, client only uses js and html. The server runs php
 
@BenjaminGruenbaum so this is why you bring your laptop in meetings
 
@Mosho talkin' about dem analytics, such interesting
Whether to fire an event or a property.
 
life hangs in the balance
 
@Mosho while you're here - did you get the a/b testing to work yet with plans/1 and plans/2? Also, I see the "recent tickers" to the right and I shouldn't :P
Also, bundle.js needs revving, and the Rx autocomplete in the new website goes to no-results instead of waiting for the request like the Angular one.
 
8:25 AM
@Maurize i have used this in two projects http://hybridauth.sourceforge.net/userguide.html , it offers many providers
if you use a framework try looking up for extensions
 
yeah, not always but it happens much more often
 
user3119231
@GeoPhoenix No, I am not using any framework. But thanks.
 
user3119231
App is for android so why not simply use google+ ?
 
Hello, I have a question about Backbone.js
 
crl
I don't like the name google+, sounds incorrect code-wise, +google would have been better
 
8:36 AM
what happens to the old view when you render some view on other's element?
 
user3119231
++google, you meant.
 
crl
no +google
 
user3119231
var google = null; nobody wins. global privacy#
 
Hello?
Can I ask a question?
It's more a of side thing
 
@VermillionAzure I see you have grown Cinch
 
8:38 AM
@Maurize well authentication in android apps can be accomplish without PHP backends
 
@khajvah hi
 
@Ver 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 more of a non-JavaScript thing
Do you guys understand what this pseudo code means?
 
user3119231
no seriously, just ask. Don't ask to ask.
 
8:41 AM
/ = function(a=integral() b=integral() return=type(T)) :
	return$type = typeof(a))
	$ensure( b != 0 )

	rval = /(a b)
	return rval
;
 
user3119231
@GeoPhoenix I just need to verify user data. I can't use .php because it is client side.
 
Do you guys understand that?
 
crl
a math integral?
 
user3119231
This looks like PHP
 
crl
but is not, at all
 
8:42 AM
I've been thinking about trying to make my own language
 
crl
if $ looks like php, well many things looks like it
 
$ represents compile time static stuff
 
1
Q: Does Chrome violate the standards in caching?

gdoronWe noticed Chrome caches files locally and doesn't even send a request to our server to check if there's a newer version of the javascript file. Example of HTTP response headers for a js file that Google cached: Accept-Ranges:bytes Access-Control-Allow-Headers:Content-Type Access-Control-Allow-...

Anyone?
 
So something like return$type is a value named return, and you're specifying a static attribute of the return that cannot be changed during the lifetime of the application
Which in this case, is the type
 
@VermillionAzure Not the first time.
 
8:43 AM
@khajvah Yes, but I'm going to be going through some lower level classes so I have more background to maybe try and do something
 
@VermillionAzure Do you want to compile it to native code?
 
Yes.
I'll probably focus on x86 or MIPS first.
probably x86-64 or something; it makes the most sense
 
tbh, JavaScript room is not the best place to ask about compilers and language designs
 
Yes, but I was asking about the syntax
Does it make sense to you?
 
@khajvah or about things related to code in general. :)
 
crl
8:46 AM
/(a b) is just a/b in polish way
 
user3119231
There is no better place for any questions...
 
The idea was something like this:
 
user3119231
@MichaelDibbets what do you think about this? phonegap.co.in/tutorials/phonegap-login-system-using-php-mysql
 
user3119231
How safe is this?
 
8:55 AM
@BenjaminGruenbaum, maybe you know the answer to this one: stackoverflow.com/q/34761700/601179 you never failed me down as of yet :)
 
crl
!!> /./.test(``[-4])
 
@crl "true"
 

« first day (1915 days earlier)      last day (3051 days later) »