I've created own Custom Theme Layout for Community and inside this layout there are Javascript libraries. I included all the required libraries from static resource using  and they seem to load properly (I can see them in source) and there are no error in Chrome Console. However javascript funktionalities are still not available (like JS based language selector etc.). It's very difficult to finde out what's going wrong. But maybe some have experience with Custom Theme Layouts with heavy JS usage? Could it be some jQuery issue since two versions seems to be available - one in Lightning Component and one in general environment? It also looks like Communities don't load Javascript libraries at once and not in proper order.
33742
Components often seem to work with external libraries until the Locker Service is enabled. What libraries work with locker service enabled and where can I go to find out?
9971
I'm trying to build a custom datable because I want the functionality to sort, search and paginate and also add action buttons in each row. Initially, my VF page was using  but we have now decided to rebuild that page in LWC.  I found a similar  but it hasn't really worked for me.  I then found  (Javascript) and  (ES2018) I have tried to implement Vanilla Datatables but I keep running into issues such as:      TypeError: Cannot read property 'length' of undefined   The above error is thrown because the library is unable to find the body of the table.   My point is that I feel this library won't work because it's using document, window and so on.   I was wondering if there is a way I could convert this library to something that is more suited to LWC basically have it "export" the modules. Since I'm not a JS expert I'm unable to put the pieces together.   Just for some context, I'll post my code here:  &lt;template&gt;     &lt;table class="sobject-table slds-table slds-table_cell-buffer slds-table_bordered"&gt;         &lt;thead&gt;             &lt;tr class="slds-line-height_reset"&gt;                 &lt;template for:each={fieldSetData} for:item="field"&gt;                     &lt;th key={field.apiName} title={field.fieldLabel} class="" data-scope="col"&gt;                         &lt;div class="slds-truncate" title={field.fieldLabel}&gt;{field.fieldLabel}&lt;/div&gt;                     &lt;/th&gt;                 &lt;/template&gt;             &lt;/tr&gt;         &lt;/thead&gt;         &lt;tbody&gt;             &lt;template for:each={records} for:item="row"&gt;                 &lt;tr key={row} class="slds-hint-parent"&gt;                     &lt;template for:each={row} for:item="data"&gt;                         &lt;td key={data.id} data-label="Name" data-scope="row"&gt;{data.value}&lt;/td&gt;                     &lt;/template&gt;                 &lt;/tr&gt;             &lt;/template&gt;         &lt;/tbody&gt;     &lt;/table&gt; &lt;/template&gt;   import {LightningElement, api, wire} from 'lwc'; import {processRecords} from 'c/recordGenerator'; import getFieldSetData from '@salesforce/apex/FieldSetData.getFieldSetData'; import getSobjectRecords from '@salesforce/apex/DeomoCTRL.getRecords'; import VanillaDatatable from '@salesforce/resourceUrl/VanillaDatatable'; import {loadScript, loadStyle} from 'lightning/platformResourceLoader';  export default class ManageSelectedIndicators extends LightningElement {     @api recordId;     records;     fieldSetData;     @wire(         getFieldSetData,         {objectName: 'SOBJECTName', fieldSet: 'FIELSETName'}     ) wiredFieldSetData({error, data}) {         console.log('wired called in Child')         if (data) {             this.fieldSetData = data;             this.getData();         }     }       constructor() {         super();         console.log('Constructor called in Child');     }      connectedCallback() {         console.log('Connected callback');     }      renderedCallback() {         console.log('Rendered callback');         Promise.all([              loadScript(this, VanillaDatatable + '/VanillaDataTables/src/vanilla-dataTables.js')          ]).then(() =&gt; {              const table = new DataTable(                  document.getElementsByClassName('.sobject-table'),                  //Also tried this.template.querySelector('.sobject-table'),                  {searchable: true, sortable : true}              );          })          .catch(error =&gt; {             console.log(error);          });     }      getData() {         getSobjectRecords ({             sobjectId: this.recordId         })         .then(response =&gt; {             this.records= processRecords(response, this.fieldSetData);         })         .catch((error) =&gt; {             console.log(error);         });     }  }   Edit: I have also tried lwc:dom="manual" that didn't seem to work either.  Is there any other way I could achieve these functionalities? Or do I have to write custom code to achieve this?
99354
I want to add the following code in my  section of the front page using a Drupal 8 sub theme of Bartik.   Can anybody help how to do it? What is the best way to do it in this new twig version of theme? Where is page.tpl?  &lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="stepcarousel.js"&gt;&lt;/script&gt;
10791
I am trying to override a standard "New" button that appears when Case tab is clicked ,so i navigated to new button on the object and i see lightning component bundle is one way to override but when i select the dropdown i dont see my lightning components , is this Beta? or do my lightning component need to implement something ? or below answer in the link is what needs to be implemented for now lightning comp in VF?     standard-buttons-with-a-custom-lightning-page
18086
Reading through this doc:      We replaced the rich text editor in HTML Area home page components   with a new version that supports more markup but doesn’t allow HTML to   be manually entered.      In Summer ’15 we will start removing unsupported code from HTML Area   home page components. As a result, components that contain JavaScript,   CSS, iframes, or other unsupported markup might stop working properly.   To use JavaScript or other advanced HTML elements in your home page   component, we recommend that you use a Visualforce Area component   instead.   With Visualforce homepage component the best we could do is design fancy home page components, which has not been the big use of sidebar amongst developers. How do we do the fancy hack we do today using html components since visualforce is hosted in a different domain will the sidebar hacks even work after summer 15?     You can include JavaScript in your Visualforce page, but because the   component is rendered in an iframe on the home page layout, the   JavaScript can’t interact with the page that contains the component.   Finally why this move :(?
33339
I used the following code.  libraries.yml      my_module.admin:   version: VERSION   js:     js/my-module.js: {}   dependencies:     - core/jquery     - core/drupal     - core/drupalSettings   my_module.module   /**  * Implements hook_page_attachments().  */ function my_module_page_attachments_alter(array &amp;$attachments) {  $attachments['#attached']['library'][] = 'js/my_module';   // $attachments['#attached']['library'][] = array('my_module', 'admin'); }   my_module/js/my_module.js  (function($, Drupal, drupalSettings) {     Drupal.behaviors.my_module = {       attach: function(context, settings) {         $(document).ready(function() {             alert("hello");             console.log('Loaded');           }         };       })(jQuery, Drupal, drupalSettings);   I have tried many other changes, but the JavaScript file is not used.  I have ported Drupal 7 code that implements hook_boot() and includes that JavaScript file, to Drupal 8.
108198
We have updated the jQuery version that Stack Overflow and Stack Exchange use from version 1.7.1 to 1.12.4 today (Tuesday, September 27, 2016). jQuery is an infrastructure library, and we've been running on an old version for a while because it worked well. However, there are a few improvements and features that made it compelling for us to upgrade, especially since some parts of the site already used a different version.  As a user of our Q&amp;A sites, nothing should visibly change, as this is an infrastructure rather than a feature update. However, with an infrastructure update like this, there is always a chance for things to slip through the cracks.     If you encounter functionality that used to work yesterday and is broken today, please leave an answer on this thread and accept my apologies in advance.   Please be aware of our .  Do note that userscripts that rely on  (like .live() - anything in the 1.7, 1.8, 1.9 and 1.10 category, and if you can in the 3.0 as well to make a future update less likely to break your script) may need to be updated. There were no DOM or other structural changes, so selectors should still be the same.  If you're curious why we're going to jQuery 1.12.4 and not 3.1, this is a matter of incrementally upgrading and making sure things work along the way. Pretty much every 1.x version had major changes, and jQuery recommends upgrading an old 1.x version to the latest 1.12.4 and  plugin first and fix anything that is deprecated. We are in this stage now and want to make sure everything still works.
72357
i just observed  release notes, and in my org critical updates area, we r using $A.createComponent()/ $A.createComponents() in bunch of our custom lightning cmps's. still i am not under stand how this critical updates 'll effects of our orgs, can you please explain how it'll effects for below code snippet.  we r using simple like below:  cmpcontroller.js  opencustomcmpmodal: function(component,field1,field2,field3){  var attributes = {    'chldfield1': field1,    'chldfield2': field2,    'chldfield3': field3 };      $A.createComponents(                 [                     ["aura:html", {                         "tag": "h2",                         "body": 'Modal header',                         "HTMLAttributes": {                              "class": "slds-text-heading_medium slds-hyphenate"                          }                     }],                     ["c:mycustomcomponent",attributes]                 ],             function(components, status) {                 if (status === "SUCCESS") {                     modalheader = components[0];                     modalBody = components[1];                    var promiseaction =  component.find('overlayLib').showCustomModal({                        header:modalheader,                         body: modalBody,                         showCloseButton: true,                         cssClass: "my-modal,my-custom-class,my-other-class"                     });                     component.set("v.modalPromise",promiseaction);                 }             }); }
39084
In Drupal 7, I can use drupal_add_js within a theme's template.php file as a theme_preprocess_html(&amp;$vars) function:     drupal_add_js(drupal_get_path('theme', 'mytheme') . '/js/scripts.js',         array(           'group' =&gt; JS_THEME,           'preprocess' =&gt; TRUE,           'weight' =&gt; '999',         ));    $vars['scripts'] = drupal_get_js();   In Drupal 8, I've tried converting this using attached in my theme's .theme file as such:    $vars['#attached']['js'] = array(     array(       'data' =&gt; drupal_get_path('theme', 'mytheme') . '/js/scripts.js',       'options' =&gt; array(         'group' =&gt; JS_THEME,         'preprocess' =&gt; TRUE,         'every_page' =&gt; TRUE,       ),     ),   );   ... but that did not work and there were no errors in watchdog / console or otherwise.  According to the  for drupal_add_js:     Deprecated - as of Drupal 8.0. Use the #attached key in render arrays   instead.   There was not much more info that that however. It seems that drupal_add_css will also use this method. I know it's still early days for Drupal 8 but I was hoping to get a jump on this.
86296
Most of the links on stackoverflow are not working. I suspect it is due to a js that is not being loaded.   I am getting following error in console. Can anyone please suggest on how to get rid of this error?    The problem occurs only for stackoverflow dropdowns/links. No issues in other communities.  The problem occurs in chrome and FF. Please note, I logged into stackoverflow using FF for first time.
113698
We are developing a new Lightning Community to replace our Partner Community. However, when we use our visualforce pages with LightningStylesheets=true on the Lightning Community, the Lightning styling is not applied.  I understand that this is the case because Lightning Communities are not Lightning Experience.  Is there a way to force LightningStylesheets anyway? I am trying to stay away from having to rebuild/restyle all our legacy visualforce pages.
113385
Is there any way in Winter 15 to get access to standard lightning components?  If not thru drag and drop, is there a listing of such components by name and parameters, so that they can be included in a lightning app?
7928
I wanted to add custom JavaScript code on certain nodes. I have written this code in the html.tpl.php template, but this doesn't work. (donate is the path alias for a node.) &lt;?php if(arg(0) == 'DONATE'): ?&gt;   &lt;script&gt;     (function() {       // ...     );   &lt;/script&gt; &lt;?php endif; ?&gt;
44392
Is it possible to use Javascript inside CSS?  If it is, can you give a simple example?
90466
I created a custom theme (a sub-theme of  base theme).   I am loading a custom Javascript file (radix_sub.script.js) using the module libraries.yaml file like below:  style:   version: VERSION   css:     theme:       assets/css/radix_sub.style.css: {}   js:     '//cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js': { type: external }     '//stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js': { type: external }     assets/js/radix_sub.script.js: {}   dependencies:     - core/drupal     - core/jquery     - core/jquery.once     - core/drupalSettings   In that file, I want to register some JavaScript events (Bootstrap modal).  (function ($, Drupal) {    Drupal.behaviors.portfolio = {      attach: function (context) {        console.log('CONTEXT', context);        $('#portfolioModal', context).once('bootstrap-modal-shown', console.log('*** REGISTER SHOWN.BS.MODAL')).each(function () {         $(this).on('shown.bs.modal', function () {           console.log('SHOWN BS MODAL EVENT TRIGGERED');         });       });        $('#portfolioModal', context).once('bootstrap-modal-hidden', console.log('*** REGISTER HIDDEN.BS.MODAL')).each(function () {         $(this).on('hidden.bs.modal', function () {           console.log('HIDDEN BS MODAL EVENT TRIGGERED');         });       });     }   } }(jQuery, Drupal));   It works. I see both SHOWN BS MODAL EVENT TRIGGERED and HIDDEN BS MODAL EVENT TRIGGERED logs when I show/hide the modal.  First, am I doing that the correct way?  This is what my developer console looks like when I load my page.        This happens only when I am logged in (as admin). When I am anon, I see the REGISTER logs only once but here my code seems to be executed 11 times.  Is this normal behavior? And/or why is it doing that?
72134
This questions has been asked multiple times but there is not a workable solution to this problem.  Use Case: we are building a dynamic form rendering engine where we have sections, sub-sections and we are using record/record-edit forms to show fields and objects  on these sub sections. for each sub-section there is a custom object record from where we read fields and objects.  This is a managed package where someone can install and add their own configuration and the form will render in UI.  Problem: If there are complex use cases which record/record-edit forms cannot do we have also given a provision where in the same sub-section custom object record  , you can give your own custom component name. In aura, this worked since we can render dynamic components using create component function from javascript but it doesn't work in LWC since this method is not exposed.  Documentation says use slots/make the markup predictable but if this has to be a managed package and render dynamic components based on each client's need how can we have static markup in LWC since we wont know the component name before run-time.  Any thoughts or ideas on this would be truly appreciated
96914
I am following the steps listed here  in order to enable communities for a scratch org, but the following error is received: We couldn't find a template with the ID specified in the scratch org definition. If you’re sure the ID is correct, contact Salesforce Support.  This is my scratch org definition file: { &quot;orgName&quot;: &quot;Demo&quot;, &quot;edition&quot;: &quot;Developer&quot;, &quot;features&quot;: [&quot;Communities&quot;], &quot;settings&quot;: {     &quot;lightningExperienceSettings&quot;: {         &quot;enableS1DesktopEnabled&quot;: true     },     &quot;communitiesSettings&quot;: {         &quot;enableNetworksEnabled&quot;: true     } }  } I can create standard scratch orgs, but for some reason is failing for communities, tried changing the edition to &quot;Enterprise&quot;. My sourceApiVersion for this project is 49.0. I can not find this error in the list of known issues for Scratch Orgs listed here: . Hoping to find answers here before contacting support. Thanks!