Please have a look at this comment http://stackoverflow.com/questions/3753483/javascript-thousand-separator-string-format/19840881#comment74069371_19840881 Please ignore the (German) language therein, just follow the second link and you see what I mean.
The first link therein links to the script that created this.
Please don't collapse, JS isn't my favorite language (yet).
@Kain Welcome to the JavaScript chat! Please review the room rules. Pleasedon'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.
I code something like Jquery to handle the DOM , `var $ = (function() {})` that's works well , but I need the $ variable to contain arrays and objects alongside functions .
no that's not the point here ! I love jquery and I use jquery in my projects . the point here I hate type the same code multiple times, so I use it to minfy the DOM code
what I really need is create a prototype for the main function so I can call it like this $("hello").alert(); will result in alert with hello
@Kain 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
@GrafixMastaMD Welcome to the JavaScript chat! Please review the room rules. Pleasedon'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.
So I have basically created a quick little extractor. I want to be able to extract data. I am able to select all of the strong elements. But for some reason when I go to select the p elements. I am not getting any selection.
See Js Fiddle: https://jsfiddle.net/xmikedanielsx/e34he23d/1/
var h = `<...
var $ = (
// DOM usage
function $(id) {
if (id.includes("#")) {
return document.getElementById(id.replace("#", ""));
} else if (id.includes(".")) {
var x = document.getElementsByClassName(id.replace(".", ""));
for (var i = 0; i < x.length; i++) {
return x[i];
}
} else {
var x = document.getElementsByTagName(id);
for (var i = 0; i < x.length; i++) {
return x[i];
}
return {
alert: function(){
console.log(id);
@rlemon You had banned me in Sandbox for testing purpose http://chat.stackoverflow.com/transcript/message/33465644#33465644 Could you please unban me from Caprica ?
Guys, any idea if its possible to regain focus on a window after clicking a download? Initially I used an anchor but also tried opening a new window in js, setting the current location & using a hidden iframe but when the file is sent as an attachment to the browser the focus is always removed from the client window.
@Anth12 Welcome to the JavaScript chat! Please review the room rules. Pleasedon'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.
Hey guys - any JavaScript + HTML5 Canvas ninjas on here? Please give me a shout if you can help me generate random width blocks and fill them to the width of the canvas! Thanjs
@dk_french032 Welcome to the JavaScript chat! Please review the room rules. Pleasedon'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.
jsfiddle.net/n5kgbe3g/1 - I need to generate a number (by var number) of blocks and give them a random width and then fit them to 100% width of the canvas
well, just send your TCP msg with FIN flag up. The server will know that the stream is ended and that the client will listen to the server (usually, it responds with ACK) before connection gets closed
@Cerbrus I have managed to generate random heights (not exceeding the canvas height), but i am struggling to do so for the width of the block. Any help would be greatly appreciated. - jsfiddle.net/n5kgbe3g/5
For all but the last element: Get a random width between the minimum (10?), and whatever is left of the canvas (-10 for the last one). The last one will be the remaining width...
I'm not gonna build that for you, but as long as you keep track of the total of the previous columns' width, this should be doable
hm.. anyone understand what 'Program node server.js exited with code 1' actually means? got a node server.js file offering up a Vue.js-laden index.ejs/client.js combo to the browser. On our internal developer server everything is shiny and works as expected, but once we push it out to a production server facing the outside world, we start getting the above exit message...
..., as if node crashes then restarts a couple of seconds later. But within that few seconds the browser has given up on the server (client.js tries to make a socket connection) and stops.
yes, but if people uses that package (i don't use phantom myself) and doesn't give a f*** about those cleaning, then there is an open door for security issues
Python, Lisp, Clojure, Lua, Pascal, Delphi, and dozens of others survive quite well without the semi-colon. Embrace, rejoice in not having to type one extra character per line, and grok the fullness of well formatted and documented code! \o/
my point was that ; is just how JS and a variety of other languages determine EOL or 'end-of-statement' because the parser is written that way, often just inherited behavior from an older cousin or what the developer was used to.