2

I'm using this x-editable library, and it works really well. But I still have one problem.

In this x-editable page,in the use CDN section, you can see something like this

<link href="//cdnjs.cloudflare.com/ajax/libs/x-editable/1.5.0/bootstrap3-editable/css/bootstrap-editable.css" rel="stylesheet"/> 
<script src="//cdnjs.cloudflare.com/ajax/libs/x-editable/1.5.0/bootstrap3-editable/js/bootstrap-editable.min.js"></script>

I'm tested examples and it works. And it seems that the above 2 lines instruct browser to fetch css and js files from http://cdnjs.cloudflare.com. My question is: Is there any difference between http:// and // here.

PeopleMoutainPeopleSea
  • 1,492
  • 1
  • 15
  • 24
  • Well, I think that the // depends on the current http method (it means that if you have https, it will connect using https) and http://, I think you know, it's like relative and absolute path – Arthur Guiot May 06 '17 at 07:33

1 Answers1

5

It'll pick the http:// or https:// based on the protocol that is being used.

If the current page is https it will access the href using https.

If http then the link is accessed over plain http.

Saurabh Sharma
  • 2,422
  • 4
  • 20
  • 41