SPC058721: Consider to reference external files without the scheme in web pages |
The url to external files (.js, .css or images) should be used without the scheme (http, https). This prevents conflicts if the page is called either with http or https.
CheckId | SPC058721 |
---|---|
TypeName | ReferenceExternalFilesWithoutProtocol |
Severity | Warning |
Type | HTMLParsableFile |
Remove the scheme (or protocol) from external references in script, link and img tags. See sample below.
Bad coding sample:
...
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.js"></script>
...
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.js"></script>
...
Better coding sample:
...
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.js"></script>
...
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.js"></script>
...
Disclaimer: The views and opinions expressed in this documentation and in SPCAF do not necessarily reflect the opinions and recommendations of Microsoft or any member of Microsoft. SPCAF and RENCORE are registered trademarks of RENCORE AB. All other trademarks, service marks, collective marks, copyrights, registered names, and marks used or cited by this documentation are the property of their respective owners.