A message from our CEO about the future of Stack Overflow and Stack Exchange. Read now.
65

Chrome Opening the “Console” panel of Chrome’s DevTools: Windows and Linux: Ctrl + Shift + J Mac OS: Cmd + Opt + J Note: In addition to the “Console” panel, there also exists a smaller slide-up console which can be toggled via Esc while any of the other panels is active. Full documentation Firefox Opening the “Console” panel in Firefox’s Developer ...


40

How to disallow selection of text on website? You don't. It's effectively impossible, assuming some minimal effort on the part of the person who wants the text. All you can really do is create speed bumps that will do nothing but irritate them. Also note that there are perfectly valid uses for the right-click menu (for example) that have nothing to do with ...


29

On my currency conversion site, the majority of sessions are single page views. This is because users can do their currency calculation directly on the landing page (all the calculation is handled client side with JavaScript.) My page downloads and renders in about half the time when all resources (css, js, and even images) are inline in the page. ...


28

You can exclude the hostname sending data to your profile by setting up an exclude filter. Alternatively, it might be better if you set up just an include filter for your own hostname to ensure you don't see anything like that in the future. Google Analytics Filters - you might want to set up a rule/filter to "Include only traffic from the domains equal ...


27

CloudFlare describes Rocket Loader like this... Rocket Loader is a general-purpose asynchronous JavaScript loader coupled with a lightweight virtual browser which can safely run any JavaScript code after window.onload. Rocket Loader does a bunch of things: It ensures that all the scripts on your page will not block the content of your ...


25

Dec. 2018 edit RawGit is now sunsetting due to malicious usage, so they recommend to use one of the following services instead: jsDelivr GitHub Pages CodeSandbox unpkg Original post Rawgithub.com allows users to take the "Raw" versions of a Git and turn it into a URL usable in <script> tags. It's quite easy to use, simply remove the first . from ...


16

The problem you have is out of your control since this is how the hosting is setup at Github on the path that you have mentioned, Extension type is not only the factor when it comes to executing files since the web hosting can over-rule how a browser renders a file. You could have a .zip file rendering as a .html file if the host was setup to do so, you can ...


14

None of them. It will not be indexed (only in obscure odd cases). Minifying JS is about loading speed and obfuscating JS is for making it harder for other developers to read your code. Google does however rank your website based on load speed, and if you are including 15 JavaScript files and 20 stylesheets, your site gets slow and therefore loses rank. ...


13

F12. (Oh, that's too short for an answer). The F12 key brings up built-in developer tools. It may not do everything that Firebug does, but it can do most things.


13

Inline JavaScript increases download times for the page, which is not good. With a call to a .js file, at least these can be parallel calls and content download times decreased. Yes there are times where it is okay to put JavaScript directly in the HTML code, but you are often better off off-loading this as much as possible. Keep in mind that page download ...


12

It's not necessarily bad to have JavaScript within your HTML file but you must make a judgement call on it. It is bad if you have a large amount of JavaScript being used across multiple pages. In that case, the JavaScript should be in an external, compressed, and cachable file and if your site has very heavy traffic you should make use of a CDN. However, ...


11

Google now officially processes JavaScript. In order to solve this problem, we decided to try to understand pages by executing JavaScript. It’s hard to do that at the scale of the current web, but we decided that it’s worth it. We have been gradually improving how we do this for some time. In the past few months, our indexing system has been rendering a ...


11

The example site uses <a> tags without an href attribute. However, when you click any of them, the page URL actually changes to #/Implementation for example. Therefore, that should be in the link, i.e. <a href="#/Implementation">link</a> Now if Javascript is disabled or doesn't load for whatever reason, the links still work and should ...


11

I've never seen image lazy loading have any negative impact on web search rankings. Improving the perceived performance of your site for users can really help your rankings. When fewer people bounce back to the search results because of performance problems with your site, your rankings will improve. Google will not be able to index lazy loaded images for ...


11

From the info I found through this question on SO I guess that between 0.2 and 2% of users have JavaScript disabled, depending on the country. I'd say take 1% as a rule of thumb. Whether you should care about this 1% depends on what website your building. If you're doing e-commerce and you have analyzed your audience a bit you can probably estimate if that ...


10

That's a good approach. Another approach you could take is to use the <noscript /> element to store the normal version of the img tag, which would be indexed by Google, and use JS to create the lazy loading version. Alternatively, you could use Google's hashbang AJAX conventions combined with HTML5's history API to make bookmark- and index-able page ...


9

It's impossible to prevent your Javascript from being "stolen" because the code is served to the browser. To answer your specific points: 1. I have disabled the right click button of mouse This will have absolutely no effect. No one will ever try to steal code using right click (heck, right click doesn't give access to anything in a browser anyway). So ...


