Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
teen phone cutie
Jun 18, 2012

last year i rewrote something awful from scratch because i hate myself
yeah I used the underscores Wordpress base theme to create my personal site, and it was pretty fine :shrug:

Definitely gonna have to learn Drupal. It's on every job application.

Adbot
ADBOT LOVES YOU

teen phone cutie
Jun 18, 2012

last year i rewrote something awful from scratch because i hate myself

PT6A posted:

Drupal is slightly more powerful than WordPress but still pretty awful to work with.

If you have hosting that can support it, Django is definitely my favourite thing to work with. Very flexible, easy enough to set up, simple to explain to whoever's going to be making edits, and it's easier for me as the designer/developer to control how things end up looking while still allowing the client the ability to change content, since the data is as well-structured as I choose to make it.

Do you need to know Python to work with it?

Can you give some examples of how it works as a CMS?

teen phone cutie
Jun 18, 2012

last year i rewrote something awful from scratch because i hate myself

Well poo poo

teen phone cutie
Jun 18, 2012

last year i rewrote something awful from scratch because i hate myself
Dang. I never knew there was so much of a stigma on JQuery now.

Granted, I've never really used it other than for simple DOM manipulation and other functional stuff, but I work with BigCommerce and their entire platform depends on it.

teen phone cutie
Jun 18, 2012

last year i rewrote something awful from scratch because i hate myself

Dominoes posted:

Hey dudes. I'm clearly new to web dev, and just posted about how nice Jquery is. I've been skimming react tutorials, and it looks like it does similar things, but with much nicer syntax, and not abusing ids/classes. Is there a good reason not to switch to React for dynamically creating and modifying elements? It does look like it might be a pain to integrate into non-react code, since it doesn't use valid JS... Ie I can't just put a script tag like with jquery, angular etc.

If you're just doing simple DOM manipulation or some small functionality, there's no reason not to use vanilla JS or Jquery.

