Skip to main content

All Questions

Filter by
Sorted by
Tagged with
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 ...
Mak Suriya Jacobsen's user avatar
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 ...
Deegriz's user avatar
  • 471
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-...
Matt Cashatt's user avatar
  • 3,325
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 ...
J_Strauton's user avatar
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 ...
Rafael's user avatar
  • 687
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 ...
SeanPlusPlus's user avatar
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, ...
MPelletier's user avatar
  • 2,068
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: <...
danludwig's user avatar
  • 1,758