9

I always create a lib directory for third party components, you really don't want to be changing third party libraries unless it is strictly necessary. Go with the 3rd option.


8

A way to do it without cookies is by using an extension: http://www.igorware.com/extensions/block-yourself-from-analytics I like this because I have the extension installed in Chrome so it is available across my devices it is easy to setup I don't need to create a hidden page that sets the cookie or change a real page temporarily. If I erase my cookies I ...


8

This is Google's official plugin for all the most common browsers, which will exclude you from Google Analytics: https://tools.google.com/dlpage/gaoptout Have all your team members install it. PS: The issue with the IP-based filtering method is dynamic IP address allocation.


8

That is valid page content and the search engines will see and index it. It is even possible for it to show up as your page's description in the search results page. But there are other places that Google prefers to get a page's description from include the meta description tag, ODP description, and relative content from the page. So if that content is what ...


8

Your best options are Firebug lite, the newer firebugger, or IE Web Developer


8

If your framework/CMS/whatever has the appropriate functions, you can include the scripting conditionally as @Michael suggests, but without the additional library. Taking your datatables case, for example, WordPress might handle the situation via something like: // For reference; this isn't functional code. if (is_page('whatever')) { <script src="/...


8

I have disabled the right click button of mouse Don't do this. There are valid uses for right-click that you are blocking in addition to (not) protecting your code. All you'll do is annoy everybody while doing absolutely nothing to stop the people who know enough to try and steal your code in the first place.


8

This will not hurt you. Having your site do different things depending on environmental factors (such as the type of device) is common and ok to do. You only have an issue when you intentionally serve different content to search engines than to users and that clearly is not the case here.


8

robots.txt can block JavaScript files from Googlebot. http://www.robotstxt.org/ has more information about how to construct a robots.txt file. You could put your JavaScript that shows the password into an external JavaScript file (called showlists.js): $(document).ready(function(){ showLists(); }); Call that JavaScript file in the page head: <...


7

In general, no it does not affect your SEO. However there are some issues you should be aware of: The external site could be quite slow, which could have a tiny impact on SEO as Google's algorithm includes site speed. However if you are wondering about things like Google hosting jQuery then they will almost certainly be faster than your own site, actually ...


7

I've encountered this as well. It's annoying that Google is reporting 404 errors on something you never actually link to, but only based on their heuristic that finds links in JavaScript code. These reported errors don't seem to indicate actual problems than need to be addressed. Google's John Mueller posted this on Google+: 404 errors on invalid ...


7

Yes. By the HTTP protocol, clause 7.2.1: “Any HTTP/1.1 message containing an entity-body SHOULD include a Content-Type header field defining the media type of that body. If and only if the media type is not given by a Content-Type field, the recipient MAY attempt to guess the media type via inspection of its content and/or the name extension(s) of the URI ...


7

From Modernizr installation page: Drop the script tags in the HEAD of your HTML. For best performance, you should have them follow after your stylesheet references. The reason we recommend placing Modernizr in the head is two-fold: the HTML5 Shiv (that enables HTML5 elements in IE) must execute before the BODY, and if you’re using any of the CSS classes ...


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