« first day (2082 days earlier)      last day (2871 days later) » 

7:01 AM
ok... not support in html5 -.-
 
user3119231
good morning
 
user3119231
@NoughT add some javascript which creates some script elements and insert the content from the js files.
 
user3119231
1
A: How do you import multiple javascript files in HTML index file without the bloat?

AemiIncluding a JavaScript file in another JavaScript file is common in web development. Because many times we include the JavaScript file at run time on the behalf of some conditions. So, we can achieve this using JavaScript as well as using jQuery. Method 1: Use JavaScript to include another Jav...

 
can you explain more it ??
Is this similer to RequireJS ??
 
why not using Requirejs?
guess this would be the simplest way
 
7:05 AM
o/
 
user3119231
@NoughT it is plain javascript
 
@elsololobo Is that load all the JS files in one requrest ??
 
if you run r.js as far as I know yes
have to bundle it
 
@elsololobo Thank you both of you
 
you minify your js to one file -> result would be one request for all js
 
7:07 AM
@Maurice Thank you
"you minify your js to one file"
What is that ??
 
read the require js docs... if you done this run r.js (also requireJS)
 
One request to bring them all together and in the darkness bind them.
 
Zoe
I followed the first answer by this post http://stackoverflow.com/questions/16919601/html5-canvas-camera-viewport-how-to-actally-do-it
But theres bug . Whenever i update the camera position while moving , the ctx(canvas context).clearRect() is causing a flickering white grid on canvas .
It also happens in the provided example if you move a little ahead .

I already asked question but no response http://stackoverflow.com/questions/38065635/while-grid-gap-on-clearrect-in-canvas

Demo in jsfiddle jsfiddle.net/hhgguq2v/29 : Note its not working due to some problem with jsfiddle ( see console )
 
does someone have an idea how to add different background-colors on a dynamically generated table in JSX?
 
Zoe
anyone ?
 
7:23 AM
how to invoke a function which exists on deviceReady?
on loading up my app, it failes to call the function exists inside deviceREady..
 
@Zoe be patient Zoe - you only posted that SO question 6 hours ago. Takes a while for people on the other side of the world to wake up and see if it is something they can help you with. :)
 
Zoe
Ok ok , but my previous question was asked 3 months ago and still no one tried answer or comment , but still i will wait -_-
 
@elsololobo what do you need to do?
 
@FilipDupanovic I have 4 different departments each with a different color. now i´m trying to set for each department a TR color while the table is dynamically generated.
 
How one should introduce global variable to this module pattern ?
 
by global variable I mean global to UI.Old module only
 
@elsololobo would you use CSS selectors to style the tables? you could do <VacationSummary className={department} {...props} />
 
ah. yeah this way could work... i will try it
 
this is a nice static helper that let's you neatly compose the className string from props, state github.com/JedWatson/classnames
 
@Mathematics Then it's not global...
Just add it as a property
 
7:42 AM
@BenFortune ok, is that how people usually do ?
 
Howdy
 
@SirCumference you mean bahoo jee ?
 
@Mathematics Is your name really "Mathematics"?
That's a pretentious name...
 
Has anyone here ever developed a customer solution in meteor?
 
@FilipDupanovic this way should work or? as className of the tr I set rClass
var rClass = 'background-color:';
                        if(items.departmentName === 'Service'){
                            rClass += ' #EE0BC4';
                            console.log(rClass) //background-color: #EE0BC4
                        }
any ideas why it does not? :)
 
7:54 AM
@Britain You know you fucked up when most of your population googles "What happens if Britain leaves the EU" the morning after the vote is passed.
 
user3119231
is it possible to querySelector an element by it's class + content?
 
user3119231
ok
 
But you'll be able to filter them based on their content
Array.prototype.filter.call(document.querySelectorAll(".className"), function (el) { return el.textContent === "potato"; });
something like that
 
user3119231
you are a smartass pootis
 
8:01 AM
@SirCumference Thank you
 
isn´t background-color the way to give a tr a custom color?
for button my code works, but customize tr color does not
 
8:15 AM
What are you trying to do?
 
@elsololobo you have to assign an object to the style property on the component, i.e. <div style={{backgroundColor: 'violent'}} />
 
hm, if i paste in your example it works, but don´t get it working dynamically
how can i exchange 'violent' with a variable?
ahh
it works... thank you @FilipDupanovic
the double {} was my mistake oO.. should get some coffee quickly
 
