/wdg/ - Web Development General

>COMPLETE BEGINNERS GUIDE
github.com/kamranahmedse/developer-roadmap

>Free beginner resources to get started
Get a good understanding of HTML, CSS and JavaScript.
developer.mozilla.org/en-US/docs/Learn - a good introduction (independent of your browser choice)
freecodecamp.com
codecademy.com
hackr.io

>Further resources
developer.mozilla.org/en-US/docs/Web - excellent documentation for HTML, CSS & JS
github.com/kamranahmedse/developer-roadmap - Frontend+Backend learner-path suggestions
[YouTube] Web Development in 2018 - A Practical Guide (embed)

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

>PHP resources
pastebin.com/gfBPg24A

Attached: 1530712624396.webm (640x360, 645K)

Other urls found in this thread:

stackoverflow.com/questions/32413279/defer-scripts-and-execution-order-on-browsers
adaptivepath.org/ideas/ajax-new-approach-web-applications/
tradingview.com/HTML5-stock-forex-bitcoin-charting-library/
web.archive.org/web/20130302014219/http://w3fools.com/
codepen.io/user/pen/QZmGrz
npmjs.com/package/get-video-duration
signal.twilio.com/
twitter.com/AnonBabble

I’m gay.

Also, answering PHP related questions.

I'm PHP.

Also, answering gay related questions.

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?

fucking regex.
This I why I quit programming.

forgot a = but whatever

Is it best to insert the penis orally or anally when doing pattern matching?

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.

Two holes needs two solutions.

Try triggereing a key event with the code set to 13

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()

Any particular reason? If you're interacting with a form, you can just submit it.

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.

$(formElement).submit(); without arguments is equivalent to $(formElement).trigger('submit');

Nevermind, submit() works, just had to target the form itself not the input box.

How do I make a Json that contains 2 groups and in each group a list of names?

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";
}

apparently the content of .match() has to be an object, just like you said

Spent an hour debugging a '/' at the end of the string. Well, this is learning.

redpill me on vue

Attached: 1539427573386.jpg (735x490, 87K)

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.

stackoverflow.com/questions/32413279/defer-scripts-and-execution-order-on-browsers

Wat do?

it's good

Please explain how to use AJAX for an absolute brainlet

stop using regex, it's slow as fuck

you load something and then you get a callback when it's finished

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.

i just finished all the videos from code babes on youtube
now that i'm a l33t h4xor

redpill me on vue

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();
});

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.

Step one: travel back in time to 2012 when AJAX was still relevant.

this is why websites in 2018 load slowly, don't be this guy

oh. that's good to hear :)

do anons prefer it to React

react or angular, don't waste your time on anything else.

If you don't think Ajax is still relevant then you have no idea what Ajax actually is.

Attached: amir_facebook_privacy_cup.jpg (337x410, 30K)

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.

I honestly don't give a shit what my ES6 transpiles to in order to be compatible with IE7

I meant how to set it up

fetch(url)
.then((response) => { /* do something */ })
.catch((error) => { /* handle error */ })

Write some JS to call fetch() and do something with the result once the promise callback delivers it.

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.

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.

This is the original post defining what Ajax is:
adaptivepath.org/ideas/ajax-new-approach-web-applications/

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.

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.

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.

>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.

tradingview.com/HTML5-stock-forex-bitcoin-charting-library/

>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.

Attached: Gnlpu7D[1].png (1196x663, 92K)

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.

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

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.

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??

So?

The fucking whole thing stands for "Asynchronous Javascript and XML".

The key being asynchronous javascript you fucking mong.

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.

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

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.

Attached: REEEEEEE.jpg (404x426, 18K)

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

Attached: ernest-hemingway-typewriter-promo.jpg (1200x630, 71K)

IE11 supports Flexbox fairly well. It, however, shits itself with Grid. Luckily we only have to support IE11 at my job.

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.

NEVER use W3schools

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.

>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

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:

web.archive.org/web/20130302014219/http://w3fools.com/

...

what's the holy grail of scroll event throttling/debouncing ?

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.

Why is /wdg/ so much slower than /dpt/, despite webdev being more popular?

Attached: image (5).jpg (1080x1349, 108K)

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?

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.

OH FUCK I HAVE BEEN USING W3 FOR MY ENTIRE CAREER
SHIT

What's that divit in her hand?

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.

in jQuery, for dynamically added elements you add the listener to an outer container, and provide a target selector in the .on() declaration.

$('body').on('click tap', 'a', function(e) {
e.preventDefault();
)};

Can I ask questions about nginx?

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.

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?

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?

>udemy
a bunch of stolen content gets posted there and the company's skeevy leaders don't give a shit.
would not support / 10

codepen.io/user/pen/QZmGrz

put some margin-top on your footer, or margin-bottom on the element that precedes it

What are you guys working on?

I'm writing a simple node function for checking if a video exists via it's video duration using npm's get_video_duration which uses FFMPEG.

npmjs.com/package/get-video-duration

I'm making a video syncronizer and chat similar to synchtube using timers in socket.io and an if statement to say if someone's video is >2 or

If you're designing your site yourself without any CMS, is there any reason not to use ajax for all form submissions?

I would only consider AWS, Google, or Azure. Need me those cloud features.

which templating engine should i use?

i already use handlebars but defining helpers is getting old

pug syntax looks awful

is there anything more suitable than handlebars but still keeps html syntax?

>again no link to past thread
getting real tired of your shit niggers

STOP MAKING THREADS WITHOUT LINKING TO PAST THREAD IN THE OP, FOR FUCK'S SAKE

Attached: 1530299510193.jpg (278x282, 11K)

it's good to know floats and shit since you might need to support older browsers at some point

t. only knows floats

I'm the guy who made the first thread without link, the one with the cat pictures. I stopped making threads after that blunder, I was so ashamed.

Attached: 1539012966323.jpg (600x398, 42K)

awww cute, still doesn't make it less horrible, you fuckers are breaking the link chains

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.

How does generateKeyframe() work for mobile screen sizes? I swear it's in reverse compared to the desktop screen size config.

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.

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.

Building a targeted CMS.

Also slowly working on a messaging app.

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.

thanks I might go with Google. that's where I purchased the domain name after all

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.

>it's another messaging app episode.

Yeah I know.

It's more for marketing.

sounds good to me. my client wanted gmail and AdWords anyway. I'm sure implementing it all with Google will be smoother

I did a code thing for their Cloud SQL and it was pretty cool. I might give them a try too

>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

I ain't changing this.

>Twilio conference

>signal.twilio.com/

>speakers
>Tony Hawk
>Legendary Skateboarder

>Jonathan Nolan

what made tony hawk so legendary?