« first day (1649 days earlier)      last day (3291 days later) » 

12:36 AM
where can I find a script like those that run when using the google search box?
 
@phpPluginMaster ...you want to find a script that replaces Google?
 
he means the suggestions i guess
 
no, the drop down text box at the bottom, kind of like how your browser also suggests results
how do i make one?
brb
back
 
1:14 AM
What's the difference between long polling and good ol' polling?
 
long polling takes a long time ;) ;)
 
Ok, what's the difference between WebSocket and streaming?
 
concept and implementation
 
Hi, how can i get the text of the closest div? Somehow this is not working, because i get undefined. $test = $this.closest('.entry-head').text(); alert($test);
$this is the form, btw (on submit)
 
looks right according to the jQuery docs
as long as the form is INSIDE .entry-head somewhere
 
1:32 AM
When creating a server with http.createServer in NodeJS, why do I have to hard-code the status in the response head? Shouldn't the server put out different status codes for different cases?
 
you program all of that.
it's a very basic server. you can respond in any way you like.
node comes with a fairly low-level api. you can build on top of it. there are other libraries that do that for you if you like
expressjs.com build on top o fthat server and supplies lots of common web-server-y features
 
I've used a few express functions when I had to deal with MongoDB, but never advanced
I already made an app that runs a MySQL query and also writes to the response body. Now I'll make a real time chat app
 
socket.io ?
 
I need this module, correct
Is websocket the same as streaming?
 
1:39 AM
websockets is the modern protocol for such things
socket.io is the most popular library to use it easily
also, it provides fall-back older protocols if the browser can't do websockets
I use socket.io. I don't know how easy/difficult websockets are to use 'raw'.
 
I work side by side with experienced JS devs, they're time poor however and don't help oftentimes. I tend to learn best from other humans.
 
and by doing.
all programmers learn by doing.
 
I meant learning from others while doing together
but reading docs usually slow-tracks me
 
@Luggage Nah, it's not.
 
I kind-of get it, but that's not what people like to hear. It makes it sound like you sound like you need to have your hand held even if that's not what you mean.
 
1:44 AM
How would i do it, if it is above?
 
@Proton well api.jquery.com/closest says that .closest() looks UP in the DOM.
I think .find() looks inside
 
$test = $this.find('entry-head').text();
alert($test);
does also not work
 
why not?
 
@Luggage people sometimes take me for a lazy butt for asking too many questions and not doing the research myself. You show me once, it's mine forever. I wasted you 2 minutes, you saved me 30. It's not about others doing my job, it's about using others to save me time, frankly.
 
Yea, I get it. It's always convenient to ask other when you know they know the answer
but you learn more and don't take them out o fthe zone when you find out yourself
 
1:47 AM
@StevensHaen It's also learning how to learn, problem-solving and how to find things
 
My main point is, it's not about effort
 
more like 15 minute swasted if you take a devloepr out of the zone for a quick question
 
I don't mind putting in the work. I'm very time-poor however
Crack-coders don't get sidetracked easily, they'll be fine
 
@Proton 'entry-head' looks for an element: <entry-head> Is that what you mean? of a class="entry-head" or id="entry-head"?
 
class
 
1:49 AM
then . in the front.
same as css (those are css selectors)
 
still does not work.
i know, somehow i missed it. ;)
<div class="entry">
    <div class="entry-head">
    </div>
    <div class="entry-content">
        <form action="index.php?site=entrys" class="test" method="post">
            <div class="entry-options">
                <input type="submit" value="Edit" name="edit">
                <input type="submit" value="Delete" onclick="return check('You're sure?');" name="delete">

                 <input type="hidden" value="{$entry.entryID}" name="entryID">
            </div>
        </form>
    </div>
 
ok, so it's outside the form. closest()
 
sorry, copied comment but doesn't matter.
It's nearly the same
 
but if it's not working, start by tesing each piece. verify that $this is the right element, etc.
 
@monners old :P
10 hours ago, by rlemon
http://tholman.com/elevator.js/ hahaha
 
1:55 AM
@phenomnomnominal So's your mother.
 
@monners she's dead.
 
onclick="return check('You're sure?');" is invalid
 
@phenomnomnominal Well shit, I wasn't in the room.
 
the extra single quote
 
@monners I personally things it's worthy of at least three separate starred posts
 
1:56 AM
I'm going to build it into something secretly
I have to, it's too good not to
 
