javascript - Jquery file inclusion issue -
developing asp.net application visual studio 2010
i new jquery.
i trying include jquery file online (from google)
for have written as:
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>
here highlighting src attribute green text showing tool tip that:
//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js not found.
if write as:
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>
it shows me error tooptip that:
element 'script' missing required attribute 'type'
but actual way in refered line on different sites.
i have refered addess different sites.
is address wrong? or
i have written in wrong way?
please me.
protocol-less paths inherit protocol of current document when opened in browser, work when page opened through http
/https
protocols.
therefore assume vs interprets protocol-less path local one, not found.
you can check cdn url correct opening link directly through either http/https protocols:
http://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js
https://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js
as type
attribute, see why write <script type=“text/javascript”>
when mime type set server?
in sum, browsers since netscape 2 default script tags javascript
, long server sends correct mime work fine. however, wouldn't validate under w3c's html4 mode. in html5, valid omit type
attribute commented @elclanrs.
Comments
Post a Comment