Zoe
8:35 AM
So i repasted if its fine !
I followed the first answer by this post http://stackoverflow.com/questions/16919601/html5-canvas-camera-viewport-how-to-actally-do-it
But theres bug . Whenever i update the camera position while moving , the ctx(canvas context).clearRect() is causing a flickering white grid on canvas .
It also happens in the provided example if you move a little ahead .

I already asked question but no response http://stackoverflow.com/questions/38065635/while-grid-gap-on-clearrect-in-canvas

Demo in jsfiddle jsfiddle.net/hhgguq2v/29 : Note its not working due to some problem with jsfiddle ( see console )
 
@SirCumference Not exactly "most of your population". There is a surge in the query, but no number to indicate a large portion of the voters searched about it.
 
"What is the EU?" is the second top UK question on the EU since the #EURefResults were officially announced https://t.co/1q4VAX3qcm
 
And if someone can translate that "second top" into a "query per day", we can start to discuss what that might means at all.
 
what's the top q?
 
What is the EU?
 
8:42 AM
Top is "What does it mean to leave the EU"
 
Good thing it wasn't like "amateur girls"
 
user3119231
interesting: if you click a file url which popup a "save as" dialog the console clears itself
 
@ChristophBühler don't be surprised; monkeys would test better on demographics than EU nationals, they at least get Y/N questions right on average of 50%
 
Anyway. I think the MPs may find someway to not leave EU. If the parliament voted to leave EU, Scotland will really leave this time. Reaaaal headache.
 
8:51 AM
@ChristophBühler ted.com/talks/…
 
@Sheepy Wales are in talks too
 
@BenFortune interesting how it was the younger generation, that was more pro-EU in the referendum
ya know, the same people who use google the most
 
@tereško Because it's their future
 
which they know jack shit about
 
@tereško They obviously do, since they voted remain.
 
8:55 AM
 
@BenFortune Wales voted to leave. At any rate, I expect North Ireland - and perhaps London - to break before Wales.
 
lemme guess, @BenFortune, you are one of those people who think that "leave" voters are idiots
 
@tereško Nope, everyone is entitled to their own opinion.
The only idiots are the obvious xenophobes and racists on social media.
 
what else can you expect
the refugees and economic migrants are a problem in EU
the left tell that there is no problem .. and only people who offer "solutions" are the far-right
that's why you are seeing rise of their popularity
 
...if only the EU wouldn't be as instrumental towards displacing the refugees
 
9:05 AM
far-right "solutions" are usually insane, but public isn't given any others
 
When every EU member including Romania has immigration problem, you know it's not a problem of being in EU or not. Sadly, some people believe it is.
 
heh
Baltics don't have immigration problem - only refugees we got are scrambling to get out, because we are poor and it is really fucking cold here
 
what do you mean? everyone's quotas are full
 
Leave voters do not necessary vote for the promised solutions. Some vote as a way to say I am unhappy.
 
keep in mind that a lot of people who voted to leave are the same ones that voted to join
 
9:11 AM
Hi!
 
@tereško Indeed...
The young say the old collapsed their future. The old says it's wisdom gained from first hand experience.
 
