Pavel Vanchugov Pavel Vanchugov - 16 days ago 5
CSS Question

Strange behavior of jquery-ui.css googleapis vs localhost

If i include jquery-ui.css from google server - it wors fine.

<link rel="stylesheet" href="ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/themes/smoothness/jquery-ui.css" >


http://codepen.io/one2gov/pen/jVVrzv

enter image description here

but if i download it to localstorage it behaviors differently
position of divs became relative.

<link rel="stylesheet" href="css/jquery-ui.css" >


enter image description here

And the same thing if i include it from other online service on localhost,

<link rel="stylesheet" href="http://codepen.io/one2gov/pen/oYYzbw.css" >,


but in online there will be no problems.

http://codepen.io/one2gov/pen/ZBBppG

I assume this happens because of different loading speed, but would appreciate if someone explain this behaviour.

Answer

Probably you use something like file:// or C:/, that does not support cross origin requests.

You can install a webserver on your local PC or upload it somewhere else to support the cross origin requests

Comments