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)

0
votes
0answers
15 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
26 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
1answer
16 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
16 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
0answers
11 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
49 views
+50

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
12 views

How to do avoid submitting and reloading the entire form during “Add more item” in the drupal admin system?

In my drupal admin, I have a custom content type input form. Basically we enter some project details and each projects has multiple credits associated. Each credit items are then added via "Add more ...
0
votes
1answer
15 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
52 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?
0
votes
0answers
38 views

Owl Carousel 2 switches to default position after Ajax call

I'm a real noob at js so I hope I'll find working solution to solve my problem. I'm working on Drupal 7 project based on Porto template v.2.1 using Dupal Commerce module. I've implemented Owl Carousel ...
0
votes
1answer
25 views

How to add js in view created by interface

I want to create a new button control in my ip_geoloc leaflet map. So, i created a view by using the drupal interface -> /admin/structure/views/view/markers_admin/edit And now i want to set a custom ...
0
votes
1answer
20 views

External javascript that contains jQuery

I have been asked to include an external js file into a site where I don't have direct access to modify it and the generated script has jQuery it that references $. Is it possible to include this ...
0
votes
1answer
16 views

How to ensure javascript using drupal behaviors is only run only certain pages?

I have a custom module "mymodule" that will contain a javascript file that use drupal behaviors to do something. Here is the file structure of the module. In the .info file i have added script[] = ...
0
votes
0answers
21 views

Adding jquery script to calculate average

I haven't found much documentation for this (surprisingly), but it's something I could use some help with, considering I'm not a Drupal expert /or/ a jquery expert. I have a content type "Estimate" ...
0
votes
0answers
12 views

Displaying drupal server side validation errors on the client side?

I'm using drupal client side validation to do validation of webform fields like first name, last name, email address and a unique event code. The event code has to be evaluated by making a http get ...
0
votes
0answers
5 views

Drupalchat windows break when refreshing

Also posted on drupal.org under: https://www.drupal.org/node/2710357 Dear all, On a project where we have implemented the drupalchat module we are receiving reports that the chat becomes unusable ...
-1
votes
1answer
18 views

Any easy way of implementing a mega menu?

Im wondering if there is a easy way to implement the following dropdown menu(ive added a before hovering on a list item, and after): If i had to do it right now, i would use a bootstrap dropdown, ...
0
votes
0answers
23 views

Need help with jQuery Slider

i have to appeal to you because i have a problem that is taking me hours to solve, but it must be simple. I searched on google but no answer. My chief designer wants that the home slider break a line ...
0
votes
0answers
17 views

Slide a slideshow upon clicking a botton in it

I have a jcarousel displaying full contents including some fields. Two flags are also included. If any flag is clicked, say A or B, I want d jcarousel to show the next content and so on, so that d ...
1
vote
0answers
16 views

Translating Javascript files with Drupal.t() fails

I've attached Leaflet draw js library to my site. I've modified that JavaScript file by wrapping UI texts in Drupal.t() It took a while before these texts were available in translation interface ...
0
votes
0answers
20 views

video source through jquery

I have one node in that link image filed and video file fields are included and i have created custom page that page will be redirected by link image field which loads jwplayer video. I want to ...
0
votes
1answer
18 views

Page scroll issue when using dropdown menu

I am using a view in this page, and using sexy exposed module for filter criteria. The page shows the horizontal scrollbar. How can I get rid of it?
0
votes
1answer
26 views

Submitting a form with AJAX causes page reload but only on mobile

