/wdg/ - Web Development General

>Just post a JSFiddle instead of dumping all your JS and CSS into your post, fucking hell, is it really that hard to read the OP? Edition

Previous thread: >Beginner Roadmap and Overview
github.com/kamranahmedse/developer-roadmap
youtube.com/watch?v=UnTQVlqmDQ0

>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 to HTML/CSS/JS and Node.js or Django
freecodecamp.org - curriculum including HTML/CSS/JS, React, Node.js, Express, and MongoDB
javascript.info - curriculum providing a strong basis in JavaScript

>Further learning resources and documentation
developer.mozilla.org/en-US/docs/Web - excellent documentation for HTML, CSS & JS
hackr.io - crowdsourced collection of tutorials from across the web for learning languages and libraries (ignore sponsored stuff, look at upvotes)
learnxinyminutes.com - quick reference sheets for the syntax of many different languages (generally not sufficient on their own for learning something, but very helpful)
pastebin.com/gfBPg24A - Everything PHP

>Asking questions
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

Attached: wdg.png (1280x720, 180K)

Other urls found in this thread:

gender-pronoun-highlighter.herokuapp.com/
mynewblogavinashkr5408.blogspot.com/2017/06/upwork-2017-html-5-test-all-answers.html
freecodecamp.org
twitter.com/SFWRedditGifs

I have a drop-down menu that displays different dialog-type HTML elements depending on which menu item you click.
I was wondering, what would be a neat way to store and get the actual contents of the dialogs.

If there's just a handful of them, I can easily just write them all in my HTML document, and then toggle a class which determines if the elements are visible or hidden. But if I've got a bunch of those elements, my HTML document would become very convoluted with 99% hidden elements, while at most only one is visible at a time.

Storing each dialog contents in a separate file and then loading it with ajax is a lot neater, but is very wasteful and slow as hell. A HTTP request for each dialog opening is dumb, and I won't be doing that.

What other options do I have?

Sql

I'm trying to write travel agency website and i need to create a table that hold holidays multiple values, smth like multidimensional array. Is there a multi-dimensional table in sql like there is multi-dimensional array ? So far looking into mysql tutorials I only was able to find simple tables. What do I need to learn to create table like that?

example.:
Table Holidays:

holiday details:
1. duration
2. luggage etc...
pictures:
1. pic1
2. pic2 etc...

Javascript has to die for web development and any development

>multi-dimensional table
the are multi-dimension tables that are used mostly in data warehouses

see pic related (data cubes). excellent way of organizing data

Attached: Example-of-data-cube-visualization.png (428x317, 49K)

hm, really depends on the number of dialog elements and the amount of content inside of them.
If they all combined amount to a total of just a few kB of text, then there is no harm fetching the whole thing in a single request and create the elements dynamically, depending on which drop-down item was clicked I guess.

>thing you could do is wait till the domain registration expires and then register it yourself.
>Or mail them that you are interested in buying it from them.
the registry expires in a few months, what if its set to auto renew? is there a small window where I can snag it?

why? too hard for you?

JavaScript is fine you hater

I love javascript

Propose an alternative you mouth breather

>the registry expires in a few months, what if its set to auto renew? is there a small window where I can snag it?
If it's set to auto renew then you are pretty much fucked since it automatically renews itself when it expires.
If they set it to manual renew and forget there is a chance that it will become available again but i honestly wouldn't count on it.
Best thing to do is mail them if they would be interested in selling you the domain or look for a different domain name.

Do you have the Apple Macbook Pro with Retina Display?

No

the one from 2015. best creative tool ive owned

Do people hate javascript itself or $thebrowserlanguage (which happens to be javascript) so if another language was supported by all browsers would people hate that instead?

people hate the old javascript, and the hate persists cause they never used modern js

I'd say $thebrowserlanguage is more hated than JavaScript itself. And also $theelectronlanguage, and also $thechromelanguage
JavaScript/HTML/CSS just makes it too easy for unskilled, not talented developers to take up half your memory in some unidentified memory leak or complicating the DOM. JavaScript just has the biggest effect because often causes a somewhat delayed effect when giving inputs, worsening user experience

