Adding Errors with JS

Hi Moshe, the problem here is that, assuming that your pageTitle variable is something like var pageTitle = $(‘#MyPageTitle’); this DOM element cannot be found. So the question is, in what JavaScript context are you running this code? If you are running it from within an “Inline” JavaScript resource, can you post the code for this resource? One of the important things to consider when writing JavaScript in Skuid Pages is to ensure that the Component you are requesting is actually in the DOM / has already been built when you run JavaScript that looks for that component. If your JavaScript code is in a basic Skuid Page, loaded via an Inline JavaScript, then you need to make sure your code is in a jQuery ready() block so that it will be loaded once all Skuid components have been built, like this:

(function(skuid){ var $ = skuid.$; $(function(){ // Find a Page Title component whose "Unique Id" property // has been set to "MyPageTitle" var pageTitle = $('#MyPageTitle'); // Get the editor for the Component var editor = pageTitle.data('object').editor; }); })(skuid); 

The one scenario where this will not work is if your JavaScript code is in a Page that is being INCLUDED via a Page Include component that’s inside a Tab with Deferred Tab Rendering enabled. In this case, the contents of the Page Include will not be loaded immediately on page load, and so the jQuery ready() block will not help. Your code will instead have to listen for the Page Include to be loaded, like this:

(function(skuid){ var $ = skuid.$; $(function(){ // Run this code the first time, and only the first time, // that a 'pageload' event // is triggered on the document body. // Such an event is triggered as soon as a Page Include component // is finished loading. $(document.body).one('pageload',function(){ // Find a Page Title component whose "Unique Id" property // has been set to "MyPageTitle" var pageTitle = $('#MyPageTitle'); // Get the editor for the Component var editor = pageTitle.data('object').editor; }); }); })(skuid);