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
0answers
3 views

Drupal form #ajax callback and javascript toggleClass on radio buttons - reduced functionality

we're using drupal and I have setup an ajax callback on a form item. The form item is a radio button with two options on/off. also attached to the radio button is some js to toggle a class. The class ...
-1
votes
1answer
22 views

How to integrate addthis into drupal?

I want to use addthis (www.addthis.com) in a drupal website. So the following should be added to the body of the website. <script type="text/javascript" ...
0
votes
0answers
13 views

file_create_url() equivalent in a javascript file?

I am dynamically loading a script using $.getScript() which works fine, but when using the CDN module it comes from the webserver, instead of the CDN. Is there a way to get the correct CDN path in JS, ...
0
votes
1answer
28 views

Using jquery-match-height to set two blocks to equal height

I'm new to jquery and adding it to Drupal. I'm trying however to add this library to my Drupal site so I can set two of the blocks on my home page to equal heights. But it's not working and I'm not ...
0
votes
1answer
16 views

Leaflet library not avaliable even though it's in sites/all/libraries

I've seen people talking about hook_library() etc., but I'm not creating a custom module, I'm trying to use Leaflet. In the browser I get the error message: L is not defined From leaflet.drupal.js ...
1
vote
0answers
11 views

Drupal.ajax.keypressResponse Error

I've been using the code below, that can be found in the link: (function ($) { Drupal.ajax.prototype.keypressResponse = function (element, event) { var ajax = this; ...
0
votes
1answer
26 views

Callback Function not called using Ajax

Below is my code: function id_print_user_page_form() { $form = array(); $form['idnumber'] = array( '#type' => 'textfield', '#ajax' => array( ...
0
votes
0answers
13 views

Datepicker disappeared from Drupal Rooms module

I have been struggling with this for a couple of days now. I installed Drupal Rooms module (D7), everything worked just fine, but after fiddling around on the site, the datepicker functionality ...
0
votes
1answer
32 views

Parallel Execution of Javascript Function and Drupal's Default Event After Submit

I was trying to save something in my database using the following code below: function myid_user_page_form(){ $form = array(); $form['submit'] = array( '#type' => 'submit', ...
1
vote
2answers
33 views

Using PHP arrays in Javascript Drupal 7 [duplicate]

I've been stuck on this all day and I haven't been able to find an answer that solved my issue: I need to make a PHP variable available in my Javascript file. Currently I'm using a fetchMarkers.php ...
1
vote
1answer
27 views

HTML table to Drupal table

How can I translate this to drupal table? http://www.bootply.com/sXmuAJQjO4 I know how to do simple tables and the header and first row I can do also with this code: $title = '<div class="panel ...
0
votes
1answer
34 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() { ...
1
vote
0answers
59 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
100 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
18 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
18 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
17 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
14 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
32 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
16 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
59 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
38 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
41 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
35 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
59 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
30 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
51 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
32 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
103 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
25 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
41 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
17 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
115 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
89 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
25 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
31 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
47 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
38 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
44 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
61 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
37 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
41 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
33 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
27 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
68 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 ...