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

learn more… | top users | synonyms

0
votes
1answer
13 views

Detaching Drupal Behaviors of another module

I'm using this module External Link module which adds "ext" as a class to any anchor tag matching the regex defined via the admin UI provided by the module. I then bind a click event to trigger ...
0
votes
1answer
30 views

Using hook_js_alter to change localsettings variable in the autologout module drupal

I want to know how to use hook_js_alter to change the localSettings variable in autologout.js. In autologout.module in line number ( 377 - 389) $settings = array( 'timeout' => $refresh_only ? ...
0
votes
0answers
5 views

Repopulating DataTable via AJAX

The setting: I'm currently making an application which will handle the ordering process for a company. I currently have clients, products and orders which work perfectly well. Now I'm trying to add a ...
0
votes
1answer
18 views

FlexSlider fail slideshow

I installed FlexSlider as suggested on the module's in Drupal7. I try to put a slideshow on my home page with no luck. I tried to create the FlexSlider Example content but it does not create a ...
1
vote
0answers
31 views

how to hide and show custom filter form on a drupal view

ok im new to drupal and im trying to create a view with many filter options, because it has alot of filter fields i want them to be hidden and only show the filter fields the user decides he wants to ...
0
votes
0answers
22 views

no css/javascript when anonymous

I finally was able to fix my site in our stage environment until I logged out of the admin section. Now the site has no css at all. All the html seem to be fine. If I login as admin, the site is still ...
0
votes
0answers
6 views

Panopoly, custom module and javascript rendering error

I have created a custom module that creates a jquery dynamic menu displayed as a slider in the left part of the screen. When clicking 'customize this page' the menu is activated and shows an image ...
0
votes
0answers
11 views

Validation on AJAX loaded webform

I load a webform when a user clicks on a certain button. $.ajax({ url: '/js/project-contact', type: 'GET', cache: true, dataType: 'json', success: ...
0
votes
1answer
26 views

Getting date_popup new value with JS

I'm currently working on a module with a form where people enter information about their order and select products, where the product selection is handled by JavaScript. The handling of the form will ...
0
votes
1answer
18 views

Javascript function breaks chart.js in Drupal 7

I am trying to insert my chart.js into a Drupal page. Here is the fully functional fiddle: http://jsfiddle.net/vy0yhd6m/80/ When I enter that into a basic page content item in Drupal, the chart will ...
0
votes
2answers
30 views

Two JS files attached to one module

Alright, so I have two files which should be added to a module. This is the way I do it: $form['display']['#attached'] = array( 'js' => array( array('data' => ...
0
votes
1answer
26 views

Jquery Library Conflict Error in Drupal 7

I've been currently developing a module. Before it was working fine but as I started working on my module, the console throws an error every time I click a link in my Drupal admin menu. For example: ...
0
votes
1answer
23 views

How can I pass a long javascript string to PHP hook_menu in Drupal?

On mysite/build-order I have a long order code that I'm assembling using Javacsript and sending via _GET in the URL to a hook_menu page for processing. It can be as long as this (or longer), and am ...
1
vote
1answer
24 views

How can i use bootstrap js library in my theme?

I use bootstrap drupal theme. And i want to use collapse. I added in theme.info the library path bootstrap.js have cleaned the cache, but after using the following code generates only the button, ...
0
votes
0answers
11 views

aggregated JavaScript and css corrupted on production server only [duplicate]

Am having an issue with my production server with aggregated Javascript and css files getting corrupted this works fine on the local dev server any ideas on what maybe the cause of this. Here is a ...
0
votes
0answers
17 views

Webcam Plugin Doesn't Work in my Drupal 7 Forms API

I've been developing a module that must have a capability to capture a user's profile picture. This is what my interface looks like: Where in fact it should be like this: (sample.php) Webcam ...
0
votes
1answer
17 views

prepend one div in body in .inc file

I want prepend one div using jQuery, But the div has to be generated dynamically, so I can not add it in html.tpl file. I have tried below code drupal_add_js('jQuery(document).ready(function () { ...
0
votes
0answers
23 views

Open a Browse Dialog for Image Upload when a context menu is clicked in Drupal 7 Forms API

I've been developing a module that must have a capability to browse and upload a user's profile picture. Before I was using a managed file form control to browse and upload a picture but as time goes ...
0
votes
1answer
34 views

Dont Refresh Drupal's Page after a button is click in Forms API

I had started developing a module in Drupal. I made two form controls: a fieldset and a button. The button calls a javascript function "myphoto_options" when it is click. This function only does an ...
0
votes
0answers
19 views

Add Javascript by URL Alias

I've been using this code from drupal.org to add javascript to a page node. function example_preprocess_html(&$variables){ if(arg(0) == 'node' && arg(1) == 585) { ...
0
votes
0answers
20 views

Having trouble selecting elements in jQuery with JS added on the form

I have a form with a file element and a button. When I click the button it is supposed to run some JS. I have tried three separate ways to get this to work but each way gives me a different result. ...
0
votes
1answer
25 views

Changing color of form html with Javascript

I have some custom HTML and CSS added to a form module I've created. It looks fine; the css is styling it correctly with a drupal_add_css() stylesheet. But I also want to add some Javascript using ...
1
vote
1answer
28 views

Before I install this module I want to better understand this note

I want to install the Autosave module. In the module's page there is the following note. Can someone please clarify it for me in more simple words? I wonder if it could clash with other modules that ...
0
votes
1answer
21 views

Javascript variable value in page source for seo from Drupal.settings

Declared a variable in settings.php $conf['my-variable'] ="my-variable-value"; Added inline javascript drupal_add_js("array('my-variable'=>variable_get('my-variable'))"); Need to print ...
0
votes
4answers
49 views

Pass php variable to javascript

I'm trying to pass variable to my js file. The file is located in my theme /js directory. The filename is backgroundConfig and this is the content of file: (function($, Drupal){ ...
0
votes
2answers
45 views

Using drupal_add_js with google maps

I want to pass down an array to my javascript. So that i could create markers on google map. By doing this: ...
0
votes
0answers
9 views

Building complex Javascript on top of but apart from Drupal

Does anyone have any thoughts on developing significant Javascript functionality on top of but separately to a Drupal site? I have started working on an old Drupal site (dealing with written, news ...
0
votes
0answers
23 views

Javascript that I add to page dosnt seem to run

The thing I want to achieve is that on a specific page my module places a google map with markers on it. Here is how i do it: First I add this: $setting = variable_get('locationUrl', ''); if ...
3
votes
1answer
28 views

Scope javascripts to be outside admin

Now when we are almost there using purely YML files to include JavaScript, is it possible to include javascripts everywhere except for in the Drupal administration? Beta 4 does not allow the #attached ...
0
votes
0answers
29 views

Need to change order of js in Drupal 7 [duplicate]

I have js jquery 1.10.1 min js which append after drupal.js. Due to that i got following Error: "Uncaught ReferenceError: jQuery is not defined drupal.js 5". So how can i change the order of js so ...
0
votes
0answers
56 views

Drupal 7.x duplicate file js ?? Why?

I don't know beacuse drupal duplicate one of my javascript files... So: I had added file "Intro.js" with template.php. I wrote: if(drupal_is_front_page()){ drupal_add_js(path_to_theme() . ...
1
vote
1answer
20 views

How do I load all images and thumbnail for a multivalued image field in node view?

I have a content type with a multivalued image field. I want to make the image field render with one main image and all the thumbnail. When any of the thumbnail is clicked then it's respective image ...
0
votes
0answers
24 views

Using EmberJS as a FrontEnd to Drupal

I am just starting to learn more and more about Headless Drupal, and have developed an interest in combining it with an MVC framework like EmberJS. I've only found one good talk on the subject, but ...
0
votes
1answer
25 views

Firing ajax_callback on textfield after a minimum number of character

Ive created a textfield with an ajax callback with 'keyup' event. In need the callback function to be fired only after a certain number of character ... I can control the number of character of the ...
0
votes
1answer
31 views

Drupal Form Button + “Are you sure”-Button

I am trying to add an own JS function to a Drupal Core Form - think Config, Development, Clean Cache. This function basically just asks if the user is sure. Here is what I have so far: ...
0
votes
0answers
20 views

“Reset” all flag

I'm working on a site that uses the flags module. each user needs to be able to "reset", or "clear" all the flags they have set with a single button. The button is displayed from a content block that ...
0
votes
0answers
17 views

Enter key act as Tab key on Textbox in Drupal theme

I am using drupal a Content Type as data entry that contains more than 25 Textboxs. How can I make enter key act as Tab key on Textbox in my drupal theme? I tried a lot of codes like this: ...
0
votes
2answers
170 views

Javascript: Drupal.media is undefined

When I try to upload an image through anything other than the admin/content/media interface, I get an "Drupal.media is undefined" error. Uploading an image through the interface does work. Using the ...
0
votes
1answer
19 views

Turning View into flashcard

I am working on a requirement to display a 2 column (question and answer ) view into flashcard . question should appear on front and on flipping the answer should appear . I am not sure whether such ...
2
votes
1answer
111 views

jQuery events are lost after form reload

First I thought that this would not be a Drupal specific problem, but jQuery specific solutions didn't solved it. I hope you have some advices. I have a form with lots of fieldsets. To find the right ...
0
votes
1answer
40 views

Javascript added via drupal_add_js() does not get aggregated

I have a couple custom modules that I add javascript via drupal_add_js(). I have all the Bandwidth Optimizations options checked in the performance page (/admin/config/development/performance). Since ...
-2
votes
1answer
40 views

Problem with custom scrollbar when it is called more than once on the same page

I making my custom module that works through Views and I have problem with one part of it. In one part, when I have longer text, custom scrollbar appears, and it works without any problems, but when I ...
0
votes
1answer
72 views

CSS not working after Commerce AJAX processed on field

I have got a problem with css after Drupal processes radio buttons on Drupal Commerce product page. Radio buttons are formatted (images instead of typical radio) Formatted radios After clicking ...
0
votes
1answer
30 views

a little javascript help [closed]

I'm trying to pass some basic tracking information into a javascript snippet. this is the example they provide. woopra.identify({ email: "johndoe@mybusiness.com", name: "John Doe", ...
-1
votes
1answer
27 views

Javascript closures in modules [closed]

I am trying to adapt some code I have written in javascript outside Drupal to a Drupal module: (function($) { Drupal.behaviors.myModule = { ...
0
votes
2answers
316 views

How to get a list of all javascript files in a directory

Is it possible to get a list of all the javascript files in the libraries directory? So far I have tried using files_scan directory but it's not returning anything: $dir = base_path() . ...
4
votes
1answer
124 views

Sending client to channel messages with nodejs integration

I've been struggling with this for some weeks now and so far I have not found a proper solution yet. I guess this is a bug, but since there is no response on nodejs issue queue I'd like to ask this ...
0
votes
2answers
28 views

Safety of letting user define javascript paths in fields

I have a module that uses the Fields API to insert a HTML5 canvas element and allows users to define paths to user scripts to be loaded with the page: The scripts are relative to a hard-coded path ...
4
votes
1answer
96 views

How to pass Javascript variable with form on submit?

I want to pass a variable created with Javascript to $form_state so that I can use this variable in the form_submit function. In an ajaxified form I can use: ...
0
votes
0answers
27 views

Sending information from JS to Module File

In one of my webpage I print one button multiple times and all have different logId. I want that when user click then there will JQuery into the picture and there should be no server side post-back. ...