69

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. ...


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 ...


26

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 ...


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

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 ...


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

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 ...


9

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 ...


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

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

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

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 ...


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: <...


8

Can I just send pre-rendered HTML, using phantomjs or other headless browser, to the google bot? In short... no you shouldn't. Google's stance on differing versions for visitors and search bots is clear and regardless of your intentions it is classed as a cloak. Google also goes to great lengths to activity look for sites that specifically treat the ...


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 ...


7

Google changes this around every now and then, and whenever they do I have to 're-find' where each of the settings are. So you're not alone! You're right that a browser key is essentially 'public' and should be limited by domain to protect it from being stolen. It's worth noting the worst that can happen if its stolen is that someone could use up your free ...


6

Use custom dimensions in Google Analytics. First, navigate to the "admin" section of Google Analytics' web portal, click "Custom Definitions", then "Custom Dimensions" under the property you're selecting. Click "new custom dimension", give the dimension a name, and save it as type "hit". Now add code similar to the following: ga('create', 'UA-XXXXX-Y', '...


6

This is deliberate. To quote from this post on the Official Google Webmaster Central blog: "Starting in April, for browsers with the appropriate support, we will be using the "referrer" meta tag to automatically simplify the referring URL that is sent by the browser when visiting a page linked from an organic search result. This results in a ...


6

The file extension is irrelevant, it's the Content-Type header that matters, and that file is served with a text/plain content type (which is the purpose of Github's "raw" view). You should really download a copy of the file locally to your site and include it from there. Even if it did work from Github, since you're not loading the JS file asynchronously, ...


6

When I try to get a particular image on a remote domain via JavaScript I get a 403 error. Likely answer: The site in question has protection against "leeching" / hotlinking. i.e. It checks to see what host is requesting the file before serving it. If the request comes from an unrecognised website, they throw a 403 Forbidden error. If you take a look at ...


6

No. Google may sometimes execute Javascript to determine content, but it's a very bad idea to rely on Javascript for your site to be crawled as you want it to be.


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