Search code examples
jquery-pluginsgithubgoogle-apps-scriptjquery-masonrygoogle-sites

google app script not loading JQuery Masonry from Github


I am trying to see if I can include JQuery plugin Masonry on a gadget on Google Sites... created from Google App script by using HtmlService to render HTML from a HTML file with:

<script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
<script src="https://github.com/desandro/masonry/blob/master/jquery.masonry.min.js"></script>

However... this only renderes this result:

Invalid script or HTML content: https://github.com/desandro/masonry/blob/master/jquery.masonry.min.js:4+1 - 2: Unexpected token <.

I am new to Google App Scripts and testing it out. But it seems to me that it complains on an invalid token in the masonry file? Or am I interpreting this wrong? Can anybody tell me if this should be possible. I read some places it says that Google App Script is restrictive, but I do not know what to look for to see if that is the reason or not in this case.

Many thanks.


Solution

  • The URL you are currently using is pointing to the GitHub information page about the file. Changing it to the direct link to the file should solve your error:

    https://raw.github.com/desandro/masonry/master/jquery.masonry.min.js