The idea behind React is to componentize your code. Components can be as simple or complex as you like (It could be a small form or an entire set of elements(like products on your ecommerce shop). React is meant to be read from top to bottom as well, since you typically include functionality in a component and then render HTML at the very end. It's also great for handling state and performing actions based on where a component is in it's lifecycle (mounted/unmounted)

You could include just a bit of React in an existing project, but it may not even be worth the trouble depending on what you're trying to do.

teen phone cutie
Jun 18, 2012

last year i rewrote something awful from scratch because i hate myself
If you're targeting specific ids like 100 times in a file, sure.

teen phone cutie
Jun 18, 2012

last year i rewrote something awful from scratch because i hate myself
The head of our web dev department thinks that "mobile first" is just a buzz-word and isn't an actual thing. :stare:

teen phone cutie
Jun 18, 2012

last year i rewrote something awful from scratch because i hate myself

Thermopyle posted:

React is the absolute-fuckin' best. But like has been mentioned it's overkill for light DOM manipulation.

You can use React via a script tag and no transpiling of JSX if you use React.createElement instead of JSX, but I think it's a very small subset of the time where that's a good plan. If you've got a page already built with regular JS, but want to introduce a component to the page that would really benefit from React, that might be a good time do it.

Anyway, much of the activity in modern web development is focused on building your DOM mainly with JS and the only HTML you write is a skeleton of sorts. Since I know you do Python apps, I particularly encourage you to learn React as it is great at building dynamic UIs, and you can go down the very powerful path of building your UI for Python apps with React instead of lovely Qt.

I reread this post and it got me thinking: Do people use React to build full on websites that have a lot of functionality?

I know Nordstrom Rack uses React heavily, but I can't think of many sites that use it heavily (Facebook even uses it sparingly). is it overkill to build an entire site in React?

teen phone cutie
Jun 18, 2012

last year i rewrote something awful from scratch because i hate myself
Recommendations on where to learn to work with RESTful APIs and working with returned JSON data?

I've started working with the BigCommerce API since I work in eCommerce, using Curl to connect toe API, and now that I'm connected, I'm not really sure what to do/how to use the returned data.

Gotta learn this stuff for work, and it's really out of my comfort zone. Only thing I've done with PHP is CRUD apps, and I've only used AJAX/JSON sparingly.

teen phone cutie
Jun 18, 2012

last year i rewrote something awful from scratch because i hate myself

Maluco Marinero posted:

I think it really depends on what's doing things with the returned JSON. Are you building a full JavaScript web client or a server that renders templates using information from the API.

Usually the biggest questions to ask about using third party apis are what information needs to be stored by, and what can you get just in time.

For instance, if you're using product descriptions and stock counts, it would probably make sense to store that stuff on your own server so you're not calling every page you serve. Most of the thought around using APIs is really just thought about how you'll deliver information from the API and transform into information useful to the user.

There are lots of different ways to do that depending on what your building.

Yeah I mean what I'm trying to do right now is grab all the products in my store, and parse through the data and format it better. I got as far as grabbing all my products in JSON format and I'm pretty lost. I have zero experience with this stuff.

I'm not really building anything. I'm just messing around.

Thermopyle posted:

You just used whatever your language/framework uses to parse the json and then you've got objects, arrays, maps, whatever and the same for sending it but in reverse. That's about all there is to it.

This is pretty much where my problem lies. I don't even really know how to do this stuff.

I guess what I'm really asking is for a tutorial to parse JSON data with Javascript? Correct?

teen phone cutie fucked around with this message at 22:11 on Mar 20, 2017

teen phone cutie
Jun 18, 2012

last year i rewrote something awful from scratch because i hate myself
Just updated to the new version of VSCode and now I'm getting this error:

Extension host terminated unexpectedly. Please reload the window to recover.

Anyone else?

e: Yes, apparently:

https://github.com/Microsoft/vscode/issues/24028

teen phone cutie
Jun 18, 2012

last year i rewrote something awful from scratch because i hate myself

Love Stole the Day posted:

Passing on a recommendation here: https://www.gitbook.com/book/frontendmasters/front-end-handbook-2017/details

It's an e-book that is basically a huge list of links to other websites (videos, courses, and articles; both paid and free) sorted by topic for everything you'll ever need to learn about front-end stuff. It has like 10~20 links to resources for every topic.

bookmarked!

e: or downloaded whatever

teen phone cutie
Jun 18, 2012

last year i rewrote something awful from scratch because i hate myself

Data Graham posted:

At last a worthy thread subtitle.

No. This should be the thread title:

Tei posted:

I don't know why your code do this.

teen phone cutie
Jun 18, 2012

last year i rewrote something awful from scratch because i hate myself

Thermopyle posted:

I'm not a designer or really even much of a design-implementer-sorta-guy (just not something I enjoy). Because of this I use Bootstrap for MVP's until we decide its worth it to bring on someone who does have some skills in this area.

I'm just kind of tired of Bootstrap. Anyone have anything else they like to use? Particularly interested in feedback from people who have used multiple CSS frameworks...

I've looked at this a little, but it seems awesome

http://materializecss.com/

teen phone cutie
Jun 18, 2012

last year i rewrote something awful from scratch because i hate myself
Create-react-app, the lynda.com tutorial, and the codeacademy courses are the go-to things i recommend.

Oh and obviously the documentation

teen phone cutie
Jun 18, 2012

last year i rewrote something awful from scratch because i hate myself
Hmm. You mean just one domain that users go to to buy from multiple stores? Or like one account that has multiple stores/domains

At work, we pretty much exclusively work with BigCommerce which is great for mid-sized stores that are too big for Shopify. Their new templating engine is great for developing locally and the app marketplace is pretty great too.

I think when it comes to eCommerce platforms, it's really about the devil you know, but BigCommerce stores are generally fast and easy to develop. It really feels like you're developing a website in 2017, as they utilize webpack and handlebars.js. I'm not sure if it's exactly what you're looking for, but it's definitely geared towards shops that are too big for Shopify but don't want to spend the money on some large enterprise platform

That being said, BigCommerce is the only eCommerce platform i've worked with, so definitely take my advice with a grain of salt.

teen phone cutie
Jun 18, 2012

last year i rewrote something awful from scratch because i hate myself
edit: nevermind. gently caress lovely client sites

teen phone cutie fucked around with this message at 21:31 on Jul 3, 2017

teen phone cutie
Jun 18, 2012

last year i rewrote something awful from scratch because i hate myself
Anyone else taking that Udacity React course?

Costed $500, but I'm getting reimbursed by my company which is pretty sweet.

teen phone cutie
Jun 18, 2012

last year i rewrote something awful from scratch because i hate myself
Live chat help and the instructors will review your code and tell you where you could improve.

I agree it's totally not worth $500, though

teen phone cutie
Jun 18, 2012

last year i rewrote something awful from scratch because i hate myself
drat that really is the american dream. Nice job!

teen phone cutie
Jun 18, 2012

last year i rewrote something awful from scratch because i hate myself
I have a pretty weird issue. I'm trying find a regex that I can use in a js replace() that will replace all digits in a string, but not the digits that have letters next to them.

So if I had

123 3rd st

it would output

3rd st

And keep the 3. Any ideas?

teen phone cutie
Jun 18, 2012

last year i rewrote something awful from scratch because i hate myself
I have a <a></a> that by default is unclickable

code:

.element{
   pointer-events:none;
}

and then I want to later make it clickable

code:

  $('.element').css("pointer-events", "unset");

This doesn't work in IE. It stays unclickable. Is there a better way to do this?

teen phone cutie fucked around with this message at 15:46 on Aug 18, 2017

teen phone cutie
Jun 18, 2012

last year i rewrote something awful from scratch because i hate myself
Sorry should have been more clear.

It's for an <a></a>, not an input element

teen phone cutie
Jun 18, 2012

last year i rewrote something awful from scratch because i hate myself

Lumpy posted:

have a class .no-pointer-events { pointer-events:none; } and remove the whole class.

yeah I guess I'll just try this.

Man gently caress ie for real

teen phone cutie
Jun 18, 2012

last year i rewrote something awful from scratch because i hate myself

DICTATOR OF FUNK posted:

I dunno about a purely CSS solution, but you could do something like this: https://jsfiddle.net/6ztL2wrr/

yeah I ended up just adding and removing a class and that worked :shrug:

teen phone cutie
Jun 18, 2012

last year i rewrote something awful from scratch because i hate myself
Congrats man! It's always a nice feeling to put something out there.

teen phone cutie
Jun 18, 2012

last year i rewrote something awful from scratch because i hate myself

Thermopyle posted:

Yeah, there's lots of people out there who don't really know javascript...they know jQuery.

I can't really say that's wrong, because it works for them (or some portion of them), but I wouldn't want to be in that situation.

at work we have a coding test for interview candidates.

Some questions involve writing some functionality in jQuery. The supposed hard part is to turn the jQuery into vanilla JS. This test is super outdated and hasn't been changed in like 5 years.

teen phone cutie
Jun 18, 2012

last year i rewrote something awful from scratch because i hate myself
I have a question about backend programming because I'm not a backend programmer and I'm not super clear on a lot of concepts.

I get on the front-end you can run HTTP requests to get data from a server and you never want to write to a server because all the code is viewable to the user. In back end languages like PHP, for example. do SQL queries take the place of HTTP requests. Is there a point to using both? What's a use case where you would need to use an HTTP request on the back end to get data from a server or write to a server?

teen phone cutie
Jun 18, 2012

last year i rewrote something awful from scratch because i hate myself
ahhhhh okay.

So you really can't do CRUD functions to the database from the front end unless there's some backend code to execute the query. Right?

But is it safe to have front-end forms that do POST requests and update a database?

teen phone cutie
Jun 18, 2012

last year i rewrote something awful from scratch because i hate myself

Ruggan posted:

Yeah. It isn't serverless. All it's doing is abstracting the concept of a server away behind some common API:


I mean it's a cool concept, but definitely a misnomer. It's mostly aimed at allowing developers to create applications where they don't need to worry about back-end setup (provisioning, availability, etc). You're still giving Amazon or Google or whatever a set of instructions on how to handle different HTTP requests sent their way.

Another good description:


Finally, a better analogy for the HTTP vs SQL (because you'd never put a SQL query [letter] inside an HTTP request [envelope]):

Let's say you are a piece of server code. Your job is to open envelopes addressed to you and read the contents. Based on what is written, you need to take something out of your refrigerator and send it as a response.

The mailman (the server's routing logic, which tells it what code should execute based on the incoming request) drops by and delivers an envelope addressed to you. This envelope is the HTTP request, and it can contain anything.

You open the envelope to discover that someone has sent you a blank letter. Idiot. You do nothing and send back an angry response. This is validation logic written in the server side language leading to a HTTP error response code.

The next day, the mailman drops by again. This letter tells you to get a FUCKYOU out of your refrigerator. You look in the refrigerator and find nothing by that description. This is the SQL query which returns a blank dataset. You send back an empty letter. This is a successful HTTP response with no data.

On the third day, the mailman comes by again. This letter tells you to get a gallon of milk out of the refrigerator. You look in the refrigerator and retrieve a gallon of milk. Another SQL query that successfully returned data. You send a package to the person containing this milk. A successful HTTP response containing data.

Finally the mailman delivers one final letter. This letter tells you to look for 1 OH and also throw away your refrigerator. Because your boss didn't make you parameterize your queries and wrote sloppy server side code, you just threw away a really expensive appliance and all the food went bad. But you were just doing what you were told. This is SQL injection.

HTTP is the envelope. SQL is the instructions on how the server interacts with the relational database.

Hope this helps.

Yeah that's definitely making a lot of sense, but I think I have one more less theoretical question.

If I was going to make a post request to some server code to upvote a forum post, lets call it remote.php, how does that php file know to run the upvotePost() function? Like what's telling the php file "you should be running this function, if these parameters are given?"

teen phone cutie
Jun 18, 2012

last year i rewrote something awful from scratch because i hate myself

Thermopyle posted:

I think you're just using it as an example, but just to be clear...don't use PHP (unless your job requires it).

Yeah just an example. I'm actually working on project with an Express server, and I was just trying to wrap my head around how these provided API endpoints work.

But thanks for the help everyone!

teen phone cutie
Jun 18, 2012

last year i rewrote something awful from scratch because i hate myself
How the hell do i make a select form required, but have a disabled default value at the same time?

Couldn’t figure out the React way to do it

teen phone cutie
Jun 18, 2012

last year i rewrote something awful from scratch because i hate myself
How often do you guys use Git Fetch?

I'm still in the process of learning the differences between Git Pull and Git Fetch and it seems like the only real difference is that you can review merge changes before you merge them with Git Fetch, correct?

teen phone cutie
Jun 18, 2012

last year i rewrote something awful from scratch because i hate myself
Gotcha. After using it a bit, it defintiely seems helpful.

teen phone cutie
Jun 18, 2012

last year i rewrote something awful from scratch because i hate myself

Knifegrab posted:

What do you guys think is the best way to illustrate a required field in today's web? I know asterisks are obviously a pretty standard defacto but feel like they look ugly/out of place these days.

I like when a form will turn red as I'm typing and only go back to grey when the field is filled out correctly.

And then when you hit submit, all the incorrectly filled out fields turn red.

teen phone cutie
Jun 18, 2012

last year i rewrote something awful from scratch because i hate myself

Skandranon posted:

If you can make the submit button give useful information on what is wrong, this is the best. Making fields turn red points out it is wrong, but you should also say why.

Yeah I agree. Red borders while typing and only show error messages on submit.

teen phone cutie
Jun 18, 2012

last year i rewrote something awful from scratch because i hate myself
Have you guys ever dealt with forms with inputs that are required or optional based on settings a user configures?

Because that's what I was dealing with a couple weeks ago and I'm sure that my conditionals need to be cleaned up. How do you guys deal with a lot of conditionals in a form while keeping the code concise and clean?

teen phone cutie
Jun 18, 2012

last year i rewrote something awful from scratch because i hate myself

The Dave posted:

Hmm, I'm not sure you should have inputs that change between requires and optional. I would need to know about the specifics to provide a ux solution though.

Say you have a form for the user's address.

The site owner could choose to make the 'company' or 'address line 2' required or optional.

So then that means your conditional would have to look something like this when the form is submitted

JavaScript code:
if ((companyNameInputText.trim() !== "" && companyNameIsRequired) || !companyNameIsRequired) {
	// pass validation
}
else {
	// don't pass validation
}
It would turn into spaghetti code with enough input fields.

teen phone cutie
Jun 18, 2012

last year i rewrote something awful from scratch because i hate myself
that's an interesting idea. What would the form submit function look like in that case?

Adbot
ADBOT LOVES YOU

teen phone cutie
Jun 18, 2012

last year i rewrote something awful from scratch because i hate myself
Speaking of PHP, I'm trying to learn more about it, other than using it for CRUD applications, so I can be a better employee at work (LOL).

Are there any good tutorials that get into creating REST APIs with PHP that you would recommend? (preferably ones that hold your hand a lot)

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply