Skip to main content
87 votes
Accepted

Should you always program server side for a website?

If you don't know whether you need server-side code, you probably don’t* *Caveat: Server-side code is essential for security, when you want to internally control access to content, data, or ...
Tim Grant's user avatar
  • 1,360
56 votes

Should you always program server side for a website?

Read about static site generators. These allow you to create a site in a programmatic manner (using templates, data, etc), and not by hand-crafting HTML. The result is a set of static HTML and CSS ...
9000's user avatar
  • 24.3k
37 votes
Accepted

How can I prevent a user from editing my code in their browser?

You literally cannot prevent users from accessing and modifying content that you are sending them. You have no control over the browser, or which browser they use, or whether they are in fact ...
amon's user avatar
  • 135k
23 votes

How can I prevent a user from editing my code in their browser?

You can't. One of the fundamental rules of computing: you can't trust the client. Whatever clever scheme you think of, I can get round it if I am in control of the client.
Philip Kendall's user avatar
19 votes
Accepted

Why is the ampersand (&) a HTML Entity?

To avoid ambiguity. Suppose you want to write a website about HTML. You write the line: "To write a literal < you have to write &lt;." Now, to write that down in HTML: <p>To write a ...
Jasmijn's user avatar
  • 1,859
14 votes

Why does HTML collapse whitespace?

In HTML, line breaks are inserted at rendering time in order to make the line length fit the width of the screen. This is in contrast to both plain text formats and layout formats like PDF where line ...
JacquesB's user avatar
  • 59.8k
13 votes
Accepted

Why is it bad to use inline styling in HTML for generic styles?

Looking at your updated question, Why is this <div> <textarea class="width90"></textarea> </div> .width90{ width:90%; } any better than this? <div> <...
Dan Pichelman's user avatar
13 votes
Accepted

Are there any reasons not to ever use classes or ids anymore?

This seems like a very bad idea to me. defining css rules for classes and adding those classes to the html is a great way to make your css reusable. The way you're suggesting, with a complex selectors,...
alexanderbird's user avatar
10 votes

Pros and Cons of Facebook's React vs. Web Components (Polymer)

I think the biggest drawback of React in my opinion is that it isn't based on web standards. React is a very powerful tool right now, but because it circumvents so much of what the browser provides ...
Dogs's user avatar
  • 1,176
10 votes

Is it possible to prevent tech scammers from editing bank webpages?

There are some golden rules in Information Security that say that: If an attacker has physical access to your device, it's no longer your device. If an attacker has administrative access to your ...
Jörg W Mittag's user avatar
9 votes

Will it be a wrong idea to have <style> in <body>?

(Since we are here at SE.SX, a more strategic approach may be a valuable augmentation to the usual technical considerations.) [preamble] The HTML5 spec is a continuously moving target, and they have ...
Sz.'s user avatar
  • 191
9 votes
Accepted

Are tables inside tables a good idea in the right circumstance

Semantic HTML is about accurately describing the semantic structure of your document. If your document contains tabular data, then use a table. If your document contains tabular data which is itself ...
Jörg W Mittag's user avatar
9 votes

Why is the ampersand (&) a HTML Entity?

It looks like this goes all the way back to SCRIPT which was invented in 1968. roughly speaking, SCRIPT became SCRIPT/VS which became GML which became SGMLguid which became HTML Here is the origonal ...
Ewan's user avatar
  • 77k
9 votes

How do you 'merge' several JS files into one?

I will answer this from the standpoint of code organization and architecture, rather than which tools to use. Typically multi-page sites have common library and framework code. This code is used on ...
Greg Burghardt's user avatar
8 votes

Why is it bad to use inline styling in HTML for generic styles?

In layman's terms: Because when you have a lot of pages with a lot of inline styling, and some user askes for cosmetics change, the you will have to make a lot of changes in a lot of places, and ...
Tulains Córdova's user avatar
8 votes

How to do BDD for CRUD?

I built a mini CRUD application and I would like for someone to complete it by adding the tests If you are doing BDD you should have defined the required behaviour first. then written the tests, ...
Ewan's user avatar
  • 77k
8 votes
Accepted

Is it bad practice to leave hidden elements in the dom?

You seem to be primarily concerned with the performance difference between hiding a DOM component and removing it. The usual advice about performance applies: don't worry about performance unless you ...
Andrew's user avatar
  • 721
7 votes
Accepted

Is there a rule of thumb when it comes to the "name" attribute?

Name is a CDATA type so the following applies: ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens ("-"), ...
Rob's user avatar
  • 286
7 votes

How to do BDD for CRUD?

Requirements Typically you will define the behavior before you write the code. These start out as somewhat vague high-level requirements: unregistered users should be able to register registered ...
Bryan Oakley's user avatar
  • 25.3k
6 votes

Should you always program server side for a website?

You can and should use only a static site if it is enough, or use a static site generator. Why? Maintainability. Code has bugs. Every few weeks there is another WordPress security hole found. If you ...
Josef's user avatar
  • 297
6 votes

How to do BDD for CRUD?

I believe you have two separate questions here. One is: how can BDD be applied to a CRUD app, and the second is: how can I use BDD to build a simple registration app. BDD does not lend itself to ...
Jon Acker's user avatar
6 votes
Accepted

How to white label my website in php

Its been a few years now, but the last PHP system I developed did something like that. We offered custom domain names, rather than directories, but the principal is the same. It was a template ...
GrandmasterB's user avatar
  • 39.4k
6 votes
Accepted

Is it good practice to wrap a single element in a container?

Correct, these particular divs are not strictly necessary. I created a JSFiddle example that deletes these divs from the example, and the layout still works (after setting the correct box model): ...
amon's user avatar
  • 135k
6 votes
Accepted

Could there be a <flex> tag?

This question is wildly in need of focus, but most of the questions have an easy answer. Who is in charge of this? The W3C. Is there a place to submit proposals? Yes. See the link above. The first ...
Greg Burghardt's user avatar
5 votes

Is there any situation where there is a good reason to use an anchor <a> element without a href attribute?

In the old days, you used <a name="whatever"> if you wanted another link to jump to a particular point on the screen. Nowadays (for a long time actually) we use the "id" attribute.
Rory Hunter's user avatar
  • 1,747
5 votes

Why is the ampersand (&) a HTML Entity?

In any data format, the escaping mechanism must be escaped itself. The escape character is a special character. For example, I want to display this text: Ampersands are escaped like &amp; If ...
amon's user avatar
  • 135k
5 votes

How can I turn my CRUD database application into a REST application?

CRUD is a term that refers to the four most used activities in Data Oriented Applications: Create (Add, New), Read (Get, GetList), Update (Modify), Delete (Remove). In terms of Database the CRUD maps ...
ArBR's user avatar
  • 171
5 votes
Accepted

Supervisor wants unconventional web site, how to resolve this

I recommend you create mockups of what the game would look like based on the requirements you've been given. Assuming that the mockups accurately illustrate what you've described in words, you can ...
Bryan Oakley's user avatar
  • 25.3k
5 votes

Is it possible to prevent tech scammers from editing bank webpages?

The only way you could detect the DOM change is client side. Since it’s client side, attackers could simply delete that check. So yes, it could add a tiny hurdle to the least capable of attackers; ...
Telastyn's user avatar
  • 109k

Only top scored, non community-wiki answers of a minimum length are eligible