i removed some unnecessary content, there is actually no problem.
i get the message
 
@monners us too, but replace the music with "Daybreak"
 
this is defined
 
@phenomnomnominal Nah, replace it with "Chariots of Fire"
 
Haha nice
 
2:01 AM
@Proton .entry-head is a sibling of .entry-content, not a direct parent. I think that's why isn't being found
$form.closest('.entry').find('.entry-head').text()
This goes UP to .entry, then down t. .entry-head
if .entry-head is only ever the only one of the page then you only need $('entry-head').text()
 
nah, it's not :D
 
then the longer version.
 
that's why i need this
yeah, that works.
thanks ;)
 
np
 
bzarg.com/p/how-to-pronounce-hexadecimal I wish I'd had this bibbity-dee years ago.
2
 
2:13 AM
Back in 19-dickety-2
We had to say dickety. The Kaiser stole out word for twenty.
 
6 more sleeps until KSP 1.0
gnight
 
Someone's gonna be dreaming of crash-landing on the moon
 
3:02 AM
I'm at a meetup and this guy is giving a talk on how he cloned WinAmp2 in the browser (including skins!)
 
that's quite the accomplishment
 
The talk is titled "Have stupid side projects"
 
Oh
Then thats cool then
 
anyone got idea about postMessage between firefox Bootstrapped extensions and webpage?
or how do get access of window variable of a page in firefox bootstrapped extension
 
3:45 AM
is there a bug with this script: jqueryui.com/autocomplete/#remote
 
Why should there be?
 
where?
it doesn't seem to send data to the client on keypress
@JanDvorak where?
 
Unlikely. Cross-domain issues?
 
so it needs to be more than the URL change, and sent as a GET?
 
Hey guys whats some fun easier games to make when just beginning javascript
 
3:50 AM
@phpPluginMaster can we see your code?
in a jsfiddle...
don't flood the chat with this much text
 
fiddled
i'm trying to build a google search object
 
Client-side seems legit. Look up console.log, though.
@JoshK 2048
 
3:56 AM
!!tell phpplugi mdn console.log
 
outside the functions?
 
Client-side seems legit. Make sure the server expects a term parameter on the right URL and returns an array of strings as a valid JSON
 
i'm still upset with mozilla
 
Why?
 
3:59 AM
want the server side php?
i know that works
they got rid of their CEO over politicss
 
Are the network requests and responses what you expect?
s/expect/should expect/
 
it's not getting data back to the user under $_GET['search']
but i did correct that
but they don't communicate
 
I don't like PHP but I might take a peek
 
 
1 message moved to Trash can
I said "jsfiddle". And in case of PHP code, I mean pastebin
 
4:06 AM
jsfiddle can run php?
 
Who the hell flagged the Feeds post?
> And in case of PHP code, I mean pastebin
Don't dump code here
 
I meant the code that responds to autocomplete requests... the script that handles the form submission is pointless here.
 
that should do it in the while loop
 
user2260218
Hey everyone! I have a basic javascript question.
 
4:10 AM
@Anthony 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.
 
user2260218
Conceptual, actually.
 
user2260218
@CapricaSix Thanks.
 
@phpPluginMaster err............
 
you need to build the connection
and the db
without those it fails
 
@phpPluginMaster the plugin sends a term parameter, not a search parameter
 
user2260218
4:11 AM
Anyway, I was wondering why we even have Javascript- I was talking to a friend about HTML, CSS, and JS, and it sounds like a good structure, but why not just have everything in one language? Is it really just organizational?
 
term paramiter?
 
@phpPluginMaster Also, you have a gaping security hole there. Look up "SQL injection"
 
@Anthony not possible, each one does their own thing
pdo prevents sql injections
 
@Anthony sure. Instead of <div> you write document. ... what again? A bunch of DOM manipulation commands? Not with this API.
 
user2260218
@JanDvorak I have practically zero knowledge about all this-- I basically just got introduced to it. Is there a simpler way to restate what you just said?
 
4:14 AM
javascript - client side programming
CSS - layout
HTML - framework
 
@phpPluginMaster sorry; misread that as string interpolation.
 
@Anthony Three lines of code just to make a piece of text bolder?
 
user2260218
@JanDvorak That would be fine though, right?
 
user2260218
Theoretically.
 
4:15 AM
@Anthony instead of seven characters?
 
user2260218
The division is just for ease of use?
 