"the refugees and economic migrants are a problem in EU" - wait, what? the later has already been disproved. economic migrants spend money where they are working and those legally registered pay taxes, so there is no problem there. it is more about how the integration is done ( or not done). The EU (including the UK, who has a vote at the table but don't seem to want to go down there to be proactive) has known about immigrants for at least a decade. hello, wars going on all over? :P
speaking as an 'economic migrant' myself, who escaped the US in 2000 to live in Europe
and hi Eugene!
 
@Sheepy It's not the first time they've thrown the younger generation under a bus
It's almost like old people like recessions
 
erm ... replace where i said 'immigrants' with 'refugees'
 
9:19 AM
or not... works either way :/
 
not really
 
@BenFortune it's the baby boomer generation, they have no idea what it's like
 
for an immigrant to benefit a country said immigrant needs to know the language, have useful education and be actually working
 
@tereško Gotta agree with that. I live in the most culturally diverse city in the UK
Many people here can't speak a word of English, and even need translators to go with them to claim their benefits.
 
what's the problem with that? you educate them, like everyone else
 
9:23 AM
:D
 
They don't want to be educated, that's the problem.
 
@BenFortune I can see why the old think that. But they won't get their days back by leaving EU...
@BenFortune Birmingham?
 
@BenFortune they are actually doing because they want to help the newer generation. Which side is correct only time will tell.
 
@Sheepy Bradford
 
it's a common trend, that immigrants from islamic countries are more isolationistic than average (with some exceptions, of course, like - Kurdish)
 
9:30 AM
In Javascript, with the variable hoisting, is there ever any problem with a variable being defined multiple times in a function, like:
function foo(bar) {
    if (bar > 10)  {
       var zot = 10;
    }
    else if (bar > 5)  {
       var zot = 5;
    }
    else {
        var zot = 1;
    }
    alert("zot is " + zot);
}
 
yes
 
What is the problem?
(other than :frownface: at the code)
 
No problem, if you ask me.
People redeclare i all the time in for loops.
 
@Danack when compiled, that's the exact same as:
function foo(bar) {
  	var zot;

    if (bar > 10)  {
       zot = 10;
    }
    else if (bar > 5)  {
       zot = 5;
    }
    else {
       zot = 1;
    }
    alert("zot is " + zot);
}
 
cheers.
 
9:33 AM
with a very small difference for performance purposes, but nothing to worry about, won't affect behaviour
 
var foo = 1;
function bar() {
    if (!foo) {
        var foo = 10;
    }
    console.log(foo);
}
bar();
@Danack ^
 
user3119231
I would say "my" football team is the last remaining in the EM from this room
 
9:50 AM
HELLO GUYS
I have 3 tabs in html page
there is a form in 2nd tab
on subtmitting the form, I need to reload
hence I am doing
window.location.reload();
now my requirement is to reload the page and open the 3rd the tab
$('#devices').click(); will open the 3rd tab
but I am not getting any idea how to implement this click functionality
 
@SomeKittens Got what you were looking for?
 
@tereško That outputs 10 - which seems correct, if not completely intuitive.
 
@Danack you asked for problems. I have you the example ;P
 
s/example/D/
 
@Danack the usual way is function foo(bar) { var zot = 1; if (bar > 10) { zot = 10; } else if (bar > 5) { zot = 5; } }
 
10:01 AM
@SpringLearner In backend, inject the tab switch code after it processed the form submit.
 
@Sheepy is it good to load from backend?
I am thinking to implement sessionStorage
sessionStorage.setItem("reloadTab","settings");
		    		window.location.reload();
then in the main page which contains all the tabs
I will do
if(sessionStorage.getItem("reloadTab")!=null || sessionStorage.getItem("reloadTab")!="")
	{
	$('#settings').click();
	}
 
Hi, guys, I have added a favicon to my root folder but it is not appearing. Does anyone know what could be happening?
 
@SpringLearner Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
 
@JoãoPaiva WordPress server?
 
@choz noo, I'm running npm lite
i think that's what it is called
 
10:05 AM
Oh, you can force it to appear though.. You can google that..
Actually I am having the same issue with favicon, but its on wordpress server :(
 
@SpringLearner The HTML is the same except for the line. Doing it on client side means you'll switch tab regardless of form submit result, which may not be desirable for example if the form fails to be processed.
 
@Sheepy Are you familiar with elastic search?
 
@chos sigh ):
 
@SpringLearner Don't forget to clear reloadTab once you switched, shall you go this path.
 
@JoãoPaiva How are you serving your assets?
 
10:06 AM
@choz Never heard of it :<
 
@BenFortune What do you mean? b:
 
T.T
Anyone who can help me here stackoverflow.com/questions/38071367/…
 
@JoãoPaiva Are you using this?
 
@Sheepy yeh,thanks, I have almost forgot to clear reload
 
@BenFortune No, I'm just running locally with npm start command
 
10:08 AM
@JoãoPaiva Any frameworks?
 
@BenFortune Angular 2
But it shouldn't matter, right?
I shouldn't have to import favicon anyway
If I add it to my root folder it should appear
 
@Sheepy will sessionstorage work on all browser including chrome,firefox and IE?
 
@SpringLearner Did I hear IE?
And did I not hear Safari?
 
@JoãoPaiva On the server...
 
who cares about safari
 
10:11 AM
@Sheepy I can see developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage that all modern browsers supports
 
@SpringLearner Another disadvantage of storage is that it is shared across all tabs. If your user has multiple form in process... you can say screw them, of course. And the customer may say the same to you.
@SpringLearner I usually check caniuse
 
@Sheepy I am using ajax now to submit the data and I am wrting the above sessionStorage.setitem in success part. So I think it wont be problem now. Do you agree?
 
shaorma is life
 
What is the best way to load 10 JS files from sending one request to the server ??
Think if I have 10 JS files that send 10 request to get.
Can I get those 10 JS files from 1 requests ??
 
10:23 AM
you have to concatenate the 10 js files beforehand or use a script on the server which does that dynamically
otherwise you have to make single requests, which you should do async :P
 
@NoughT You can create an endpoint to concat and minify those 10 files.. And call it just once..
 
guys
if I have this
<div className="commentWriter">
    Pentru a putea comenta, trebuie sa {' '} <a href="/login">te autentifici</a>.
</div>
No space is added between the link and the rest of the text.
How can I add a space there (Without css or something)
 
@jAndy Can you explain it bit more please ??
 
@Victor, try &nbsp; or &#160; (XHTML)
 
@supipd 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.
 
10:30 AM
@supipd ReactJS escapes any string literal given as child. So this won't work
 
@Victor <a href="/login"> te
 
Can I do that with requirejs ??
 
@SpringLearner Sounds ok. :)
 
