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
votes
0answers
12 views

Access to user data fields from javascript [on hold]

I created html+javascript game. I want users to access their achievements from any device. To implement this feature I need a CMS that has such features: users accounts ability to add custom data ...
0
votes
0answers
12 views

How to use tabledrag within multiple tables

I have a form that has three groups of elements which are presented via tabledrag form element. I would like to be able to move the rows between the tables, so not just within a single table as ...
0
votes
1answer
31 views

How to animate set of titles of a View using JQuery [on hold]

There is a View of latest news title linked to the node page and I need to display them like this Effect. How do I can do this?
0
votes
0answers
7 views

Does Organic Groups [OG] expose any information in the JavaScript object? Can I use that information to overpopulate a form?

With the help of Advanced Form Block, Automatic Nodetitles, and [Views Autorefresh, I've embedded an node add form into a block which in turn is embedded to an OG's page. I'd like to automatically ...
2
votes
2answers
51 views

Why are the CSS files in my .info not applied (scripts work fine)?

I have a list of CSS files from a premade theme called artifical reason they are listed in my .info file as such stylesheets[all][] = assets/css/style.css stylesheets[all][] = assets/css/preload.css ...
0
votes
2answers
25 views

How to conditionally load javascript file on view page

I'm trying to load some theme javascript only to one view(multiple displays). I've tried to use the views preprocessor funciton, but maybe I'm doing it wrong: function ...
0
votes
2answers
21 views

Translate string in javascript

There is a string which gets displayed in the mobile menu. var arrowimages = { down: 'downarrowclass', right: 'rightarrowclass' }, $mainNav = $('#navigation'), $mainList = $mainNav.find('ul').eq(0), ...
0
votes
1answer
25 views

Add JavaScript to a page without access to core files?

I apologize in advance if this is a really simple question, but I'm pretty new to Drupal and still figuring out my way around things. So I was wondering if it is possible to add JS to a certain node ...
0
votes
0answers
7 views

Static Leaflet Labels on Leaflet Maps in Drupal 7

I'm using the leaflet label module which creates labels on markers and polygons upon mouse hover. This module uses the leaflet library found on github. I'd like my labels static so they load when the ...
1
vote
1answer
11 views

Is there an easy way to include a Facebook remarketing tag in my D7 site?

Adding Google Remarketing Script tags to Drupal 7 website shows how to add a Google remarketing tag using a module. Is there a similar solution for adding a Facebook remarketing tag easily? I would ...
0
votes
0answers
19 views

Drupal alter some javascript of contrib module?

I am working on a project that implements the Drupalchat module. Everything works perfectly, but the client requests some custom changes. They want people to be unable to have private conversations ...
-1
votes
1answer
31 views

Where to add Drupal.t function in a javascript [closed]

Hi I have a string in a string that needs to be translated. What needs to be added to this line to get it done? $(language).find('.content').append("<div class='voice-next-step'>Next ...
0
votes
0answers
5 views

Leaflet Map disappears when selecting term in views exposed filter

I'm using leaflet in a content view with a page having an exposed filter on taxonomy terms. Problem is whenever a term/filter is selected and applied the map disappears and turns grey. I'm using ...
0
votes
1answer
7 views

Leaflet - Possible to go straight to node instead of popup on click?

I'm using the leaflet module in drupal and would like the user to go directly to the node instead of a popup when clicking upon a marker or polygon. Is there a way to do this?
0
votes
1answer
37 views

Calling Jquery function from link onClick attribute

I'm trying to call a jQuery function from a link's onClick attribute but I get the following error: Uncaught TypeError: Drupal.behaviors.main.test is not a function. I created a simple module that ...
0
votes
1answer
19 views

Remove inline JS from specific page type?

This is an answer how to unset js from specific page types: http://stackoverflow.com/questions/10138660/how-to-remove-css-and-js-from-a-certain-content-type-in-drupal-7 And I've made it for Syntax ...
0
votes
0answers
13 views

How to avoid Onclick event returning old output along with new output

Using db_select got the data(path to csv file) from database, bind it to table(themes) and returned table as output. Each row in the table as hyperlink named "Plot" as shown below. When user clicks ...
0
votes
0answers
4 views

Solid Black Polygons in Openlayers - How to change color and opacity?

I'm using the openlayers module for a map in Drupal. When I draw polygons on the map they appear as solid black. How can I change these to a color with opacity? I'm guessing this is changed at the ...
1
vote
0answers
28 views

Reorder Javascript loading in theme?

Some modules insert JavaScript in top of list. I put my $sctipts variable in the bottom of html.tpl.php file befory body closed. So this become some scripts do not work cause the declared before ...
0
votes
0answers
40 views

Justified-Gallery in Drupal 7

I am trying to implement Justified-Gallery: http://miromannino.github.io/Justified-Gallery/ in my Drupal 7 website. I linked justifiedGallery.min.css and jquery.justifiedGallery.min.js. The thumbs ...
0
votes
1answer
15 views

ReferenceError: Progress is not defined [closed]

i got this error form my custom module , here is my little code in progress-bar.tpl.php: <body> <!-- Static navbar --> <div class="navbar navbar-inverse"> <div ...
1
vote
2answers
15 views

Add conditional javascript from CDN (external library)

I know it has been discussed here several times, but: Is there a way to include conditional JS from CDN in the head section? My goal is to somehow use drupal_add_js, external. That will stick in the ...
0
votes
1answer
14 views

How can I remove javascript from everywhere but the front page?

I tried using this in template.php function MYTHEME_js_alter(&$javascript) { if ($!is_front) { unset($javascript['path/to/script.js']); } } but it doesn't work. Performance wise, would ...
0
votes
0answers
17 views

Script injected into varibale table?

In search for delays in page rendering have noticed some "script" that seems to be injected to rendered templates, and caused a lot of delays: ...
0
votes
0answers
8 views

I have a problem with LazyLoader script tag that is placed before jquery?

LazyLoader gives the error on my page in FireBug and does not work. My variable $scripts in my theme is before as google page insight recommends. but lazyloader paste the firstest script that does ...
1
vote
0answers
15 views

Warn user before leaving web page with unsaved changes [duplicate]

I have some pages with forms in my application. How can I secure the form in such a way that if someone navigates away or closes the browser tab, they should be prompted to to confirm they really ...
0
votes
1answer
15 views

How can I make web scraping of a field more difficult?

I have a text field that I get with <?php print render ($content['field'][0]['#markup']); ?> in node.tpl. I'd like to somehow make loading the markup require a click, and deselecting it to put ...
0
votes
0answers
13 views

WYSIWYG CKeditor ignore height (rows) when displayed into vertical tab

When CKeditor (I use the WYSIWYG module) is included into vertical tab (not the firstly visible tab) the height size is calculated from the container (tab) and ignore the rows attributes from the ...
2
votes
2answers
212 views

How to add JavaScript code to a webform?

I want to add JavaScript code to a webform. For example, to add things like onclick, onchange, mouseover function to webform's textbox, textarea, select, email, etc. How do I do so?
0
votes
2answers
53 views

How to call a javascript function?

I have included in my theme a new javascript library(Easy-Responsive-Tabs-to-Accordion) which converts horizontal tabs to accordion. So I have included in my .info theme scripts[] = ...
0
votes
0answers
19 views

Drupal absolutely refuses to serve gzip css and js files, however they are produced just fine. What could be causing this?

What I have tried so far: All variations of modifications and additions to .htaccess gzip relevant sections near the bottom. The Advanced CSS/JS Aggregation module, and all suggested configurations ...
1
vote
1answer
21 views

How to access global variable from within Drupal content

I am trying to access a global variable I created using javascript within a content node i created. In an attached js file i have var rootpath = "/clients/UMP/"; Inside of my drupal page i have: ...
0
votes
0answers
42 views

How to change url of views exposed filter, where will be send a request

I need to change a request in javascript of views exposed filter. I want send value clean url arguments in the exposed filter. I have a part of code but it doesnt work. Will be gratefull for the ...
1
vote
1answer
46 views

how to have conditional Help text for a listbox field [closed]

Remember the create password page of Drupal! While you are entering characters it tells you how strong your password is! Now I want to have something like this in a list box but a bit different. I ...
0
votes
0answers
11 views

#states not detecting a change to form via ajax_command_invoke

I have a form. On an elements I have an ajax call back. In the callback I use the commands[] to update some elements on the screen. One of the elements I update is used by another form element using ...
0
votes
1answer
15 views

Where to place JS code to be used by Admin? [closed]

I have a simple requirement that I want to implement JS on couple of fields. Through JS, I want to hide few fields by default and show them when a checkbox is clicked. The problem is where to keep ...
0
votes
1answer
33 views

Can I attach a javascript function to a Drupal.behaviors javascript function?

I want to trigger another function any time Drupal.behaviors.MultiPage (found in field_group/multipage) changes page. It's part of this code: Drupal.behaviors.MultiPage = { attach: function ...
0
votes
0answers
10 views

How to add KnockoutJS to Drupal forms?

Does anyone have experience on adding front-end framework to Drupal? From my experience I see few problems FAPI and field/input attributes for KoJS dynamically added inputs: fapi doesn't allow ...
0
votes
1answer
41 views

Creating an iframe playlist that loops through urls (from a node field)

Scenario A content type called "Playlist" exists. Playlist has a text field: field_playlist_sources. When a user creates the Playlist they can add multiple values for field_playlist_sources. Each ...
0
votes
1answer
22 views

Override alter.inc in child theme

Bootstrap.js is breaking a menu plugin I'm using. It's called with this $bootstrap = $theme_path . '/js/bootstrap.js'; $js[$bootstrap] = drupal_js_defaults($bootstrap); $js[$bootstrap]['group'] ...
0
votes
1answer
54 views

Suddenly I can't use the “Media” file uploader in Full HTML CKeditor edit screen but can do in Filtered HTML edit screen

I Use D7, CKeditor v 1.16.7 and Media v 1.5.7, all other modules are up2date and the site itself works fine. I don't recall any special change at the site that would avoid this module of working, yet ...
0
votes
1answer
14 views

Load a Module versus JavaScript embedded in Theme

I am new to theming Drupal and I am trying to create a responsive website based on Bootstrap with an image slider at the top. I know that there are modules like Views Slideshow and FlexSlider. ...
0
votes
2answers
65 views

How to add a checkbox to a Content Type and act if box is set to true or yes

Module name, 'text_grabber' Content Type, 'node' name 'essay' **When I enable this module, I want a checkbox to be added to the ~/node/add/essay page. So when an user adds a new essay to the site ...
0
votes
0answers
34 views

Plugin still uses the old version of Jquery even after hook_js_alter

I have drupal-7.34 installed and Im using Jquery Update 7.x-2.5 to make my plugins work. Everything is working fine until I had use a plugin which needs a more recent version of Jquery(jquery ...
0
votes
2answers
42 views

Call a Javascript Function and Update my Form Element at the same time

This is my ajax callback function function myid_search_idnumber($form, $form_state) { return $form['id']; } It updates the values in $form['id']. But Because I wanted to call a javascript ...
0
votes
1answer
80 views

In custom module - No such file or directory in drupal_build_js_cache() (line 5008 of /mnt/www/html/xyzexample/docroot/includes/common.inc)

I am newbie and working on Drupal-7. I have created custom block module called 'mycampaign' to add script to Retargeting Tags into each page. Script: <script async ...
0
votes
0answers
17 views

Alter js in Some Certain Conditions

I am using hook_js_alter to use a newer version of Jquery. function myid_js_alter(&$javascript) { // Swap out jQuery to use an updated version of the library. ...
0
votes
1answer
46 views

How to add Retargeting tag into each page?

I am using drupal - 7. I wanted to embed <script> tags for Retargeting tag into each page of the Website, between the <body> </body> tags. I am new to Drupal. I am trying to ...
0
votes
1answer
25 views

How to find if file was successfully uploaded to webform

I am using the file field in webform, I would like to check if the file was successfully uploaded. I was using .onChange But that only means that a file was attempted to be uploaded. How can I ...
0
votes
0answers
38 views

How to position javascript file as the last one to load?

In Drupal 8 the weight for javascript files in libraries is not supported, or at least only negative values are allowed, which means I am only able to position them at the top of the list (i.e. load ...