I am submitting the user profile edit form by hooking the user profile edit form like this: $form['actions']['submit']['#ajax'] = array( 'callback' => 'user_profile_submit', 'wrapper' => ...
0
votes
4answers
36 views

How to submit a form with javascript?

I have an exposed views form, am geolocating in javascript and setting the co-ordinates in the exposed form. This form submits properly when I click on the 'apply' button but does not when I use ...
1
vote
2answers
44 views

How to properly add inline Javascript in Drupal 8?

Now that drupal_add_js(...., 'inline') is no longer possible, how can I inject dynamic Javascript from a custom module's Controller? (I'm trying to upgrade a D6 module with as little refactorings as ...
0
votes
0answers
21 views

Gallery Formatter ( jQuery Gallery )not working in some nodes due to 403 error in thumbnail

I'm using Gallery Formatter module in a node type. My problem is that just in some nodes the module seems not to work. The images are loaded, when you click on a thumbnail the main image changes, but ...
0
votes
0answers
15 views

Using Colorbox module: “Error: Syntax error, unrecognized expression: input[type='button']:.multipage-link-next”

In this production site http://181.224.135.163/~tommasom/node/add/rapporto-di-lavoro, on second page I added three test links, first one with class "colorbox-node" and the other two with class ...
0
votes
1answer
35 views

Can I add external js and css via module info files?

I have read that I can add js and css file via .info files. Can I add external css and js files there as well? Eg http://somewhere.com/in_a_galaxy
1
vote
2answers
38 views

drupal avoid caching for a javascript when page cache is on

So I have a custom block that shows a div and a JavaScript (tried inline and file), while page cache is on. JavaScript loads a uncacheable token got generated through a php function called within ...
-1
votes
1answer
45 views

Drupal function drupal_add_js()

How can I add function drupal_add_js with code below? <script src="http://example.net/script.js" ...
0
votes
0answers
24 views

Jquery document read working only on the console

I have a jQuery code, it works very well in Firefox or Chrome console but when I put this code in the .js file in the theme it did not work this is the code in npm.js : and i declared in the .info ...
0
votes
1answer
21 views

Create dynamic asset library

I'm trying to create a JavaScript test extension following the same style of simpletest: when the user opens an admin page, the extension scans for all "*.spec.js" files and attaches them to the page. ...
0
votes
0answers
6 views

Reference Error For Nexu Galleria (slideshow not working)

The slide show on this theme is not loadng. I've been gettting the following message. ReferenceError: Galleria is not defined But its clearly there. The rotator doesnt work.
0
votes
1answer
15 views

How to use FULL Jquery.com files in Drupal content item?

I can use JS Injector and link to JS files through the info file, but what if the script is quite complicated with a lot of files and dependencies? This accordion script has over 20 files...how to ...
3
votes
1answer
21 views

Once function not preventing behavior executing on AJAX update

I am attempting to disable 2 inputs within the Views exposed filter form upon initial page load. However I don't want this to happen after the filter form is autosubmitted. I have the following ...
1
vote
1answer
19 views

jQuery wrapper function when using Drupal behaviours

I have been trying unsuccessfully to add Drupal behaviors to an existing and workding JS script file that is wrapped in : jQuery(document).ready(function($){ // some JS here Drupal.behaviors.ios ...
0
votes
2answers
32 views

How to get the basepath in js file added in the info file?

I need the basepath in my custom.js file. I have added this custom.js file in my .info file. In custom.js file i am trying to print var baseUrl = Drupal.settings.basePath; console.log(baseUrl); ...
0
votes
0answers
22 views

Auto submit ajax-enabled form on all form changes

A custom Drupal module is used to generate charts (with d3.js) out of data saved in nodes. The module provides a custom page which contains an ajax-enabled form (with default options) to configure the ...
1
vote
1answer
23 views

I am trying to enable the jQuery UI module, but I am hitting with error

I am trying to enable the Jquery UI module in drupal 7, but I am hitting with error: The jQuery UI plugin is missing. Download and extract it to your jquery_ui module directory. (Currently using ...
0
votes
0answers
9 views

Add Js to a view using views_flag_refresh

I have created a views, listing node titles, I am using a flag say [Hide Title] to hide node titles from the view. Using JavaScript toggle in flag setting, and Flag Refresh is set in views setting n ...
1
vote
0answers
27 views

View exposed filter block no alter form with ajax

I am trying to filter out the no results items in my exposed filters. (I know i can use selective filters, but in this case i can't use them). So i alter the filters with form_alter, check which ...
0
votes
2answers
53 views

Implement Push Notification in my iOS App with a Drupal backend

I building an iOS App whose content is being brought from a Drupal site. It is being built in ionic/AngularJS. I intend to implement "Push Notification" functionality in my app that whatever ...
0
votes
1answer
26 views

How to access jQuery plugin added through libraries API

I'm working on a Drupal 7 module to integrate an existing jQuery plugin (smallworld.js). I've added it successfully through the Libraries 2.x API in my module: $libraries['smallworld.js'] = array( ...
0
votes
1answer
29 views

How do I use the value of a JavaScript variable in a module? [duplicate]

I need to use the value of a JavaScript variable in a module. For example, I am getting a city = 'delhi' in a JavaScript file, and I need to use this value in a module showing a form.
1
vote
0answers
23 views

Jquery not working on pageload, works after resizing

I'm having problems correctly displaying a static div (jumps to top of browser too early). I have found some JQuery code to fix it. I made a custom js and put the code in there. Using console log, i ...
0
votes
1answer
48 views

Revolution Slider stuck at loading

I need your help. I am running a site (D7.43, jQuery 1.10) with the Jollyany theme under the hood. The theme comes packaged with the revolution Slider from ThemePunch. I am trying to include a slider ...
0
votes
0answers
22 views

How to add jquery to drupal basic page [duplicate]

I want to add few jquery in my basic page of drupal website to call some api with parameter. Can any one explain me how can i accomplish this. $.ajax or $.post we can do right but its not happening in ...
1
vote
2answers
39 views

Add javascript to form by module

i am writing a module in drupal 8. I wish to add a javascript when loading that form. function ajax_example_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) { ...
0
votes
0answers
27 views

Ajax problem on node edit page trigger whole submit on Drupal 7

I'm facing a very strange problem on one website. First of all with the module media (I'm using the last version of the module). When click on "Remove" an image, an ajax request is triggered and ...