All Questions
Tagged with html programming-practices
8 questions
0
votes
2
answers
207
views
Should we check if the primary key exists if rendering a collection fetched from database?
I have got an argument with my colleagues about this. IMO It's common practice that you don't need to check if an id exists or not before rendering it.
So here's an example.
This is what my ...
38
votes
6
answers
11k
views
Should you always program server side for a website?
I'm about to start creating a music project website for a friend. It should be pretty simple for now: no dynamic content (tour dates, etc.), and nothing more than a few embedded sample songs or ...
18
votes
2
answers
8k
views
Is there a standardized practice for ordering attributes in HTML tags?
I am working on an AngularJS project and the attributes are numerous in many of my HTML elements:
<button type="submit"
ng-click="Page.UI.DetailView.ExecuteFunction()"
ng-...
3
votes
4
answers
6k
views
Should I Include PHP code in HTML or HTML in PHP?
What is the best practice, to write my PHP code inside my HTML code or HTML inside PHP?
PHP inside HMTL:
<p class="lead">Welcome to the <?= COMPANY_NAME ?> website.</p>
HTML ...
0
votes
2
answers
2k
views
Alternatives to the use of the Id/Name properties with non-inputs elements in HTML
I'm migrating a website that use Javacsript/HTML/PHP using reusable javascript code, in certain moment I saw the opportunity to simplify code in functions that use almost the same code.
Let's say: I ...
35
votes
6
answers
7k
views
Progressive Enhancement vs. Single Page Apps
I just got back from a conference in Boston called An Event Apart.
A really popular theme amongst the speakers was the idea of progressive enhancement - a site's content should go in the HTML, and ...
0
votes
2
answers
334
views
ASP.NET tags best practices
I'm working on my first ASP.NET project and I'm torn between using asp tags (<asp:SomeElement) everywhere or use some regular HTML for simple things that need no code behind, like fixed divs, ...
139
votes
5
answers
166k
views
Two HTML elements with same id attribute: How bad is it really?
Just browsing the google maps source code. In their header, they have 2 divs with id="search" one contains the other, and also has jstrack="1" attribute. There is a form separating them like so:
<...