I use HTML5 boilerplate and jQuery is declared twice in the HTML page like this:
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/libs/jquery-1.6.2.min.js"><\/script>')</script>
What's the reason behind including the JavaScript files this way?
It seems to be the only reason is to load jQuery library from local server if it's not reachable from Google CDN.
The use of a script will give uniformity to the calls that take place in your call center. Especially in reference to customer service scripts, one of the main benefits is to promote consistency across the call center. When a customer calls in with an issue, you can be sure that each agent will handle it the same way.
A call script, a written script entailing correct wording and logic aids, assists an agent in handling a contact. It also assists in the maintenance of focusing on the content of the contact.
Example of Cold Calling ScriptHello [prospect name]. This is [name] from [company]. (pause) Do you have two minutes to chat? (prospect says yes) Great, thank you. We're a [describe company] platform that helps companies like yours [problem you solve].
Be specific. Just like a pitch that comes too early can scare off a potential lead, being too vague in your message can also risk a lead. Be clear and concise in speaking with your prospect and be specific about how your product or service can be of value to them.
They reason html5 Boilerplate includes the script that way is because it attempts to "load jQuery library from local server if it's not reachable from Google CDN." =)
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
This will attempt to load the protocol-less version of the jQuery library
<script>window.jQuery || document.write('<script src="js/libs/jquery-1.6.2.min.js"><\/script>')</script>
This will load the local version of the jQuery library if the google-hosted version was not loaded properly (unreachable, site is down, etc), hence the window.jQuery
check. If window.jQuery
is not true
then it will execute the document.write
Loading jQuery from the Google CDN can be much faster than loading it from your local server and it can be cached so the user might already have a cached copy of it from another website.
The check is make sure that it got loaded, otherwise if it failed, load it from the local server.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With