/wdg/ Web Development General

>Web Dev 101
youtube.com/watch?v=erEgovG9WBs

>Free beginner resources to get started with HTML, CSS, JavaScript and PHP
eloquentjavascript.net/Eloquent_JavaScript.pdf - A modern introduction to JavaScript
developer.mozilla.org/en-US/docs/Learn - A good starting point to learn about web dev fundamentals
javascript.info/ - Quite a good JS tutorial
theodinproject.com - Curriculum including HTML/CSS/JS, and either Ruby on Rails / SQL, or Node.js / MongoDB
fullstackopen.com/en/ - Requires you to have basic web dev, db and git knowledge
flexboxfroggy.com/ and cssgridgarden.com/ - Learn flex/grid in CSS
phptherightway.com/ - A decent PHP resource
phptutorial.net - A PHP tutorial

>List of design resources
github.com/bradtraversy/design-resources-for-developers

>All useful documentation in one place
devdocs.io

>Need help? Create an example and post the link
jsfiddle.net - if you need help with HTML/CSS/JS
3v4l.org - if you need help with PHP/HackLang
codesandbox.io - if you need help with React/Angular/Vue

We have our own website: wdg.one
Submit your project progress updates using this format in your posts, the scraper will pick it up:

:: my-project-title ::
dev:: user
tools:: Flutter, Php, etc
link:: my.website.com
repo:: github.com/user/repo
progress:: Lorem ipsum dolor sit amet


Previous:

Attached: 46d002b46c5f78560d47ecf4664d1fe4.jpg (1920x1080, 320.92K)

Other urls found in this thread:

git.lolcat.ca/lolcat/rena_mumble
stackoverflow.com/a/3513858
twitter.com/AnonBabble

I like javascript.

I LOVE javascript.

I LOVE htmx + alpineJS

I love learning react. but I wonder when I'm ready to apply to places. I see other people posting some really incredible stuff online saying they can't get jobs and when I look at my projects in comparison there's no way unless I skate by on culture fit or something. webdev is tough.

it's ok.
it's not that great.

Attached: 1662151042742339.png (560x420, 70.04K)

That’s because everyone and their fucking mother knows React

Learn something used by enterprises, like Java/Spring or C#/.NET

REAL THREAD:
Say no to the tranime schizo

I dont know which thread is real so I'm gonna repost Doesnt really count as webdev, but its made in nodeJS so it still counts.

I made a music bot for mumble, please use it!
>git.lolcat.ca/lolcat/rena_mumble

Attached: 1.png (951x951, 409.98K)

The other thread is the correct one.
This one was created by a schizo newfag from Any Forums who spams the board with anime. Hijacked all the generals and spends all day creating spam threads with stupid questions like "recommend me some headphones", exclusively with anime images in the OP. Doesn't recognize non-anime OPs as valid and uses his trannyjanny friend to remove them. The man is sick and destroying the board.

faggot you have to go back

I just finished a web app that also lets you interact with it using your own HTTP client. Never mix your browser and API endpoints. I learned this the hard way

Is there a reliable way to differntiate normal browser GET calls (when the user clicks on things) from calls made via xhr? I want to include some html in the response content so the user might see it but if that request has been made via xhr then he obviously can't see it.

My current solution is to set content-type to application/json on all my ajax calls.

I wrote a C++ webserver that tricks Javascript into thinking it's running PHP scripts from AJAX requests, when in reality I'm just manually parsing HTTP messages in C and then redirecting POST messages to my C++ functions and then sending the response data back to the client with "200 OK" at the end. Is this a good way to avoid using Electbloat and Chode.js for WebApps?

Made a thread about this but should have started here:

Designing a simple service where a user can get and put into a database. Am getting a little caught up in proper security.

In step 3 when someone invokes the API, can't a 3rd party sniff out that request and now has that user's token permissions? Or is literally the only safeguard against this a secure https connection?

Part 2: aside from using auth for user credentials, using those credentials for talking to API, are there other major security practices to consider? I'm assuming the connection between API/Lambda/Dynamo is internally secure, and doesn’t need to be guarded against.

Any straightforward literature on the matter would be appreciated. I'm kind of shooting for the hip and not sure if I'm missing any basic considerations

Attached: auth.png (1400x810, 148.52K)

Treat a client as a web browser if their Accept headers prefer text/html and application/xhtml+xml the most. XHR will almost never communicate to servers with these MIME types anyway, and if you really care, then you can feature test with javascript inside the HTML response and whitelisting user agents. But this is brittle and overkill.

>Treat a client as a web browser if their Accept headers prefer text/html
This is smart i did not think of this header at all. Thanks I will try that.

Can anyone give me a hand with some JavaScript please?

Trying to use "location.href.split". I want to capture the first part of the URL after the TLD including the trailing slash, e.g. website.com/page/ - I want to select /page/ or /page or /page/subpage/.

Currently, I can select it without the trailing slash but not with. I'm using location.href.split('#')[0] but I don't know exactly what to change.

I figure the [0] should capture the first part but the # is probably the issue. I'm not sure how to modify it correctly though.

Sounds like you want to get path components of your URL. Regular expressions should help. See stackoverflow.com/a/3513858 for an example

Thanks, I figured I might need a regex approach but thought there might be something simpler.

For the sake of clarity, is the "#" in "location.href.split('#')[0]" meant to be regex too? In Regex, it's apparently matching all characters exactly (case-sensitive).

>location.href.split('#')[0]
The character you provide to split() is not a regular expression; it will only look for the exact same character you've given it