Hmm, I guess that's a good compromise. One small HTTP request for the benefit of way cleaner code.
But how do you reckon I should store the dialogs in another file? I mean if they were all separate .html files, I could just .load(file) and stick the resulting data into DOM.
If they're all in one file, I need to somehow parse the file before getting the data I want. My first instinct would be to have a .html file with one big in it that contained all of the separate dialog elements, and I'd get the one I want with getElementById or something.
But idk if that's an elegant way to do it. What do you think?

Attached: 1550614788473.png (1300x866, 1.04M)

gender-pronoun-highlighter.herokuapp.com/

Can't say since I don't know how your setup looks.
I generally use build tools like Webpack, Parcel or static site generators, so for me the first thought would be to keep that data in some JSON file or some lazy loaded Vue/React component, when you intend to create the content dynamically anyway.
Definitely don't use a HTML file for simply storing data.

If you don't use any kind of build setup, then I guess a simple JSON file that you fetch later will do.

Use C# for everything

Bill Gates pls leave

how hard is it to make a drop shipping website where people order things and other people ship them?

I want to make a website and make money but i don't want to deal with shipping and i don't want it to take much time

how to passive income website?

why don't you guys talk about making money

I wish they would kill off half of the web shit.

Like serverless and dynamodb and just about everything Amazon offers is some useless cancer with a horrendous and overcomplicated UI. I look at their stuff like I look at PHPmyadmin. Useless junk. I watched some dev stream and it took them 30 minutes to set up their environment using AWS and they worked at AWS. I tap the shit out CLI and from a dead empty server to my preferred stack in 5 minutes flat.

yes, 2018 model with the touchbar.

It's my first mac but I needed it for app development.

no, I find women attractive

We do talk about making money. A lot.

I know what dropshipping is. There's no reason to make a site for dropshipping. Just use shopify like everyone else that does it and trial it for a few months to see if you'll get sales.

Dropshipping is hard btw. Not a lot of good items that haven't been taken. Last good one I heard about was those expandable garden hoses. Talk about niche..

You'd be better off starting a clothing brand and hiring artists off fiverr to design shirt art for you, then use one of the thousand tshirt services to print and ship your shirts. Many of them have APIs where you can place orders.