user2260218
@JanDvorak I understand, and I agree. I just want to make sure-- this could all be done in one language, in one file.
 
It would be mess otherwise. also, HTML predates CSS predates JS.
 
no, each is their own tool
 
@phpPluginMaster Technically, you can
 
4:16 AM
how so?
 
user2260218
And why was JS needed? Again just a convenient way to break things up? Is there a security issue with including JS stuff with CSS stuff?
 
pdo has a scraper built in for security stuff
@Anthony you need to sometimes program stuff to run on the client
 
user2260218
I don't know why client side stuff should need it's own language. Actually I'm not sure how JS interacts. CSS defines the layout of things the HTML defines, but in what environment does JS operate?
 
// the javascript equivalent of `<a src="http://example.com">John</a>`

var name = document.createElement("a")
name.textContent = "John"
name.src="http://example.com"
document.append(name)
@Anthony Javascript runs in the browser. That's the point of it.
Not to mention you can't just append text. You have to create a text node and append that.
 
user2260218
Alright. I guess I should accept it. But at the end of the day then, the browser processes all of this information, and then what?
 
4:20 AM
@anthony on a building you have:
HTML - frame
JS - the "smart stuff"
CSS - details, like paint
 
is javascript open source? I want to learn either c# / javascript for unity game development but then i don't prefer c# because its tied completely to micrsoft
 
@androidplusios.design unityscript is not javascript
 
@Anthony And then you read it.
 
@androidplusios.design Javascript is a language. V8 is a javascript engine. It is opensource, I think
 
@androidplusios.design and apparently learning "javascript" (aka, the real stuff you want to learn to be a good, say, node or angular dev) does not help much in learning unityscript
 
4:22 AM
@JanDvorak any idea for what I need to do?
 
@phpPluginMaster 1) Read the plugin documentation ;-)
@phpPluginMaster 2) stop claiming your server code works
@phpPluginMaster 3) fix your code
@phpPluginMaster 4) profit???
 
so should i choose c# because i have already done c/c++ .....c# might be pretty easy to pick up? @royhowie
 
i see none for the ui plug in
 
@androidplusios.design I haven't worked with Unity (only read about it briefly); you'll have to decide what's best for you
 
iit works, but not together
 
4:24 AM
@phpPluginMaster there is a link...
 
aww, at the bottom
 
v-v
 
user2260218
@monners But how does the browser make use of that information?
 
@Anthony magic
 
4:27 AM
@Anthony Magic
 
user2260218
Ugh.
 
Are you being serious?
 
user2260218
@monners Yeah.
 
Google HTML, JavaScript, CSS and read, literally any, of the first page results.
 
i wish there was an open search bar on git
 
4:28 AM
@monners except for the w3schools ones
 
that had most of the criteria filled out already
 
@JanDvorak At this point even that might be better than nothing.
 
@monners no.
 
user2260218
@monners Maybe I misspoke? I mean when you feed the browser JS, how does it interpret it?
 
4:29 AM
@Anthony with an interpreter
 
@Anthony The JavaScript interpreter interprets JavaScript (funnily enough)
 
languages are compiled or interpreted
 
user2260218
@royhowie I'll look through that.
 
user2260218
But so it takes the HTML/CSS/JS, and throws it right into machine code?
 
@Anthony no
 
4:30 AM
Only the JS part
sorta
 
Strictly speaking JavaScript is a compiled language, it's just compiled immediately before it interprets it
 
@Anthony basically, the HTML is like the scaffolding. The browser reads the HTML file and parses it as a type of XML
 
user2260218
XML?
 
ignore that
it just parses it
then it applies the CSS rules with a CSS engine (something else that does more parsing and applying and stuff)
 
@Anthony technically, HTML is SGML, not XML
 
4:32 AM
@Anthony There's a level of knowledge you're gonna need to read up on your own before we can really be of any meaningful help.
!!resources
 
user2260218
Thankkkksssss. I mean I have a general understand of the structure of languages, and things like that. I've taken a computer architecture classes, among other things.
 
user2260218
I just don't understand why websites are written the way they are-- I mean I'm okay with it if it's just for human readability, but it just seems to random.
 
because it's easy for computers to understand
 
user2260218
Again, I feel like we could just have used the same language for everything, and it would just be clunkier.
 
4:34 AM
(although you can go and learn about ontologies and the like and ways to make these "systems" work)
 
@Anthony It's not that different to most other UI-driving environments.
 
