Forum Moderators: open
So...we are toying with the idea of no longer using external files and putting the JavaScript inline in the HTML. We see some highly ranked sites with beaucoup JavaScript in their HTML...
We're weighing this against --
1) Increased weight of our pages. We are already dangerously near the 101K limit.
2) The fact that the spiders would "presumably" lower the relevancy of our keywords if there is JavaScript in the <HEAD>. (Is this really an issue?) We could put the JavaScript at the bottom, but want to adhere to the emerging W3C standards.
3) Slower page load time on secondary loads, because the JavaScript wouldn't be in cache.
Your opinion...should we leave our external .js files as is?
Thanks so much, in advance, for your feedback.
If a customer is having issues with the site being JS and they didn't turn it off I'll place my bets on it being a browser issue. Get their UA and test it yourself. The only instance I can think off the top of my head is if it's a computer newb who is on some anti-js person's computer who has js disabled.
Back to the main thrust..
So...we are toying with the idea of no longer using external files and putting the JavaScript inline in the HTML
What's that to do with the price of eggs?
Whether the script is internal¦external will have no effect the issue of people with Javascript disabled. It's generally accepted that sites¦pages should be fully accessible without JS, which should be used to enhance content, and its delivery.
Keep your scripts external (bandwidth, script integrity, SEO)
It looks like your site will need a "new paradigm". Overall, you have a choice between restructuring pages, or offering alternative content. The second isn't always convenient to deal with.
We see some highly ranked sites with beaucoup JavaScript in their HTML...
I'd hazard a guess that even some of the "best" are being knocked together with authoring packages, and the "authors" in question aren't bothering to use (or haven't quite got their heads round) external scripts.