86

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 functionality. (It does not necessarily need to be your server, see last paragraph.) Ask yourself what problem using server-side technologies would solve. If you can’t ...


56

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 that does not require any backend. https://www.staticgen.com/ lists and ranks a number of such open-source generators; closed-source offerings likely exist, too.


33

Unfortunately there is little you can do. I think you have the answers on your last paragraph. As far as making claims on your web site about other sources - put an app signature on your site, explain than some "less than desirable" sites are listing your apps and it should only be downloaded from <here> or <here>. Do not name or provide any ...


25

The short answer is that the page's client-side Javascript code detects when you get "too close" to the bottom of the page, and asks the server for more data when that happens. Without getting too technical, they are not reloading the entire web page. Instead the Javascript code on that page is requesting more data from the server, then when it receives the ...


20

One big key to understanding what is happening: It is possible, via Javascript, to set the URL in the addressbar without actually redirecting the user. To see this in action, paste the below code into a supported browser's console. Notice that it changes your address bar to http://programmers.stackexchange.com/yay.html. history.pushState(null,null,'/yay....


17

This is is called a subdomain. Subdomains can be routed via the cname entry to a different server so that when the user types in foo.bar.com, the nameserver for bar.com is examined, which reveals the IP address for the foo subdomain.


16

Use JPEG for images with gradients (like photographs) and PNGs for images with flat colors and straight lines (like screenshots). Use GIF only if you need animations for some reason. Don't use BMP. JPEG is lossy, so you get artifacts if you try to use it on screenshots. PNG is lossless, so it looks great with screenshots, but the filesizes get really big ...


14

I was reading about gzip program and I found the official website of the gzip software. No, you didn't. You found the website that used to be the official website back when the original authors were still the maintainers. Now, GNU Gzip is maintained by different people, and the website is https://www.gnu.org/software/gzip/ . First of all the site looks ...


13

Nested Tables Aren't Necessarily Bad There are things you can do with nested tables that you can't with CSS and <div>s, especially with regard to re-sizable width layouts. Tables may be old fashioned, but they are more versatile and work equally well on every browser. I personally prefer CSS where it works equally well on every browser and use tables ...


13

No particular reason at all. It's as arbitrary as "your password may not be longer than 8 characters". It's programmers or product owners that don't know what they are doing. There can be some legacy reason for this, when the authentication system is linked to some credential system that has had certain limitations for historical reasons (something like a ...


12

I'm sorry, but your answer is incorrect. The main reason to use a sub domain would be to maximize parallel downloads, and you could take it a step further if said sub domain was cookie free. From Yahoo's Best Practices for Speeding Up Your Web Site: Split Components Across Domains Splitting components allows you to maximize parallel downloads. Make ...


12

The proxy option is the easiest one to implement. You don't have any custom development to do, the only thing to do is to set up a proxy. It's also straightforward: there is no additional code to maintain, and if the API changes, you have no changes to make on your side. A proxy would be a preferred choice: If you need to ship working software fast. This ...


11

Beware of the Iceberg Syndrome! With an iceberg, the vast majority of it is located under the water, with just a small percentage being visible. Likewise with a website, the vast majority of it is hidden out of view from the user. Changing the site from nested tables to CSS/DIV's will take a considerable amount of time and effort, none of which will be ...


11

Of course not. The factory pattern is useful if you need to encapsulate create-time polymorphism from consumers, that is, you want to provide a transparent point from which new instances of a polymorphic type are created. If the type in question is not polymorphic, the factory pattern is pointless. If a single point of creation doesn't make sense, neither ...


9

Call them and ask them why they aren't using your website. There might be any number of reasons: maybe they have been too busy, are going bankrupt or they really don't know what to do with it. There might have been a disconnect between what they expected you to do and what you thought they wanted done. Discuss it and new work from them might follow or else ...


9

This is basic security. Since HTTP is stateless, even if a user is logged in, the browser still needs to effectively re-authenticate for every single page load (otherwise the server has no way of knowing that this particular user is logged in). The usual ways to do this are via a special cookie, or by including some token in each rendered page (e.g. as a ...


7

There is a third option which you may not have seen: Cross Origin Resource Sharing (CORS). The CORS standard works by adding new HTTP headers which allow servers to serve resources to permitted origin domains. Browsers support these headers and respect the restrictions they establish. Example: Say your site is http://my-cool-site.com and, you have a ...


7

Keeping the ID in the URL is the most future proof method and as you demonstrated, the URLs can still look relatively good. Another option used by multiple projects is to keep an history of previously used slugs. When the title changes, you update the slug and if someone tries looking for an obsolete slug, search in the list of old slugs. That way old slugs ...


6

My advice is when you build a site. Make relevant screengrabs and add it to your portfolio and then move one and forget about the site. You can't go around checking up on every site you've built. It will only frustrate you. They are misusing classes so the layout isn't as it is supposed to be , the texts are old/stale/none informative. They are using text ...


6

Here is a jQuery method: function (deep) { if (window.$ === jQuery) { window.$ = _$; } if (deep && window.jQuery === jQuery) { window.jQuery = _jQuery; } return jQuery; } As you can see, it is plain javascript. jQuery is javascript. It is a set of methods to help you produce code faster. jQuery is not ...


6

Forget about FTP. Setup a bare repository on the server Add it as remote to your development environment. Clone the bare repo to the webspace, adapt the configuration files. Add a post-commit hook on the bare repo, starting a shell script on the webspace that pulls from the bare repo. With that, you just push your changes to remote, and it is automagically ...


6

Let us ignore the fact that the fact a simulated mouse click causes its default action is only in order to maintain backwards compatibility - so the code you mentioned in your example is indeed evil. There are plenty of legitimate cases where you'd want to simulate mouse events: Testing - This is the most important one by far in my opinion. You often want ...


6

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 use a common CMS, you will have to patch it constantly. Else your friends website will soon contain advertisement for illegal drugs, ISIS propaganda, malware ...


6

DNS can respond with some additional data like mail exchange server, but that's not related. Usually we can't access websites by IP address using web browser, because there are more than one websites or web services on single IP. The browser sends a special HOST header (which usually is the domain name that user typed), in request and - this header contains ...


6

Just a quick note on terminology: Scaling up refers to improving the hardware. Scaling out refers to adding more hardware in a load balanced environment. In the web world, we tend to scale out the web servers to handle more load. If your application is stateless (i.e. no session variables), you should be able to clone the web server and have the load ...


6

It's probably better to use cache-controlling HTTP headers rather than generating lots of unique URLs.


5

Firstly right to the jargon ,is there any actual difference between the two or do they mean the same? Fluid in its historical context meant it was NOT fixed i.e it expanded if a wider screen was available. Precursor to responsive. Fluid does not mean it adapts to smalleer/tablet/smartphone screens. Responsive means, it adapts to device/screensize. Is it ...


5

it's the open search standard, OpenSearch 1.1 a collection of technologies that allow publishing of search results in a format suitable for syndication and aggregation. It is a way for websites and search engines to publish search results in a standard and accessible format... OpenSearch consists of: OpenSearch Description files: XML files ...


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