Jquery-ui library will not loaded/served by Google

2020-04-20 08:48发布

For the past 3 months I have been struggling with the Google sites "insert html box" to get the CDN to serve the Jquery user interface library-jqueryui- without any success.

I have used the following code and its variants without any themes but to no avail;

The jquery library loads fine but not the jqueryui library. The Google developer site suggests that this should work, but I only get these error messages - failed to load external url jquery-ui.css OR folding element body into parent

What am I doing wrong?? Getting frustrated here!

2条回答
神经病院院长
2楼-- · 2020-04-20 09:03

Following the hint about jQuery not always working in HTML boxes, I experimented and found that some versions of jQuery UI will load!

As of today, I was able to load the following versions:

1.8.21, 1.8.20, 1.8.18

or, using the direct links to Googleapis:

<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/jquery-ui.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.20/jquery-ui.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js"></script>

All other versions mentioned on https://developers.google.com/speed/libraries/ would not load.

That being said, I encountered more trouble when trying to link to the CSS themes. I couldn't find any way to get an HTML box to accept links to googleapis hosted jQuery UI CSS files.

I tried pasting the CSS directly into the HTML box, but the url() links to images are not kosher. Commenting them out resulted in my getting the HTML box editor to be at peace, but the attempt to make tabbed panes work was not successful.

To say that one can do jQuery inside a Google Site is almost an exaggeration.

查看更多
甜甜的少女心
3楼-- · 2020-04-20 09:19

Apparently this is a known bug. Take a look at the answer here

There is a bug link to the actual issue and a possible workaround.

查看更多
登录 后发表回答