@Victor 1.dont'use, or repair ReactJS,
2. include <span style="width;20px"></span> instead of space
 
> 1.dont'use, or repair ReactJS,
?
 
10:38 AM
How to output to a file in JSON format while using winston logger
 
@NoughT you have asked this Q already.. what is the problem
?
 
@Victor Using any library require live with their rules. If rules are disturbing, use another library, or rewrite (or ask for correction) to fullfill Your needs
 
I know you can use json: true , but the file istelf inst actually a json
 
@elsololobo The thing is requirejs is very unpredictable
 
wat?
why ?
 
10:41 AM
here is the code that I added to html file
<script src="../../js/require.min.js" data-main="../../js/main.js"></script>
Then Here is my main.js file
 
in general u don´t need the .js
 
`require(["/config.min.js",
"../../js/vendor/jquery.min.js",
"../../js/vendor/modernizr.min.js",
"../../js/foundation.min.js",
"../../js/jquery-ui.min.js",
"../../js/jquery.slimscroll.min.js",
"../../js/text.tokenizer.min.js",
"../../js/vendor/jquery.cookie.min.js",
"../../js/jquery.easy-pie-chart.min.js",
"../../js/icheck.min.js",
"../../js/draw_common_table.min.js",
"../../js/jquery.ui.timepicker.min.js",
"../../js/KendoJs/kendo.all.min.js",
"../../js/KendoJs/kendo.web.min.js",
"../../js/JCrop/jquery.Jcrop.min.js"]);`
After my <script src="../../js/require.min.js" data-main="../../js/main.js"></script>

I have a this code.
 
without any context it´s hard to help... but it doesn´t seems to be correct ;)
 
@FlorianMargaine yeah, that's the way I'd write it; the example code is someone elses. I was wondering if there was a concrete justification that I could use to persuade someone to write it ---sanely-- in the standard fashion.
 
<script type="text/javascript">jQuery(function ($) { // some functions });</script>
 
10:46 AM
and you haven´t said what you exact problem is
yeah and this code is wrong
 
Then It says in console jQuery is not define
 
cause you are using it wrong
 
@elsololobo Can you point me what is the right way ??
 
you write a cfg file where you export each plugin e.g. with shim... then you have to DEFINE a module use the exported plugin value and you can use it... but you should just read the docs
it´s good documented and there are 100x of yt videos of it
a config could look like this one
and for a module use sth like this
define(['jquery', 'bootstrap', 'bootbox', 'spinner'], function ($, bootstrap, bootbox, Spinner) {
and if everything works... read about r.js -> that is what you actually want/ need
 
@elsololobo Thank you very much.
 
10:53 AM
I just wonder when browsers will implement ES6 module, if ever.
 
@NoughT no problem :)
 
142
Q: Let's improve Stack Overflow's "Ask a Question" page!

Cody GrayWe've all heard and done our fair share of complaining about declining question quality. 1, 2, 3, 4, 5, 6, 7 Various ideas have been floated, but haven't gotten significant traction for various reasons. Here's another attempt to roll up our sleeves and do something constructive about it. In a re...

When you open the page and scroll down do you get weird text/symbols?
 
nope
 
"I understand that Stack Overflow wants to keep the bar low to post a question because that is the whole reason the site exist. However the fierce moderation scare users away after their first post and the ones that give it a second shot run the risk of hitting an almost irreversible question ban. " - rene
 
@NoughT and keep track of the plugin deps ;)
 
11:00 AM
@elsololobo Sure
 
i.imgur.com/EBNbK5o.png here's what I see
even after refresh
 
Check the console
 
kill your computer
 
Maybe the aliens are trying to contact me
 
independence day is near
 
11:10 AM
Ah. Chrome and Firefox already has a working patch for ES6 module, and Safari/Edge says they are working on it.
 
comin soon in 2043
 
Hi there.
I'm adding a comment function with a reply function and on click it smothly scrolls to the comment input section.
Now I want to add the ID of the Comment to my $_POST, in order to write it in the Database. Can I do this without using AJAX? e.g adding A value on a hidden field and tretirve it in my PHP script?
 
you have to somehow send it to the server either with ajax or sth like submit
 
user3119231
@TechTreeDev sure. just set display: none and you are fine
 
how does that help to send sth to the server?
 
user3119231
11:17 AM
if he adds a name to the input and submits the form it would be transfered
 
user3119231
btw this method is stone age
 
true
 
@Maurice the reason why I asked if this still acceptable to do this :D
 
it works, nothing more ;)
 
user3119231
If it's okay to date grandmas go on
 
user3119231
11:19 AM
If you go with the girls check this: developer.mozilla.org/en-US/docs/Web/API/Fetch_API
 
@Maurice And If I'm a 70 y/o granddad? O.o
 
if you want bad usability do it... everthing is said
 
11:39 AM
goddamn vpn and disabled reddit!!
 
does some else got Muscle cramp´s from too much ctrl+z? :D
 
use both hands
;)
 
