JavaScript is a prototype-based object-oriented scripting language that is dynamic, weakly typed and has first-class functions.

learn more… | top users | synonyms (2)

-1
votes
0answers
10 views

Fivestar rating render using custom module and custom js

i want to display stars instead of dropdown list(Which i am getting currently) i am using fivestar module and display field is star while viewing, this approach is working in normal tpl files. here i ...
0
votes
0answers
20 views

Which button id triggered the form submission

My module hade a form and the form have 5 buttons: create, edit, save, etc.. also my module form use ajax to send the requests, and the function look like this: $form['dialogCreateButton'] = array( ...
1
vote
1answer
30 views

Bind click event to ajaxify form button

how the title says I would like to trigger javascript (jQuery) event from generated Drupal form button. I already add an id to the button and added the javascript in theme file like so: ...
1
vote
0answers
23 views

Update database/dom after dialog button submitted with jQuery

Clicking a dialog button I want to update Drupal database using jQuery .ajax() function! I want to know if in first place is secure to do so or is another method to handle the synchronous requests? ...
0
votes
0answers
14 views

Incorporate dash,js [on hold]

Is it possible to incorporate dash.js to the Drupal CMS to play video in MPEG-DASH format, otherwise, I’d like to know if there’s another module that allows me to do that.
0
votes
1answer
16 views

How can I pass a variable to javascript from a preprocess function? [duplicate]

How do I pass $variables['is_front'] from template_preprocess_page() to a jquery script in Drupal8?
0
votes
0answers
15 views

PHP rewrite on field-collection with onclick function

I'm trying to rewrite field-collection [field_video_cue_points] items as a link which hold onclick javascript functions in Views. I use the links to jump to specific times within a video. A link looks ...
0
votes
0answers
7 views

Error Ckeditor js when content editor into vertical tabs?

I used module Ckeditor major 7.16. I had build vertical tabs and create field text_format into fiedset. This see demo - Vertical Tabs --Fieldset + Element form.... --Fieldset + Element ...
3
votes
1answer
48 views

What is the equivalent of Drupal.settings.basePath?

I'm trying to get the site URL in JavaScript. In Drupal 7, this is stored in Drupal.settings.basePath. What's the Drupal 8 equivalent?
0
votes
1answer
36 views

Cannot bind delegate onClick event on .use-ajax elements

I have a view, that is refreshed with ajax. I'm using Jquery 1.7.2 You click a button, that call a javascript function : $(view_identifier).trigger('RefreshView'); Before this refresh, I've ...
0
votes
0answers
16 views

How to refresh the page on button click using Jquery in drupal7? [closed]

I have created a login popup with registered user using Jquery in drupal 7. after registered user one popup show with successfully user created message and one OK button. On the click ok button i have ...
0
votes
2answers
30 views

Uncaught TypeErrors have me baffled

This is my first Drupal 8 site but I have been building Drupal sites since Drupal 6. I am getting lots of Uncaught TypeErrors in the JavaScript console that I can't figure out. I have spend hours ...
-3
votes
0answers
24 views

How can i get to know that a file is in removing process? [closed]

I want to disable form submit button when an uploaded file is in removing process. But the problem is that i could not get to know that a file is in removing process. I want to disable submit button ...
0
votes
0answers
12 views

Pass value from browser to an array

I have built some javascript modifications to an exposed views filter form. I want to add a value to the exposed_input array, basically, a way of keeping track of what was last clicked. I want the ...
0
votes
0answers
17 views

Webform add a submit user confirmation

i want to add a step between the validation of the form (check if there is errors in the form) and the submition of the form (the moment when the form is saved). I want to show to the user a colorbox ...
0
votes
1answer
29 views

How to add OK button in drupal user-registration-form after submit the form using jquery [closed]

I have created registration popup. I want to add OK button on user success form for this I have writen the jQuery Code in my .js file this time it's working. but my issue is the OK button Seems to ...
1
vote
2answers
30 views

How to load jquery in twig file

I need to run a jQuery file in a twig file in order to bind aqua lift segments. but jQuery is not loaded yet . How can I load jQuery at this point without loading it twice? thanks
3
votes
2answers
47 views

How to run jquery function on every page load

I have a Views grid that contain images in DIV containers. I want these containers to have one of two possible heights 60px or 104px, depending on the images height. So I came up with this function ...
1
vote
0answers
15 views

How do I store data in entities text-list and field-collections?

I have retrieved data from an external database using REST. Now that it is cached in my Drupal 7 site in tables, I need to create new nodes of a specific content type. Works fine for most fields ...
0
votes
1answer
17 views

Administration page doesn't show pop-up (overlay) windows

When I try to place new block by clicking "Place block" button or when I click "Configure" on the block I see no pop-up window as I see in tutorial videos, like here: ...
0
votes
0answers
15 views

drupal_add_js being called too many times

I have a node page I created that I am using to control a certain node, it is called webform-form-19053.tpl.php. With this webform, a person will add a report using the form, preview the data before ...
0
votes
1answer
47 views

How do I get a module path?

I'm creating a module in Drupal 8 and I need to define a relative path to mymodule to pass it on a JavaScript file like this. $scope.getPlatformIcon = function (_platform) { var modulePath = ...
0
votes
1answer
21 views

how do I make JavaScript run after the page is loaded

With Drupal 8, I am adding JavaScript to my theme in the libraries.yml so that I can put lift segments into the data layer. But it is running before the body is loaded, and the data layer is being ...
1
vote
1answer
54 views

Please help for the moment no way to include chemistry in Mathjax

I'm using the Mathjax Module on drupal 7. All working pretty good but when i'm trying to add the chemistry js, it was not the same !! I tried to enable it without success. I have read a lot of ...
1
vote
1answer
18 views

Send 'compare product' action to Google Analytics

I am having a products page in my site. In that I have a comparison functionality. Now I want to send data to google analytics so that Admin can later on check which products were compared. I have ...
3
votes
1answer
30 views

Load CSS and JS using absolute paths on select pages

I've got a page (menu callback) which serves as a template for an external service. As the HTML of the page is consumed by the external service and rewritten then served from their server, all the CSS ...
-1
votes
0answers
12 views

How display video url without extension in videojs

i create a website of streaming movies, i have installed the module Videojs and her library. i have created a content type called : Movies i have read the readme.txt file of videojs module i ...
0
votes
2answers
33 views

Command to start nodejs? Server.js and app.js missing

The outdated documentation for drupal integration of nodejs using the nodejs module instructs me to start nodejs with the command node server.js. But neither server.js or app.js (replacement to ...
0
votes
1answer
15 views

How to make a popup appear on the side/bottom of the page instead of the center?

I'm still very new to Drupal and I've been trying to get a popup to appear on my page in a specific location. Popup on load (https://www.drupal.org/project/popup_onload) does pretty much everything I ...
3
votes
1answer
25 views

Why is jQuery 1.6.x not an option?

All the other versions of jQuery are listed; version 1.6.x is missing. What is the reasoning for not including 1.6.x in the jQuery Update module?
0
votes
0answers
7 views

How to write custom js (jquery) script using a zen sub-theme? [duplicate]

I'm working with drupal 7 with a zen sub-theme. What I need to do is just to add a jquery code on custom js file. I've seen how to create a custom js file : scripts[] = js/MyCustomJS.js in my ...
0
votes
0answers
14 views

Adding an id to MediaFront's video element in order to set currenttime [on hold]

I've enabled the MediaFront module and it works fine with the Media module. I can paste in an URL from our local servers and it will play the video file. But in order to get a script running, I need ...
0
votes
1answer
21 views

How to get the selected value of a dropdown inside panel?

I have a expose filter inside the panel. I wants to filter the taxonomy term. For that i add "Content: Has taxonomy term (exposed)" field. i need to get the selected value in js. ...
0
votes
0answers
51 views

Javascript lib in subtheme - status of 403 (Forbidden)

I am trying to load a Jquery library in my subtheme, however, when I refresh the browser, for the specific jquery lib, I get: Failed to load resource: the server responded with a status of 403 ...
0
votes
1answer
18 views

How to execute some js code after click on expose filter AJAX enabled submit?

I have try to update the input value of a expose filter field before submit of the expose filter through Js. What i have tried $('#edit-submit-phrases').on('click', function() { alert('check'); ...
0
votes
1answer
64 views

AngularJS implementation

I'm trying to use AngularJS in Drupal 8 template. My objective is to get the power of drupal as a backend to do content query, and AngularJS as a front end to make a single one page application. I'm ...
0
votes
0answers
10 views

Proper way to invoke jQuery UI menu widget

I'm trying to theme a menu using the jQuery UI menu widget. Here is what I've added in my template-preprocess.php inside the preprocess_page hook: drupal_add_js('(function ($) { ...
2
votes
1answer
23 views

How to acces gmap markers after map is generated?

I've got a problem with Google map markers and I don't find a way to solve it. I've got a map page view generated with the GMap module where I show certain nodes. I've got also a view block that show ...
0
votes
0answers
28 views

jQuery on and load event handlers

I'm trying to get the height of an image after it loads by attaching an event handler to the on or load event. I did some research and found that I couldn't do it like I would with regular jquery. I ...
0
votes
1answer
35 views

How to get all node ids from same content type

I am using Drupal 8 and I want to create related content, but the problem is that I can't figure it out, how I can get all node IDs(except current one) for a specific content type.
0
votes
0answers
23 views

Display confirmation popup window when user clicks on delete button

I've searched for, but, have not found a solution for this problem. Can anyone please help me solve this problem? In Drupal, on the content listing page, when the "Delete" content button is clicked, ...
0
votes
1answer
37 views

using {{ twig variables }} inside external jquery

Developing a D8 theme, I am loading an external .js file containing some jQuery code (so it is not inside the TWIG template). Is it possible to access and modify TWIG variables like {{ myvariable }} ...
0
votes
1answer
23 views

Reload Ajax from the js code

I am having trouble reloading a page through Ajax from custom JS. There is a form which will change with your choices and this changes are made by Ajax. How I can change the select list "Leistung" ...
0
votes
1answer
18 views

How to open various files(image,video,txt) as pop-up on the current browser page instead of opening in separate page?

I have seen on several sites, particularly news sites, If we click on video, the video does not open in the separate page, instead small window in the middle of the screen pops-up and video does play ...
0
votes
0answers
20 views

How can I set the focus on the CKEDITOR textarea after I change it to display:block?

I have a CKEDITOR textarea that is by default set to display:none on comment_button click I set the CKEDITOR textarea to display:block. How can I set the focus on CKEDITOR textarea after I perform ...
3
votes
0answers
77 views

How to add multiple products to cart at the same time with attributes

I have different view blocks that displays multiple products on the same page, each product has their own attributes such as product bundle and custom line item, these serves as an option set / ...
0
votes
0answers
13 views

Search box using Googles places API to search Leaflet map

I'm setting up a business directory for Bangkok with hotels based on the BizReview theme/installation profile. SETUP Content type In order to store bussiness locations I use a content type with a ...
0
votes
1answer
18 views

jQuery Datepicker : How to add option which accepts a function as an argument

I have added a date_popup field to a form : $form['arrival_date'] = array( '#type' => 'date_popup', '#title' => t('Arrival date'), ...
1
vote
1answer
16 views

Libraries require jQuery and not work

I load some libraries in my module by using this hook : function food_truck_form_views_pre_render(&$view) { if ($view->name == 'marqueurs_admin') { ...
2
votes
1answer
65 views

What version of jQuery does Drupal 8 use?

How can I find out what version of jQuery a particular release of Drupal 8 core is using?