Today our Linux/bash teacher made us do an exam. The thing is it had feminism inspired neutral pronouns, with male gender biased pronouns (I'm spanish, so we have such thing, masculine pronouns are in many cases the neutral form, for plurals for example) and propossed gender neutral pronouns. It was light, and today is the only day he has done something like this, and I'm guessing it is because tomorrow it is international women worker's day. But if it wasn't because it has been a one day thing I'd be pissed off and I might even write a complain to somebody. Nu-feminism, not even once.

Attached: plaid4.png (894x520, 319K)

>tfw there are only C# dev jobs in your area
I don't even use windows anymore. Why am I being discriminated against?

user, what hosting would you recommend for a site that would host some content added by users (to be more precise - content drawn by users)? I really want to implement that drawing feature, but I don't want to lose the whole project due to some moron posting some offensive shit and some other moron reporting the whole site.
So, if anyone here had similar experiences or concerns - how had you managed the risks? Are there hosting providers that just don't care, or at least would give you a reasonable amount of time to remove the questionable content? I wanted all drawings to last for a limited time anyway, to avoid running out of storage space.

Attached: 9725cef0851ccabb41d83e1d48c0e78a.jpg (570x510, 50K)

There's always the option of content being approved by moderation before being submitted to public view.

>how to passive income website?
It's difficult today. Small websites are ad free. People are picky and judgemental when they see ads. Gone are the days of blogposting selling your dumb ideas and then slap an ad to it.

That solution wouldn't fit this particular project at all. I'm a one-man team, so pre-moderation would be extremely slow. I guess even invites-only community would be a better solution.

Regex niggas. How do I check if a string is a word and nothing else, for example the string must be 'success' or 'error', it cannot be 'successful' or 'this is a success'. Only those words and nothing before or after it.

Honestly if you are worried about being shut down when users start drawing dicks and stuff, then you can always just use your own server or something like that from home ?
My country is pretty lax in terms of adult stuff (a lot of hosting providers allow it by default) unless it's really illegal stuff (like child pornography and other stuff like that).

nvm fixed it

(\bsuccess\b)|(\berror\b)

CSS

What? Why regex? Can't you do str === 'success'?

Or I guess /^success$/ to match start and end of line.

That matches 'this is a success', which you didn't want, right?

The usual way of handling this in an RDBMS/SQL is creating a separate PICTURES table, and creating an entry for every picture. Then, add a HOLIDAY DETAILS foreign key to every picture entry, so you can get the pictures related to the HOLIDAY DETAILS with a simple JOIN.

That's the entire point of RDBMS, you build relationships and join when you need to get the data back.

If you want to store things as objects use a noSQL database.

how do I drop one child with jQuery?
what I imagine:
$('.parent').drop('.one-specific-child').parent()
would return the parent element but without the one child.

How do you avoid CSS bloating?

removeChild?

how does one write CSS?
I mean sure, it could get bloated if you used 3rd-party-code, but if you write it all yourself, you can just like write it neatly

why do you need to use jQuery for that?

>I mean sure, it could get bloated if you used 3rd-party-code, but if you write it all yourself, you can just like write it neatly
That's kinda the problem. When I was writting my Scss I was grouping them by component and ended with a file like this:
@import "components/Box.scss";
@import "components/Button.scss";
@import "components/Form.scss";
@import "components/Grid.scss";
@import "components/Label.scss";
@import "components/Layout.scss";
@import "components/Font.scss";
@import "components/Master.scss";
@import "components/Textbox.scss";
@import "components/Tile.scss";
@import "components/Validation.scss";
@import "components/Variables.scss";


But soon I had to use bootstrap and MDL because the bosses "liked" the way it looked. So styling components is now a nightmare. I have to put tags from 3 frameworks.

I'd like to
-grab an element with $()
-remove some elements from the object, but not from the dom.
-then do stuff with the object

Why jquery? Because wordpress has it by default. Also has underscore but idk how to use that either

The point of having objects that represent the DOM is that they represent the DOM.
Tell me what problem you're trying to solve.

Otherwise, if you're adamant that this is actually what you want to do (improbable);
You'll need to create a deep copy of the object returned from $(), and then while creating the deep copy, skip over the child you don't want to copy.

Or you could, like, create a copy of the element that you got from $(), remove a child from it, and then manipulate it the way you want to, then if you want, replace the original with the copy.
t:

Also, the object returned from $() isn't an element, it's a jQ wrapper of an element. It has a whole bunch of stuff in adddition to the element itself, so you might want to do whatever you want to do on the $(element)[0] instead of $(element).

Yeah I figured I'd clone it.
What I'm doing is grabbing the element that has all the post data $('.entry-content'), and then sending the html to backend. But there's stuff that isn't actual post data, like the '.author-info' so I want to strip that out first.

Why do you send the HTML to the backend? Why not send just the data?
Could just stuff all the element.textContents you want to a JSON string?

I want to preserve the formatting. Text colors, etc. in the tags as classes, and tags and so forth.

I feel like that's bad practice but I'm too tired to think of a better solution. I'd recommend JSON with like the classes defined as strings.
But I'm just an user, what do I know.

Attached: jxdc8c0eg1n01.jpg (845x592, 203K)

How do I design custom HTML components? I heard Google was making a framework for that but I forgot the name. Should I do that instead of doing normal JS, CSS, and HTML?

didn't need to .clone() after all. Simply took all the elements and mapped the outerHTML's after filtering out unwanted elements.

why wouldn't the component import its own (possibly scoped) CSS?

I never properly learned Sass. I just made a bunch of components, importing things along the way, and in the end I gathered everything in that .scss file to compile with: node-sass --include-path components main.scss main_unpurged.css & css-purge -i main_unpurged.css -o main.css

Using CssPurge to remove the duplicate entries that importing caused.

node-sass --include-path components main.scss \
main_unpurged.css & css-purge -i main_unpurged.css -o main.css

So, I'm using some custom fonts on my website but it seems to only load on the desktop version of the website, but not on the mobile version. Am I doing something wrong? I added like half a dozen file formats because I thought that might be it, but it seems like it's not. It's being loaded as:


@font-face {
font-family: "CustomFont";
src:
url("mywebsite/font.woff") format("woff"),
url("mywebsite/font.woff2") format("woff2"),
url("mywebsite/font.otf") format("otf"),
url("mywebsite/font.ttf") format("ttf"),
url("mywebsite/font.svg") format("svg"),;
}


and just calling the font family where I want it

Don't you have to set the font weight for certain font types as well ?

trailing comma

Use JSON in the column fields?

Oh fuck me, I'm fucking rarted
thank you my good frend

Attached: 1549212637132.jpg (562x750, 55K)

happens to the best of us, my dude

Attached: 1551156457684.gif (500x381, 340K)

I wanna make it so bad.

read,practice,and create.once you get to the create part,start applying for jobs.there is no short-cut to this.

Google uses Angular
But a fundamental understanding of JS,CSS,HTML is going to be important whether you use a framework or go vanilla
Shit like Angular, React, or Vue just build on top of that to make complexity easier to manage

post design inspo pls

gotta finish my portfolio, and i've been working on this for too long, everything looks the same and shit

How long would it take for a person with no knowledge to create a site like Jow Forums or reddit?

Attached: 1532286179628.jpg (4032x3024, 1.22M)

The sites themselves aren't difficult to create at all. If you have basic knowledge of front- and backend languages, you could shit one out in like a few days.
A few weeks if you wanna make it proper.

I'd say the most difficult (both personally and objectively) is the load-balancing and generally making sure the site supports millions of simultaneous connections without shitting itself. This inculdes handling devops, code optimization, getting dosh to host it all, etc.

I have built a static vue page without nodejs. All content is in templates within a .js file. The page itself works fine but Google crawlers simply don't read the content. Is there any way to make Google render the content as well?

you could make an image board work pretty quickly, getting it polished requires years of user input and fine tuning. It's like setting up a business. How long would it take you to open up a hamburger store like mcdonalds? Well shit you could go get a stove and some meat and buns and be making hamburgers that are better than mcd burgers in literally 1 day. But getting it hammered out to scale, to be profitable, to work in location after location for many many customers well that could take years and millions of dollars

basically if you look at one of the biggest sites on the internet that has been honed and refined for years with millions of dollars the answer as to how to recreate it's actual polish and functionality it is always going to be "years and millions of dollars"

>mynewblogavinashkr5408.blogspot.com/2017/06/upwork-2017-html-5-test-all-answers.html

does anyone actually even use html in any of the ways these questions are asking?
it's like someone just went through a glossary of html terms and is just asking what some random thing does.

>html

I'm already a dev. I meant I want to make it, not make it into wage slavery. I want one of my projects to take off.

Thanks boys that is helpful. I'll get started on the beginner programs now. I'll keep myself grounded that it will take a lot of time but that's okay

Is it better practice to use Sequelize/Mongoose or just use the low-level database drivers and write queries manually?

>freecodecamp.org - curriculum including HTML/CSS/JS, React, Node.js, Express, and MongoDB
How good is this?

>Node.js, Express, and MongoDB
Memes, but the rest is good

why do you choose one database over another?

I just postgres everything when I need one. Why is this a bad idea?

depends on the use case, obviously

sqlite3 -> small amounts of data
Oracle/PostgreSQL -> huge data

are you dense?

Says 1800 hours to complete the entire course. How much of an over-estimate is that?

doesn't that also include something like 800 hours non-profit work?

Same. My websites are great and bring me joy. My job sucks the life out of me.

But my 2000 visitors a month don't bring in 2000 dollars a month.

what?

Attached: Captgfdsgfdsgsfdure.png (524x198, 10K)

can't you do it with

Attached: 1465911254249.png (474x311, 151K)

Niggas, for an OP shop.

Attached: 1551995600864[1].jpg (790x1062, 80K)

that's unpleasant to look at desu

He's just trying to live his life man

yes

Anyone here have some good resources for using laravel as backend for an android app?

guys what is the best website hosting service

linode.com

Attached: kandinsky.jpg (930x947, 833K)

interview question:

>Why angular websites have low SEO?

jewgle crawlers don't execute the javascript, so when they cross a page generated on the front end it looks blank to them.
kind of. I think they also run stuff that executes it and looks, but it doesn't do as much? i've heard mixed answers.

>Did the interviewee just say jewgle?

>why is he rubbing hands together?

You should learn HTML, CSS, and JS pretty well before you even really look at Web Components.

Also, Web Components are a browser standard, but they still don't have great support. Part of Google's Polymer project is a polyfill so that you can use web components across various browsers.

There are various other parts of Polymer, which give you tools for creating web components more easily, and I think some standard components that they've created.