├── .gitignore ├── README.md ├── index.js ├── package.json ├── static ├── favicon.ico └── script.js └── views └── index.garnet /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Does Google Execute JavaScript? 2 | 3 | Google executes JavaScript, even if the script is fetched from the network. However, Google does not make AJAX requests. 4 | 5 | ## License 6 | 7 | Copyright (c) 2016 Stephan Boyer 8 | 9 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 14 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////// 2 | // Configuration // 3 | ////////////////////////////////////////////////////////////////////////// 4 | 5 | // express 6 | var express = require('express'); 7 | var app = express(); 8 | 9 | // request logging 10 | var morgan = require('morgan'); 11 | app.use(morgan('short')); 12 | 13 | // compress responses 14 | var compression = require('compression'); 15 | app.use(compression()); 16 | 17 | // turn off unnecessary header 18 | app.disable('x-powered-by'); 19 | 20 | // turn on strict routing 21 | app.enable('strict routing'); 22 | 23 | // use the X-Forwarded-* headers 24 | app.enable('trust proxy'); 25 | 26 | // template engine 27 | app.set('view engine', 'garnet'); 28 | 29 | // other static files 30 | app.use(express.static('static')); 31 | 32 | ////////////////////////////////////////////////////////////////////////// 33 | // Endpoints // 34 | ////////////////////////////////////////////////////////////////////////// 35 | 36 | // landing page 37 | app.get('/', function(req, res) { 38 | res.render('index.garnet'); 39 | }); 40 | 41 | // ajax test 42 | app.get('/ajax', function(req, res) { 43 | res.json({ 44 | message: '
61 | This is an experiment to determine to what extent Google indexes dynamic content. The message above varies to indicate one of four possibilities: 62 |
63 |Google will index one of these messages—but which one? Click here to see the results of this experiment.
70 |71 | 76 | Follow @stepchowfun 77 | 78 |
79 | 80 | 81 | --------------------------------------------------------------------------------