@Anthony JavaScript was sort of random… thank Brandon Eich for making it and pushing it into NetScape
apparently he did it in 10 days
or two weeks or something
 
user2260218
@monners I've really only worked directly with things like C, Java, and Python. I haven't done too many big projects, or interfaced with many 'useful' things.
 
!!tell anthony resources
 
4:36 AM
Go, read.
 
@Anthony medium.com/javascript-scene/… is a good read (taken from that list)
 
user2260218
Thanks everyone.
 
4:57 AM
@royhowie True. But many parts of the initial JS referenced Java (instead of something new), and modern JS has grown a lot since its birth.
 
@Sheepy iirc it was (informally) renamed from ECMAScript to Javascript (JScript and ActionScript in other browsers) to ride off of Java's popularity
 
@royhowie Not really... If anything, it is the other way round.
 
what
 
Which is why we're returning to the name "ecmascript" now. Java sucks.
 
Netscape created JavaScript first, and others copied (and added new features), e.g. JScript. Eventually ECMA make it a standard.
 
5:01 AM
was wrong about the renaming, but it was called JavaScript to ride off of Java's popularity/to complement it
 
In March 1996, Netscape Navigator 2.0 was released, featuring support for JavaScript.
JScript was included in Internet Explorer 3.0, released in August 1996.
Netscape delivered JavaScript to Ecma International for standardization and the work on the specification, ECMA-262, began in November 1996.
Yes, the name part is true.
 
"The change of name from LiveScript to JavaScript roughly coincided with Netscape adding support for Java technology in its Netscape Navigator web browser. The final choice of name caused confusion, giving the impression that the language was a spin-off of the Java programming language, and the choice has been characterized as a marketing ploy by Netscape to give JavaScript the cachet of what was then the hot new web programming language."
 
For a long time - not that many years ago - ES was not JS, and JS was not ES. They may have same root, but the transistion is far from a simple "rename". Look at the Version History table.
 
I now realize
 
Even now, some of that legacy remains. Firefox's let implementation is still in old JS, not the new ES.
 
5:10 AM
I'm not sure I like all of what ES6 is doing
but that might be because of this guy
 
Me too... I especially dislike class >_<
 
