inline javascript not running on salesforce site

This inline javascript:
(function(skuid){When I run the page with the skuid preview, it works fine. When I run it visual force on a salesforce Site, the code doesn't execute and my console is blank.
var $ = skuid.$;
$(document.body).one('pageload',function(){
console.log('Page Loaded');
});
})(skuid);
Tagged:
2
Categories
- 7.9K Questions
- 926 Ideas
- 220 Discussion Categories
- 178 General
- 9 Community Feedback
- 3 Community Info
- 18 Knowledge Base
Comments
should be
$(document.body).on(
$(document).ready(function() {
console.log("hello world");
});
$(document).ready(function(){
console.log('page loaded');
});
I have an inline javascript resource like the following, which runs fine in salesforce but on on a salesforce site:
Try using $(".nx-page").one("pageload",function() { instead of $(document.body).one('pageload',function(){ - oh, just realized you said the snippet isn't getting called at all, so that won't help you. Do you see any errors in the browser console?
Searching through the salesforce documentation and forums hasn't gotten me anywhere.
Matt,
did you work out what this problem was (3 years ago...) I seem to have the same problem although a snippet I have is running on the SF page but an inline script is not, I can see it as a resource in the page but no execution, no errors.
Any guidance much appreciated
Ben,
Hey Ben, what version of Skuid are you using? Are you building in api V1 or v2?
To confirm, are you seeing the issue just in the Force.com Site, or also when you preview the page from the App Composer?