I'm experiencing an issue where I cannot get my jQuery script to work once a page is published. Based on the answers below, all I need to do is simply run
SP.SOD.executeFunc("sp.js", "SP.ClientContext", function(){
jQuery(document).ready(function ($){
var parent = $("#zz12_V4QuickLaunchMenu > ul > li:has('ul')");
parent.find("span.menu-item-text:first").append(" <i class='fa fa-angle-down' aria-hidden='true'></i>");
parent.closest("li").find("> ul").hide();
parent.click(function(){
var childUL = $(this).closest("li").find("> ul");
var isVisible = childUL.is(":visible");
if (isVisible) {
childUL.slideUp();
}
else {
childUL.slideDown();
}
});
});
});
except this does not work at all. I am familiar with jQuery, less so with javascript. So I do not know how to call my jQuery inside this javascript function. It looks to me that '$' is being used by another library, how do I ensure it is used inside of this function? Thanks.