Questions tagged [javascript]

For questions related to JavaScript in Sitecore, including JS for Sitecore SPEAK applications (typically ReactJS), bugs or other issues with JS in Sitecore, hosting site JS in Sitecore, and beyond

Filter by
Sorted by
Tagged with
10
votes
2answers
632 views

Example of populating list in experience profile page with JSON data

I am setting up a custom tab with custom facet data in the Experience Profile. I am successfully returning text values to the screen. Now, I want to populate data into a list control. Are there any ...
9
votes
4answers
7k views

Why is my Ajax url not recognizing my sitecore controller or hitting my breakpoint in my sitecore controller?

this is my markup: the ajax is supposed to get called when there is a change to my dropdown selection: this is my ajax jquery: <script> $("#AffiliateList").change(function (e) { ...
8
votes
3answers
5k views

How to Render Javascript per page or component?

So I have renderings that depend on specific CSS or specifically Javascript. Do you load the same Javascript on all pages even if the Javascript is for a specific page/rendering, or do you pull in ...
7
votes
1answer
887 views

Sitecore component CSS and script handling in an HTTP/2 environment

First project using Helix coming up. In our previous project we've used HTTP/2 on the CDN, so we have adopted a lot of new best practices. One of the most important new best practices in HTTP/2 is ...
6
votes
2answers
299 views

Is it possible to edit fields in the Page Editor that are shown on hover?

I have a menu where the submenu area is shown when you hover over the top menu option. The top option is a link field and the submenu is a rich text area. When I hover over the top option the submenu ...
6
votes
1answer
744 views

Add custom redirect on SPEAK logout

We are using OIOSAML.NET/dk.Nita for NemLog-in (Danish National Identity Provider) as authentication mechanism for editors. Claims from the federation are mapped to Sitecore users on login, and that ...
5
votes
2answers
2k views

Sitecore 9.1 Experience editor throwing JS errors

we recently migrated to Sitecore 9.1 from 8.1 and we see a bunch of JS errors on the page only in experience editor mode. I dont see them happening in the normal mode. I tried replacing the Sitecore ...
5
votes
1answer
445 views

How do I add some JavaScript at the bottom of every layout using a pipeline?

I'm wanting to add some JavaScript to the bottom of every page, but I don't want to add it to the layout(s), so I'd like a way of doing it with a pipeline (or similar). I've tried a few of the MVC ...
4
votes
2answers
528 views

Whats is the correct way to implement FXM generated script

I'm having a problem implementing FXM generated script on some of out sites. The Issue, I found is that, the generated Tracking script script is located on our CMS, which is not a public domain. I ...
4
votes
1answer
783 views

Video component YouTube elements are not clickable

On the video component when I input a YouTube video, the share, watch later, video title and up next sections are visible, but are not clickable, is there a solution to this?
4
votes
3answers
207 views

Why is my Ajax url found when I test in preview mode, but not when I bring up the page in a url I get not found errors

Update: this is what my url is trying to resolve to: /home/about us/api/sitecore/findanaffiliate/getaffiliate/ so here is my Ajax : <script type="text/javascript"> $("#AffiliateList")....
3
votes
1answer
470 views

How do I construct a reasonable JS implementation of canExecute() for an Experience Editor Button?

I am trying to run a field editor for editing some meta data (tagging, description, title, image selection) in Experience editor. My starting point was https://blog.istern.dk/2015/03/02/running-...
3
votes
1answer
240 views

Sitecore FXM with Coveo, dynamic html does not seem to render

Sitecore 8.1 (160302) I have a client using Sitecore FXM to export HTML/JS/CSS to an external site in order to preserve the same experience outside of Sitecore. The "experience" itself is mostly the ...
3
votes
1answer
1k views

How to extend SXA components scripts?

I need to overwrite/extend the component JavaScript (e.g.: script for the Carousel which is located here /sitecore/media library/Base Themes/Components Theme/Scripts/component-carousel) files to add ...
3
votes
1answer
1k views

Sitecore jQuery version compatibility

We are using Sitecore 7.2 Update 4, jQuery 1.9.1 and Bootstrap 3.2.2 We are using TypeAhead which uses Bootstrap but it's not working in our solution as it's picking up jQuery version 1.5.1 included ...
3
votes
1answer
73 views

Identify Administrators in Javascript

I am modifying the existing javascript for the SelectRoles modal window, and I would like to add a piece of code to check if the current user has the "Is Administrator" checkbox checked. I need to ...
2
votes
1answer
301 views

Is there a way to write to the Sitecore logs via Javascript? (8.2)

I need to track some particular Javascript events in my Sitecore (8.2) logs so that I can see how often it's firing. I have some ideas for how I could make my own api to write to the Sitecore logs, ...
2
votes
2answers
1k views

A serious error occurred please contact the administrator

I am working on SPEAK UI in Sitecore. I have created the button, Which is named as Edit Meta under content/webedit/ribbons/webedit in core database. This button will be shown in Experience Editor ...
2
votes
1answer
168 views

How to show success message alert on form submit in Sitecore 9 Forms in the same page?

I am trying to implement a custom Sitecore 9 Forms (not WFFM forms) functionality. And I need to show a success alert message on successful submission of the form. But here's the catch, The success ...
2
votes
1answer
143 views

Sitecore datetime to javascript Date object

Say please what is the best way to convert Sitecore datetime string (20170401T073000Z) to javascript Date object ?
2
votes
2answers
821 views

Sitecore Experience Editor not working with ".slick" command

I am using .slick command on the javascript for my page carousels. When I try to edit items in Sitecore Experience Editor(Sitecore 9 with SXA) my Save button is disabled and I am unable to add any new ...
2
votes
1answer
725 views

SXA: JS scripts optimization results in syntax error

It's now been a few times I am getting this error. Using Sitecore 8.2 rev. 160729 along with SXA 1.2 rev. 161216, when I modify a SXA javascript file (ie. a component-* file) inside the Media Library >...
2
votes
1answer
136 views

Undefined error when clicking Publish in Experience Editor

When we click the Publish button in the Experience Editor, we receive the following error in the ExperienceEditor.js: "Uncaught TypeError: Cannot read property 'get' of undefined The particular ...
1
vote
1answer
130 views

Create new user with JSS

Is there any API by which can create a new user in Sitecore with JSS?
1
vote
2answers
835 views

How to show a loading image mean while a submit form is being executed in Sitecore 9 Forms

Currently I have a form (created using Sitecore 9 Forms not with WFFM module) and on submit (custom submit action button). While clicking submit button, I have to show the loading image in the client ...
1
vote
2answers
1k views

loading partial view from jquery

I am trying to swap partial views on my home page layout via jquery. I have 3 tabs which when clicked, would load their respective partial view into a placeholder on the main layout. In my ...
1
vote
1answer
273 views

Trigger Google Analytics Events on Sitecore WFFM form submission

I want to track form submissions by creating a dataLayer event (a JS array with form values) when a form is submitted successfully (onSubmit). This is my sample DataLayer Push code <script> ...
1
vote
1answer
252 views

Angular JS directive with MVC integration Experience Editor errors

I am trying to use Angular Directive with MVC. Following Alex's blog post https://asmagin.com/2016/07/05/using-angularjs-directives-in-sitecore-edit-mode/ It is supposed to be working. But I am keep ...
1
vote
1answer
93 views

Page in Experience Editor hangs forever with page unresponsive dialogs

We are using Sitecore 8.2. We have a page with Marketo Form which contains Google Recaptcha. We lazyload the scripts and styles on the page. In experience editor, once we scroll down to the form, the ...
1
vote
1answer
490 views

Inject JavaScript in the header tag of the page based on rendering

We have specific requirement where we want to load only the scripts/css which are required for particular rendering on the page. Those scripts/css need to be loaded in the <head> tag but not in ...
1
vote
1answer
1k views

Caching issue for JS/CSS in Media Library node

We have one caching issues on live site. Actually we keep JS/CSS files in sitecore media library so after every prod deployment when we publish updates JS file we have to press Ctrl+F5 to load latest ...
1
vote
0answers
50 views

Undefined Javascript Error on Media Upload

In Sitecore 8.2, we have an item template featuring an image field. The preferred workflow for creating an instance of this template is the use of the Browse trigger on the image field and the Upload ...
1
vote
0answers
98 views

Add Sitecore Form Fields with Javascript

Is it possible to add a sitecore form field to a form with javascript and if so, how should I approach it?
1
vote
1answer
65 views

Angular JSS - References to Window Break In Experience Editor

I have a couple references to the window object in my Angular JSS component: @HostListener('window:resize', ['$event']) onResize(event) { if (window && typeof window !== 'undefined') {...
1
vote
0answers
50 views

Consume sitecore jss data from a separate sitecore instance

I have a Sitecore 9.1 MVC implementation where I want to consume the layout service response from a different Sitecore endpoint as an rendering. I have gone through the ways mentioned in Sitecore ...
1
vote
0answers
38 views

Commerce JavaScript Hooks

I am using XP 9.0.2, XC 9.0.3 andSXA 1.8.1, in commerce, are there javascript hooks I could use to display loading animations while activities such as product list loading are taking place? I was ...
1
vote
0answers
44 views

Doing translations for javascript based controls

I am using kendo-ui for rendering some complex controls on our website mainly used for data-entry. I want to have the content of these controls being translated by sitecore and also have the controls ...
1
vote
0answers
1k views

jQuery AJAX GET request returning “parsererror” error response message

In a scope of Sitecore Web project an API Contoller is used. Got the following response error message during jQuery AJAX GET API request: On a back-end side I use IHttpActionResult action method that ...
1
vote
1answer
1k views

What is the best way to add a Javascript component to speak?

I want to use the jsgrid in a customized sitecore shell model , i wonder what could be the best way to include the script file without building a custom speak component. Thank you
1
vote
0answers
832 views

Configuration error in JSS Sitecore Quick start for development

Configuration error while browsing Sitecore basic jss app after performing deployment steps mentioned in below link: https://jss.sitecore.net/#/setup/app-deployment?id=app-deployment
0
votes
1answer
70 views

Upgrading jQuery for sitecore xp 9.3

I notice sitecore 9.3 does have a pretty low version of jQuery at several places in the content editor in sitecore/shell/lib/jquery, ScriptResource.axd, Telerik.Web.UI.axd are all using jQuery 1.12.4 ...
0
votes
1answer
213 views

How to correctly import jQuery in SXA?

I could add the library in the theme's script/ folder, but when SXA minifies and uploads the files, it loads my other scripts before it loads the jQuery library (thus breaking the site since it doesn'...
0
votes
1answer
45 views

Trigger a Sitecore Command on a Modal link item

I am working on a Dashboard Popup in Sitecore in which I display list of several items. And I want to know if I can trigger a sitecore command link the "item:load" to focus on the Content ...
0
votes
1answer
104 views

WFFM custom toggle switch [closed]

I am adding toggle switch as a custom field. Toggle.cs (Toggle C# code) public class Toggle: Sitecore.Form.Web.UI.Controls.Checkbox { } public class ToggleField : Sitecore.Forms.Mvc....
0
votes
1answer
332 views

Sitecore Forms JavaScript not working for multi-page form markup

I am creating a Sitecore multipage form using Sitecore Experience Forms, The markup for step/page 2 is only rendered after I click on the next button on page 1. I want to trigger some JavaScript on ...
0
votes
1answer
277 views

Sitecore Form Scripts aren't being Loaded after Form Submission

So, before submitting a form, my web page loaded all the form-related scripts completely. However, after the form is submitted, the page went blank and only displaying the form element, and it got ...
0
votes
1answer
118 views

SXA drop down filters reset button not working

I'm using in one page 3 SXA drop down filters (category, services, activity), search result and a reset button that clears the filters in the bellow script: function forceReset(){ if ($xa(".clear-...
0
votes
0answers
26 views

Sitecore 9.3 - parts of CM stopped working, JavaScript errors in console

It seems that any place the Sitecore CM where a modal dialog would pop up has stopped working and I haven't been able to figure out why. I see the same behavior in both Chrome and FireFox. The error ...
0
votes
0answers
21 views

Sitecore 10.1.1 XP single TypeError: Cannot set properties of undefined (setting 'BindingTarget')

I get blank screen and console error when I try to add send email action in Sitecore 10.1.1. I'm using Sitecore XP Single. Steps to reproduce Open or Create a Sitecore form Add Submit action Send ...
0
votes
0answers
35 views

Disable submit button after first submission

I want to stop duplicate WFFM form submissions. I am writing a method to disable the button after first submission. $("form").each(function() { var wffm = $(this).attr("data-wffm&...