I tried to show an example in this post, which was loading my custom scripts from GitHub, but the script failed with "Uncaught TypeError: $(...).selectmenu is not a function"
.
But if I copy the script from the file and put it in <script></script>
then it worked.
Why does it fail?
$('#mySelect').selectmenu();
$('option:contains("B")').hide();
<link href="https://raw.githubusercontent.com/Eddcapone/custom_jquery-ui-1.12.1/master/jquery-ui.css" rel="stylesheet"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://raw.githubusercontent.com/Eddcapone/custom_jquery-ui-1.12.1/master/jquery-ui.js"></script>
<select id="mySelect">
<option id="aaa">A</option>
<option id="bbb">B</option>
<option id="ccc">C</option>
</select>
Example with code from official jQuery
$('#mySelect').selectmenu();
$('option:contains("B")').hide();
<link href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css" rel="stylesheet"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js"></script>
<select id="mySelect">
<option id="aaa">A</option>
<option id="bbb">B</option>
<option id="ccc">C</option>
</select>
The network analysis shows that the scripts are successfully loaded (status: 200).
https://code.jquery.com/ui/1.12.1/jquery-ui.min.js
then it works ?? Is github blocking other websites from loading content from their site?jquery-ui
network call returns with a 200 status but...nothing as a response payload? Weird. I wonder if it's GitHub blocking this..selectmenu
is not a function.