jsfiddle.net - Use this and post a link, if you need help with your HTML/CSS/JS 3v4l.org/ - Use this and post a link, if you need help with PHP/HackLang
what's wrong with this var array [{regex:"/test/i"}]; if (window.location.href.match(array[i].regex)) {}; I sometime need to force window.location.href into a string using typeof but isn't .href supposed to return a string?
Nicholas Walker
fucking regex. This I why I quit programming.
Matthew Hill
forgot a = but whatever
Colton Howard
Is it best to insert the penis orally or anally when doing pattern matching?
Parker Ross
Is there a way to have jQuery press the enter key automatically? Everything on Google is just people looking to trigger an event when the users presses the enter key. I want to write a function that involves simulating an enter key press itself.
Josiah Hall
Two holes needs two solutions.
Lincoln Reyes
Try triggereing a key event with the code set to 13
Adam Ramirez
Not 100% sure, but I think you need to make the regex string to a regex object via new RegEx() or something like that, before using it in match()
Oliver Clark
Any particular reason? If you're interacting with a form, you can just submit it.
Lincoln Gray
Is there a jQuery function to submit a form automatically? I know about the submit() function but that just binds an event when a user submits it themselves right? My backup plan was the have a hidden submit button in the HTML and have jQuery click it but I was hoping to keep the HTML cleaner.
It's kind of a wierd situation but it's for an internal app where users log in with a barcode scanner.
Kayden Nguyen
$(formElement).submit(); without arguments is equivalent to $(formElement).trigger('submit');
Isaiah Ross
Nevermind, submit() works, just had to target the form itself not the input box.
Joseph Cooper
How do I make a Json that contains 2 groups and in each group a list of names?
Levi Gutierrez
I guess there is nothing wrong with .match and window.location.href since this works perfectly in jsfiddle document.body.innerHTML = window.location.href;
if (window.location.href.match(/js/i)) { document.body.innerHTML += " true"; }
Elijah Hughes
apparently the content of .match() has to be an object, just like you said
William Cruz
Spent an hour debugging a '/' at the end of the string. Well, this is learning.
I have an external script loaded to a page with defer enabled and right after that I have an internal script which calls a function from the external one (also defer).
So I gathered from a stackexchange post that the HTML5 spec basically says scripts with defer are put last in the load order, but when they're executed whichever script loads first will run first.
And that seems to be what's happening to me given the function call in the internal script is apparently undefined when I try to load the page.
Please explain how to use AJAX for an absolute brainlet
Joshua Stewart
stop using regex, it's slow as fuck
Camden Flores
you load something and then you get a callback when it's finished
Wyatt Bennett
Sup webhomos. I need to set up a temporary demo page that takes a stream and displays it. That's all it has to do. This was easy enough to do with a TCP stream and a video tag, but it turns out TCP is pretty high latency for a stream.
What's the simplest, hackiest way you can think of to get a low-latency(aiming for ~.5 seconds or less, currently it's like 3 seconds) stream working on a webpage? It doesn't seem like udp is an option without a lot of fucking around and learning webRTC or whatnot.
I'm using gstreamer to serve the stream, a bare flask page for the page that gets served and it's only going to be broadcasted in a local network.
Isaac Garcia
i just finished all the videos from code babes on youtube now that i'm a l33t h4xor
redpill me on vue
Ethan Butler
I need some js kode that will disable links on a page (userscript).
This gets the job done, but it doesn't work on newly generated links. $('a').bind("click.myDisable", function() { return false; });
I'd like something like this: (pseudocode, I don't know js) page.onClick((e) => { if(e.source.type == "href") e.preventDefault(); });
Chase Baker
It's plenty fast unless you do millions of searches.
Worrying about the speed of a single regex search is just dumb and exposes you as a brainlet who just cannot into regex.
Michael Davis
Step one: travel back in time to 2012 when AJAX was still relevant.
Jacob Morris
this is why websites in 2018 load slowly, don't be this guy
Christian Reed
oh. that's good to hear :)
do anons prefer it to React
Isaiah Watson
react or angular, don't waste your time on anything else.
Ryan Martin
If you don't think Ajax is still relevant then you have no idea what Ajax actually is.
It's Angular.js: The Good Parts. So it's pretty fucking tiny. It does present its "app as a tree of components observing some data and updating it in callbacks" story quite cleanly and is easy to get started with. It also targets a rather old version of JS, inventing its own class system for its components, etc. so it works pretty poorly with code completion, TypeScript and things like that. It has some ES6 class and JSX support but those are clumsy afterthoughts compared to React. Vue.js 3+ is supposed to be written in TypeScript so it's likely to improve in the future. Personally, I wouldn't mind a less boilerplate-rich React+TSX+MobX stack at all.
Jaxon Lee
I honestly don't give a shit what my ES6 transpiles to in order to be compatible with IE7
Write some JS to call fetch() and do something with the result once the promise callback delivers it.
Juan Kelly
Do anybody bother to learn basic stuff about GDPR?
I'm currently study web developing and the school want us to know the copyright law and GDPR.
Blake Kelly
What? Ajax isn't a feature of JavaScript, it's a conceptual way of doing things.
Are you maybe just talking about Fetch being polyfilled using XMLHttpRequest in older browsers?
Ajax just requires some method of doing HTTP requests and getting asynchronous callbacks. As originally specified, it used XHR, because that was the only way of doing asynchronous requests for a long time. Now that Fetch is a thing, using it in place of XHR doesn't change the core of what Ajax is.
Basically, if you're going to store any "personally identifying information" (which can be a really broad definition) about people currently residing in the EU, you have to have a privacy policy that states what you collect. You also have to have a method for people to request a copy of whatever data you have on them, and delete a user's data upon request.
Tyler Gomez
Anyone with experience using Polymer and WebComponents. That's the direction my firm is headed and I want to know if anyone has any thoughts about it.
Robert Cook
The "X" in A.J.A.X. stands for XML, implying XMLHttpRequest. I've never heard anyone use the term to mean the modern fetch() method, only to the oldschool way.
Nolan Thompson
>Do anybody bother to learn basic stuff about GDPR?
I wouldn't sweat about it unless you handle very sensitive personal data.
The truth is nobody really knows how to interpret the law yet because the text isn't that clear. There have to be some court rulings before there is certainty.
>Can I use the library for internal project? >The free library is only licensed to companies or individuals for use in PUBLIC web projects or applications. The public use can be behind a firewall, for free or for money, but the key is that other people will use it. It’s not for private use. You MUST list a website in the form where your project will be available to the public.
Lol, wtf is this jew shit?
Has anybody ever tried using the TV library? I wanted to see if I could literally just hack together a shitcoin exchange's live data with the tradingview API somehow, since the exchange itself doesn't have a TV chart and I want to draw some meme lines.
The X implies it uses XML, because it originally did. But the post mentions that using JSON instead is within the scope of the Ajaxapproach, so just because XML isn't used doesn't mean Ajax as a whole no longer applies.
And please read the link I posted: >Q. Is Ajax just another name for XMLHttpRequest? >A. No. XMLHttpRequest is only part of the Ajax equation.
If you or others are using it to just mean the XMLHttpRequest API, then you're using the term incorrectly.
Joshua Green
i doubt they actually vet any thing you submit them beyond being a valid format, put a git repo as the link and just never update the repo
Christopher Wood
Get rid of the quotes. Regex objects don't need quotes, they can be written as literals. Also, [i] is undefined in that little block.
Charles Gonzalez
That's what I was thinking, but >The free library is licensable to companies or individuals for use in public web projects or applications, for free, or commercial, distribution - not for private use. You’ll be asked to provide a link to your website before you start the implementation, >and another link after charts are integrated into your project.
So they probably follow up and cut off your access. Weird as fuck, I don't even know how that would work...........once you can see the github repo, wouldn't you just be able to download the code (even if it's obfuscated) and it'd still work, as long as you didn't then let other people use it and have tradingview find out & sue you or something??
Hunter Gomez
So?
The fucking whole thing stands for "Asynchronous Javascript and XML".
The key being asynchronous javascript you fucking mong.
Jayden Wright
Any good guide on how to improve Symfony performance? It runs a little bit slow sometimes.
Maybe I shouldn't have used it for this project, but I was eager to learn it.
Zachary Cox
meh i'm no lawyer user but it's not like they are gonna ask you for a projected deployment date, just say you're still working on it if they ask. worst case they cut you off. as for the repo, just make a new account and don't share the link anywhere, even if it's functional its not gonna end up on hacker news and ruin your Jow Forums advantage
Elijah Cooper
I'll be fucking honest lads, I went through w3schools to learn html/css and every step of the way I'd do little projects to play around with what I learned. I jumped back and forth too through the CSS reference stuff when I had an idea but wasn't sure what properties were available to design with. But one of the things I was doing regularly was building small webpages to try stuff and I was using one of the few tools I knew how that they gave me early on, floating shit with clearfix to make grids.
Then I get to flexbox and grid and what the holy fuck, I feel like I've been lied to. Like I'm a victim of abuse. I understand IE11, an archaic dead browser for dipshits, doesn't support grids. But why oh why was I led to believe I had to use bullshit fucking floats to make wonky grids.
the slow happens during routing, well I'm going to sleep, been doing this all day, If someone can throw away some advice I will be really thankful, I'll check back later
IE11 supports Flexbox fairly well. It, however, shits itself with Grid. Luckily we only have to support IE11 at my job.
Levi Scott
It's well known among professional web developers that W3Schools is a god awful resource. Nearly every page has outdated information and all of the tutorials were written 10 years ago by a bunch of pajeet codemonkeys. The only reason the site is still exists is because bad web developers keep pointing beginners to it, and it frequently shows up in the top search results in google.
Stop using W3Schools. Use MDN for reference, caniuse.com for compatibility checking, and udemy or frontend masters for tutorials.
Sebastian Lee
NEVER use W3schools
Eli Wright
Thanks, unfortunately that shit was basically the last step in their tutorials on css so it took me until the end to see the cruel trick being played, but I definitely don't intend to use them for anything else now that I know.
Good thing it didn't take that long though, I just dragged out their shitty tutorials longer than necessary by going off and playing around with what I was reading.
Nolan Morales
>It also targets a rather old version of JS, inventing its own class system for its components, etc. so it works pretty poorly with code completion, TypeScript and things like that. It has some ES6 class and JSX support but those are clumsy afterthoughts compared to React. can you expand on this
David Sullivan
w3schools is so fucking bad I can't even begin to describe how terrible a web developer you will would have been if you had kept following their tutorials. See this link:
what's the holy grail of scroll event throttling/debouncing ?
Caleb White
Are there any good embeddable social media aggregators that are free? I was taking a lot at some solutions and most charge ridiculous ass monthly prices.
Logan Gutierrez
Why is /wdg/ so much slower than /dpt/, despite webdev being more popular?
lets say i have 2 node servers, one of which is running on the root of my web directory (apache proxypass) and the second is running on a subdirectory (another proxypass, but with /directory added)
the second node app is still redirecting to root, ie in my code i use:
res.redirect('/users/login");
and it will redirect to mywebsite.com/users/login, whereas i want it to point to mywebsite.com/app/users/login
is there some way i can tell that node app it exists within a directory or do i need to change every single redirect and post to the absolute path of it's application files?
Jonathan Fisher
Web dev is a subset of programming, so I don't see how it could be more popular. Anyway, there are plenty of other topics in programming that are also popular. If you take /dpt/ as a sample, shitposting about functional programming is one of those topics.
Jonathan Nelson
OH FUCK I HAVE BEEN USING W3 FOR MY ENTIRE CAREER SHIT
Parker Lewis
What's that divit in her hand?
Christopher Hill
Check for existence of external script's function or object you are calling and if it doesnt exist, set timeout to repeat. Hacky af.
Alternately, don't defer the external script.
Grayson Morales
in jQuery, for dynamically added elements you add the listener to an outer container, and provide a target selector in the .on() declaration.
Instead of declaring your Vue components as classes you just give the framework plain objects with keys like "methods", "computed" and "watch", each containing functions that act as methods. Vue then invokes them as needed with "this" bound to whatever component instance is doing component things right now. So the type of "this" ends up being the component's state and the properties of the different component sections combined in a way that doesn't seem to work well with static type definitions. There's a "vue-class-component" library that provides a decorator to turn ES6+ classes into Vue's pseudo-classes, but it doesn't really even try to cover all the features. The magic decorator also doesn't typecheck very well, a major downside compared to something straightforward like class MyComponent extends React.Component {
which can give you basically perfect type safety even in huge applications.
Camden Reyes
Sup Jow Forums
I am wondering what hosting service I should use for a new project I got. At work I we use AWS, but I am looking at other options. The site I'm setting up for my client will just have a blog/news section and a small online shop (I plan to use Authorize.Net for the payments). I am just going to use HTML/CSS/JS, PHP, and some bash scripts maybe a little Python. I was gonna use MySQL but since I can choose whatever I want I might go with PostgreSQL to try it out.
Any suggestions on a hosting provider?
Lincoln Wright
currently my site layout is made in a way that the footer begins immediately after the lowest element of the site, with zero space inbetween
how can I change this?
Cameron Sanders
>udemy a bunch of stolen content gets posted there and the company's skeevy leaders don't give a shit. would not support / 10
awww cute, still doesn't make it less horrible, you fuckers are breaking the link chains
Leo Lopez
I'm working on two projects right now. The first is a projects/blog site with custom "CMS" in Symfony. The second is a video playlist site with user registration made in node.js/react.js, I'll use the youtube and/or vimeo api for the videos and add some other features later.The playlist will be designed to compliment educational videos.
Logan Sanchez
How does generateKeyframe() work for mobile screen sizes? I swear it's in reverse compared to the desktop screen size config.
Christian Thompson
Sadly, it doesn't seem to work with violentmonkey. To add more info about what I want to achieve - there are several pages such as, for example youtube search results page where I want to avoid clicking any of the search results. I use mpv to watch videos, so I'm either copy-pasting links or drag-and-dropping them to the mpv window. Sometimes I end up accidentally clicking on video during this process and as a result video starts playing both in my web browser and mpv. Maybe you'll have some other ideas on how could I achieve preventing that from happening.
Isaac Cruz
In San Francisco for the Twilio conference for work.
Just walking down the street there are so many people talking about coding. Every billboard is tech related or for some gay sex website.
So many homeless people. Been here two days and some crazy woman pulled a knife on another woman. Some guys were marking me waiting for me to walk away from hotel. 100s of homeless people and shit on the streets felt like I was in India.
Place is weird.
Adam Hernandez
Building a targeted CMS.
Also slowly working on a messaging app.
Brandon Perry
Render React on the server? Simple layout-only components are much cleaner than what most template langs can manage. Plus you can use the parts for front-end stuff later if you want.
Lincoln Lewis
thanks I might go with Google. that's where I purchased the domain name after all
Isaiah Brown
I just met with the Google Cloud people yesterday. It seemed pretty cool.
I made a lot of stuff with the Google APIs but they keep changing the damn dashboard so it kept me away from them.
They seem cool though. I got a pair of Google socks.
Eli Harris
>it's another messaging app episode.
Colton Edwards
Yeah I know.
It's more for marketing.
Caleb Torres
sounds good to me. my client wanted gmail and AdWords anyway. I'm sure implementing it all with Google will be smoother
Carter Gonzalez
I did a code thing for their Cloud SQL and it was pretty cool. I might give them a try too
Christopher Thompson
>use window load event >doesn't fire on page refresh >search for solutions online >they didn't work >delete everything >write function >call function inside the js document without listener >works on load works on refresh