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

Load Javascript when a particular form is loaded

I have the code below in my own drupal module(myid): myid.module file: function myid_init() { drupal_add_js(drupal_get_path("module", "myid") . "/js/myid.js"); } function myid_menu() { ...
0
votes
0answers
9 views

Is it possible to append Media's file browser to a certain node type?

I have a certain node type with a canvas on it, allowing users to draw on the node. Basic functionality such as lines are working, but I'd like to allow people to upload images to it as well. Since ...
2
votes
2answers
39 views

how to make fewer http requests

I'm use YSlow to optimize my web pages it says: This page has 34 external Javascript scripts. Try combining them into one. This page has 5 external stylesheets. Try combining them into one. but all I ...
0
votes
1answer
10 views

Drupal calendar popup - Year dropdown not showing in colorbox - Screenshot added

I am using drupal calendar pop up in colorbox.when i clicked on year its not showing year dropdown but giving js error of TypeError: m.replace is not a function Above issue is coming in Firefox only. ...
0
votes
0answers
12 views

Applying javascript to an ajax quicktab result

I have made an interface with some quite sophisticated functionality - tabs (module Quicktabs), containing views (module Views) from nested taxonomy (module views tree), containing tables which are ...
1
vote
1answer
15 views

How to create inline node-add forms using a block with content type names

The following page setup is needed: A block (at the left, see image) with links to node-add forms, which open inline (the area at the right) in the current page. The reason why the form needs to ...
0
votes
0answers
7 views

JS error(s) with Media-7.x-2.0alpha4 and CKEditor

I'm working on a production site that is using Media-7.x-2.0-unstable6, File entity-7.x-2.0-unstable6, and Wysiwyg-7.x-2.2 (with the CKEditor 3.6.3.7474 library installed). This is fine for inserting ...
0
votes
1answer
24 views

OnClick Event not Captured

I was currently developing a module(myid) in Drupal. I made a button(#myid_registrar_button) that must alert whenever it is clicked. Below is my code: myid.module file: <?php function ...
0
votes
1answer
15 views

How to add tracking scripts from external sites?

We want to use several lead tracking snippets of code on various pages. <script type="text/javascript">llfrmid=123456</script> <script type="text/javascript" ...
2
votes
1answer
41 views

Any way to alter script tag for some javascript and add custom attributes?

In order to work with Cloudflare's Rocket Loader service, certain scripts need to have their script tags updated with the cf-async="false" attribute like so: <script type="text/javascript" ...
0
votes
0answers
23 views

How to trigger ajax Form API action by js

In a custom form you can add an #ajax property, e.g. $form['some_element'] = [ '#type' => 'textfield', '#title' => 'Foo', '#ajax' => [ 'callback' => 'foo_callback', ...
0
votes
1answer
32 views

How to parse PHP variables in drupal_add_js in template.php

I'm using drupal_add_js for some inline jQuery - I need to parse some php variables in the inline jQuery, what is the correct way to do it? drupal_add_js('jQuery(document).ready(function () { ...
-1
votes
1answer
27 views

Scrolling problem

Here I have a challenge. When I am logged in in my Drupal site: NO PROBLEM WITH SCROLLING THE PAGES When I am lopgged out: I can't scrolll the page as normal. This problem only occurs with Google ...
1
vote
3answers
57 views

My .js file is not included in my site

I am working on Recruiter distribution which uses a Cloudy theme. I have tried 2 ways to add custom javascript to my site: 1)Adding jquery code to the .info file of Cloudy theme(default theme) ...
0
votes
1answer
9 views

Contrib Module JavaScript interfering with Node

If one has a contrib module that works fine in most cases, but on a specific page (say /comment/comment) you wish it NOT to appear, but the options in Config don't give you that ability...what's the ...
0
votes
0answers
24 views

Problem using two TB Mega Menus one above the other

I am using Drupal 7 with the TB Mega Menu module. I have one menu positioned below the other in the following configuration: __________________________________________ | Menu bar 1 ...
1
vote
0answers
33 views

Why am I getting undefined is not a function when using jquery?

HTML more code here... <script type="text/javascript" src="//code.jquery.com/jquery-1.10.2.min.js"></script> <script type="text/javascript" ...
0
votes
0answers
11 views

Simply hide View rows with instant JS exposed filter

Is there a module for this? IE: the view is showing all results, the exposed filter is just a select element which will hide (with javascript instantly without AJAX or page reload) all rows without ...
0
votes
1answer
27 views

invoking a block and attaching it to a specific html element

I have been having this problem for quite some time now and I don't know how to proceed. I am trying to get a block by invoking it, the simple way: $block2 = module_invoke("module", "block_view", ...
-1
votes
2answers
88 views

How to create a single page application in Drupal?

I know Drupal and now I am creating a website by Laravel framework. I know what are single page application and how better they are. I used Angular and Backbone as JavaScript framework/library to ...
0
votes
1answer
29 views

How can i disable java script in drupal themes or drupla it self?

How can I disable java script in drupal themes or globally?
0
votes
1answer
24 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
37 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
11 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
82 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
67 views

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

I'm new to Drupal and I'm trying to create a view with many filter options. Because it has a lot 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
7 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
27 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
42 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
34 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
39 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
48 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
33 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
29 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
27 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
22 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
51 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
69 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
29 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
33 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
35 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
30 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
28 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
85 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
74 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
10 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
31 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 ...