for me it's ctrl-a/x/c/v
 
Hi. How is node's event loop kept alive in case of a tcp server...?
 
11:44 AM
i dont get muscle cramps , I suggest stretching your hand once in a while
 
i will try to integrate that in my workflow :D
 
@deostroll As long as you have a listener registered, it'll run indefinitely.
Unless it crashes of course
 
I've dug the source code...and hit some C++ code, but I don't understand how it doesn't exit...
it - as in the program
 
Is RX480 released? My wallet is ready for some new components
 
@Paran0a Ew, get a 1080
 
11:46 AM
0
Q: get max length of characters of a value from json jquery without loop?

Ram SinghI have a json, i want to get maximum count of characters from any value under a specific tag without each or for loop, is it possible? { "Language": { "ru": [ { "from": "set", "to": 444 }, { "from": "sc", "to": 222 } ], "he": [ { "from": "trdsss", "to": 333333...

 
Thats REALLY expensive
 
please help me
 
the new one´s are totally overpriced
 
@Paran0a soon. Like a week or 2.
 
I've got new conf in my mind , i5 6400 ,RX480, 8GB RAM , and ~250GB SSD
I don't need edge case configuration
 
11:47 AM
give it 16GB
also, look into getting a good chassis and PSU
 
Ofcourse ,I'll let other people to decide on that though as Im not compentent enough. Do I really need 16GB?
 
Yeah, 8 isn't enough anymore.
 
hi
 
New Forza is coming out for PC, 16GB recommended.
 
@dnvsp 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.
 
11:49 AM
Jeesh my computer at home "upgraded" to 4GB only 1 year ago
 
@Paran0a likely
 
brb googling the price
 
can i ask jquery doubt here.
 
@Paran0a you are developer. Being able to run VMs is necessary
also .. there is chrome
 
Can some one suggest me good book for Mean stack development. I am working experience with angularjs but not with Mongodb & NodeJS
 
11:51 AM
@Paran0a you mean to say that you are not putting it together yourself?
 
@VinodBDhupad there are books on Mean stack?
wtf?
 
I've never been a hardware geek. Just not interested in it. Ill get the building part for free
 
why not?
 
i have disable a submit button with jquery.it works fine but sometimes in my database i find some double entry.is below code working perfectly to disable the button after one click.
 
@VinodBDhupad if you already have experience, your best place place to start would be the official docs
 
11:53 AM
1. it is simple
2. it is cheaper
3. you get better results
4. it's fun
@Paran0a
 
@dnvsp have you took a look at the console?
 
@littlepootis MEAN Web Development
 
@dnvsp asked: "can i ask jquery doubt here." I'm not sure we can stop your doubt of jQuery, but we can try! :-)
 
That's mean. I know what that means.
 
@dnvsp in general this should be prevented serverside!
 
11:54 AM
yes
 
1 message moved to Trash can
@dnvsp Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. For posting large code blocks, use a paste site like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
 
so the request is send twice -> no serverside bug?
 
@tereško I'll get the help of my colleagues with the building part. I won't be buying prebuilt conf
 
yes it saved twice in sometimes only
 
11:58 AM
getting no errors in testing also.i unable to find where the bug occurance?
 
@tereško the (1) is relative. It depends from person to person. A colleague during my CS courses admitted to me once that he sucks at working with hardware, so people shouldn't go to him if they want hardware suggestion
 
@dnvsp make a fiddle or sth similar
 
he even didn't mention a dedicated GPU when i asked him which components is required for a PC
 
I also don't care about hw , I just want to build my pc and not think about hw for the next 5 years
As I did till now
 

« first day (2082 days earlier)      last day (2871 days later) »