he is so melodramatic
well, yeah, class is meh
ES7 is neat. I will miss my callback hell, though =(
 
Hey, I love that article intro. I think it is true. 99 in 100 JS devs does not really know JS.
 
I think the statistic is overblown
most people just say they know some JS; that doesn't mean they should be put in the "JS dev" category
 
I think it is still very close to the truth. Few JS programmers, even dedicated ones, really understand prototype or some of the more delicate language features. They may wield jQuery like a wizard, but that is all.
 
5:29 AM
0
Q: parse youtube video id from string with javascript

Bill Gateshello I found lots of threads here which explains how to parse youtube id from url but nothing I found which can extract youtube video id from string. I need a function which can return me youtube video id from url For Example I have string > Hello this is my string and this is my youtube vid...

 
@BillGates 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.
 
@BillGates there are many youtube regx on SO, more than one hand can count. Have you tried each of them?
 
yes many but not getting expected output
 
Because many of them expects you give them only the link. Try removes the ^ and $.
 
5:43 AM
please give me link which one is best according to you
 
Hmm. You are right. Not a simple dup as I expected...
 
Have added a comment to the ques.
 
chrome://flags/#enable-tab-audio-muting
 
posted correct link
 
5:54 AM
@Zirak That's a nice one, but IMHO the real problem is auto-play, I'd love to turn that off
an unfocused tab shouldn't play either video or audio, that would be awesome
 
@BillGates Your code works with the correct link.
 
@ivarni You've never used something like grooveshark or spotify or the likes, have you? Or just tabbed away from a video, or had it in another window?
 
@Zirak Nope. And I don't want something like that to be on by default, I want it as an option
 
I'd be pissed beyond oblivion
 
@ivarni hidden away from regular users, presumably?
 
5:57 AM
@JanDvorak Why would it need to be hidden?
 
@ivarni To anger the users even more and drive even more of them from your browser
 
Because your grandma is gonna ask you why she can't hear her other (better) grandchild's voice looping over in the background
 
I am currently listening to music on Youtube. I don't want to click a button every time a new song loads
 
2 mins ago, by ivarni
@Zirak Nope. And I don't want something like that to be on by default, I want it as an option
 
You're one of the few people who do
 
6:00 AM
When watching cat videos on youtube and opening three related videos I don't want them all to start making noise
 
If it's per-page, you'll ruin Youtube autoplay. If it's per-browser, just mute the browser or turn off your speakers. If it's per-session ... well, just don't visit the offending sites
 
You can re-compile chromium to exclude the autoplay attribute, for instance
 
@ivarni better youtube -> autopause
 
Muting the browser means the cat video I am currently watching has no audio
 
or just don't don't open multiple tabs with youtube
 
6:02 AM
@Zirak Ah, now we're getting somewhere, is it the browser who does that?
 
Plays audio? Yes
 
I always figured it was some shitty youtube-script
 
do you want that per-session? Because that's the only sensible option. And even then per-session means for every video when I'm watching my subscriptions.
 
Has support for <video> tag? Yes
 
I just wish I could open a tab and have it STFU untill I visit it. I'm a taboholic.
 
6:03 AM
Which means I'll have to use autopause anyways. And at that point there's no reason "play video" shouldn't also "play audio"
 
@JanDvorak That solves the youtube issue at least. I still wish I could fix it for every page but it seems people get up in arms by the very idea of having such an option so I suppose Google won't add one :)
 
@ivarni How about adblock?
 
meh, I guess you can have a "Enable auto-play" option enabled by default for weirdos like you
 
@JanDvorak Already running adblock, doesn't stop autoplay
@Zirak Yes, that would be perfect
 
@ivarni What else autoplays? Shoot the dev.
 
6:08 AM
@JanDvorak I'm not in the US, shooting people isn't really an option
 
6:22 AM
@ivarni You don't always need to shoot with old, outdated firearms dailymail.co.uk/sciencetech/article-2359156/…
 
@Sheepy ooh shiney. On the topic of lazors though, I believe the US has actually made a laser cannon capable of burning drones and small boats. The future is here.
 
is ermahgred is troll word
 
@ivarni Yes. They did. And exoskeleton that doesn't need power. And telescoped cannon shell. And some new chemical to stop bleeding. At their budget, they have real trouble if they don't make something new.
 
6:54 AM
Urgh. Our app was given to some (out-sourced) web designers for CSS and styling. Not only did they switch everything to fixed table-cell layout which is a pain to tweak, but now, for some reason, JQuery UI's Resizable stopped working.
Of all things.
 
@JanDvorak youtube?
 
50 mins ago, by Jan Dvorak
@ivarni https://chrome.google.com/webstore/detail/abjcfabbhafbcdfjoecdgepllmpfceif > autopause
 
I mean, it works, and adds the CSS classes and little divs for the resizing handles, but the handles aren't shown and can't be grabbed.
 
yeah well that's not ootb
sure, anyone can write a script to fix that
 
@AvnerShahar-Kashtan That'll teach you not to out-source :P
 
7:05 AM
@RoelvanUden Well, since I, myself, am an out-sourced contractor/consultant on this project, perhaps I shouldn't be too quick to throw stones. :)
It's weird. Everything seems in place, the CSS, the JS, the little itty-bitty DIVs, but the handles don't show up.
 
just asked my first question on SO. Got 2 downvotes in 10 seconds.
So, nah, gonna work it out on my own
 
What was the Q?
 
Already deleted it seems
@Charly If we could see the question we might be able to provide som feedback on how to improve it
 
thanks @NickDugger
 
thanks Obama
 
@SecondRikudo Sure that'd be a nice feature to have for jQuery. Since compatibility is its selling point, it should also support H.264, H.265, VP8, VP9, MKV, RMVB, and OGG.
I can't wait for it.
 
Functionality like that is well within JQuery's scope so I'm surprised they don't already have it
 
@SecondRikudo What, convert the entire site into one single audio file? That could get inconvenient.
 
7:38 AM
@AvnerShahar-Kashtan It's called a screen-reader :)
 
@AvnerShahar-Kashtan There, this note is half a pitch too high and a quarter beat too early! And that section is in wrong scale!
 
@Sheepy Want to add a persistent backbeat with a bit of groove? I'm sure there's a jquery plugin for that.
 
Nooooooooooo!!! )))y(O.O)y(((
 
7:53 AM
I have a jQuery slider I am working on, but the animation is going funny. Maybe I have been working on it for too long - could anyone advise me on what is going wrong ? codepen.io/JustSteveKing/pen/pJoEPO
 

« first day (1649 days earlier)      last day (3291 days later) »