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

learn more… | top users | synonyms

1
vote
1answer
20 views

How to pass node ID argument to Drupal 7 div auto update ajax script

I've implemented the code on http://stackoverflow.com/questions/8144436/refreshing-a-div-in-drupal to get a Drupal 7 node page division auto-updated. Here is the code outputting simple time() ...
0
votes
0answers
22 views

JS: Handling click event on element created by another module's JS

I've got two modules, one of which handles a button which makes all menus retract from sight, and another which handles a cycling background gallery. I'd like to switch from a "blurred" to a regular ...
0
votes
1answer
11 views

How do I find out what added code to the $closure of my theme?

I have code in the $closure variable of my theme and I don't know what added it to the theme.
0
votes
1answer
26 views

Why Cant add a class to an element by jquery

In the page.tpl.php I have some elements like <div class="play"></div> I have linked js file to the page and it is correctly works since all functions operate based on click ...
-1
votes
0answers
10 views

Drupal 7 and Adobe Edge Animate

I have an ecommerce store im in the process of building using drupal commerce. One product type needs to be customizable. It will be a shirt that can be customized with what i think is the best ...
0
votes
0answers
18 views

fivestar module js breaking my custom js

My problem is when I use five star module on any page my js gets break on that particular page. I don't know what I am doing wrong
3
votes
1answer
71 views

Using Grunt.js with Drupal [closed]

I'm in need of an organization system for my JavaScript code Drupal. Currently, I've got it inside a folder in my theme's directory: "sites/all/themes/mytheme/js". I've looked at using Grunt.js, and ...
0
votes
2answers
35 views

Want to show/hide multiple divs based on dropdown box selection

I've tried looking around and there are similar problems, but mine is way more simple, but yet, I can't find a solution within these forums. This is the dropdown markup. <select id ...
1
vote
2answers
24 views

Javascript works inline in webform but not as standalone

I have a javascript that works if I place it in a mark up in my webform but breaks the form if I make the form a multipage. If I place the script as it's own file and then call it using ...
0
votes
2answers
48 views

javascript does not work after form load through ajax

I am using field collection module for showing some fields with add more option using ajax built in functionality of field collections. in my field collection I have added some javascript on some of ...
2
votes
2answers
60 views

Drupal 7 website layout/styling breaks all a sudden (random), how to debug? there are no logs

One of my websites running Drupal 7 goes out of format, most often when user login. This is how it should be After running out of format this how it looks This may be a CSS issue, it may be a ...
-2
votes
1answer
34 views

How can I pass an array of variables from php to javascript?

I use this but cannot find solution. drupal_add_js( array('YOURMODULE' => array( 'testvar' => $testvar )), array('type' => 'setting') );
0
votes
1answer
17 views

Load .js only if block is loaded

Yes, something like that. If block and it's content are loaded in the page (so I guess detect by ID or something) it would load the .js, but if block is not loaded, it wouldn't load the .js. I need ...
0
votes
0answers
18 views

How to get the value of a content type field in Drupal and pass it to a JS file

In my Drupal theme I have a field for soundCloud URL which its machine name is (field_soundcloud_url_) I have a javascript file that will work based of the value of this variable. But it does not ...
0
votes
0answers
40 views

Inline javascript in drupal_add_js is causing WSOD

In my template.php i am executing some inline javascript code. When executing, the result is a white screen of death (WSOD). The web servers error log says: PHP Parse error: syntax error, ...
0
votes
0answers
12 views

turn js not working in colorbox but works fine on nodes pages

I have manually integrated turn.js script in my drupal 7 website which works perfectly and converting the images in a flipping book. I did that by creating a content type added a multi value image ...
1
vote
1answer
17 views

Script Not Working [closed]

I am trying to integrate 3rd party jquery plugin Turnjs 3rd edition available on github in my website. For this I have uploaded turnjs script on my server and called it in website through my ...
0
votes
2answers
39 views

drupal_add_js settings and working around the anonymous page cache

What I'm trying to do is allow registered users to configure a few colors on public facing pages (profiles, etc.) and to do so I'm using the ColorField module and a few theme functions. My problem is ...
1
vote
2answers
22 views

Uncaught TypeError: Only on Drupal edit pages

I'm using the BigSlide.js sliding menu on my drupal site, which i've built into the theme, and it works fine on every page, apart from on /edit/ pages. E.g. user/%/edit. When clicking the target menu ...
0
votes
0answers
20 views

Change text size on a page with callback

I must add buttons on my site to change font size by the user, an accessibility option. Additionally, after user changes the font size, my custom javascript function must be called as a callback after ...
0
votes
1answer
54 views

How to prevent newline character in textarea

I'm building a form in a module for Drupal 7 and I want to add a textarea as I would like it to be multiline so that text overflows on the next line, etc. but I don't want users to be able to create a ...
1
vote
1answer
125 views

How to attach Dropzone.js uploads to a form element

I'm integrating dropzone.js into my form, but I have an issue regarding my file uploads. I have my dropzone set up, and file uploads are in the $_FILES array. I want to call file_save_upload to ...
0
votes
0answers
12 views

Loading resources(CSS, JS, layout images) for multi-site from same path

I am working on a website with more that 500 subdomains. All the subdomain have same code and different databases. The problem I am facing right now is that whenever I add any CSS change, I have to ...
0
votes
1answer
26 views

My website suddenly started giving Error 200 on anything AJAX related!

The other day my website suddenly started acting weird. When using the Flag module to flag content, i get a 200 error! The content does get flagged once i refresh the page, but when clicking the flag ...
0
votes
0answers
21 views

hook_js_alter not being called

I find this strange. My module seems to be named correctly but the module will not be called. The var_dumps are not on the page nor are watchdogs when I put them in. The module shorthand is ...
0
votes
1answer
19 views

javasript invoking custom module to update user response

I have created Multiple choice questions in drupal . One node (page ) has one mcq . The answers are displayed by simple radio buttons and javascript . Now I am planing to give some dynamic behavior ...
0
votes
1answer
15 views

Embedding Javascript in Content or Block Causes Misalignment of Regions / Overflow

When embedding Javascript, the content area seems to "overflow" past its container. I am pasting an example of how embedding Tweets can cause this problem. The content shouldn't be extending into the ...
-2
votes
0answers
34 views

Modules' JS is not working when site is accessed from a new folder in root

I accessed an already built site from a new folder in root directory(public_html). original url : http://letseatoutguide.com/ new url : http://letseatoutguide.com/m2/ Now my problem is all the ...
0
votes
2answers
35 views

How to integrate JS / CSS only on specified Pages / custom content types

I would like embed my module JS / CSS files only in specified cases. Like on a /url/ or if a custom content type is rendered?
0
votes
1answer
26 views

How can I extend a module and it's library with custom functionality?

My client requested a modification to their slider that will enable two captions. I'm using the Views Nivo Slider module and believe I can accomplish what I want by modifying the module"s code and ...
0
votes
2answers
38 views

Views fields configuration is not working

I set a few fields as FIELDS section of a view. the problem is when I click on the fields the Style settings ,No results behavior , Rewrite results and More links are not collapsible . this is the ...
0
votes
0answers
19 views

add javascript event to view

I have no well enough experience in themeing with view, It is also the first project I used view. In this page, I would like to add javascript event to qq under category_page. When clicks qq I want ...
0
votes
1answer
22 views

Saving a value from Javascript on Drupal form submit

I have a jQuery map that I've built that allows users to select states and counties. This is all done in Javascript. I would like to, on form submit, take this data and submit it to the user's ...
0
votes
2answers
33 views

Trying to send a <div> with webform

I have a Webform that does some calculations (javascript) based on user selections, which i would like to send along with the user-selectable fields to a user's email. Is it possible to append these ...
0
votes
1answer
26 views

Performance and javascript issue in a drupal 7 website

I have a drupal 7 website. Currently its performance is not good and takes much time to render the web pages. For performance, I checked out in YSlow and came up with some results like move all js ...
0
votes
1answer
28 views

Passing PHP variables to JS file initiated from theme .info file

I know it's perfectly possible to pass PHP variables to JS but what if the JS file is initiated from the theme.info file? Can you access it in template.php or? Please some advice.. Thanks!
0
votes
1answer
37 views

Ajax callback called on textfield typing

I'm trying to reach exactly the same state as autocomplete field does. When user is typing in textfield I'd like ajax to wait with its callback so the user can write all the text. I'm trying to ...
0
votes
1answer
32 views

How can I load content on the same page from a search

So the idea is to load the results of the search on the same page. I was told to look into SOLR, but it looks like we have something similar to SOLR , and we just need to know how to load new page ...
0
votes
0answers
44 views

CKEditor placeholder text doesn't work (config.js)

I'm trying to add placeholder text to my ckeditor screen like for example Type here ... . You can do this with the configuration helper plugin. I've placed the ckeditor library in sites/all/libries. ...
0
votes
1answer
20 views

JQuery Mobile.js for drupal 7

I'm attempting to add the functionality of jQuery's Mobile.js to allow for the vclick event. I already have a website in place. What would be the easiest way to add this functionality for an admin ...
0
votes
0answers
71 views

How to display informations from a view with Gmap in an other block, on marker click?

I'm using Drupal 7.3 & Gmap 7.x-2.9 I've created a view (a page, with a path) that displays markers on a Gmap (Using Exended Gmap Format). I would like to be able to use this markers to do ...
0
votes
1answer
29 views

How to execute jQuery on body elements?

I'm screwing around with jQuery for the first time, and I'm unsure of where to add a call in Drupal to allow it to alter classes of elements within the body tag. I'm looking at utilizing something ...
1
vote
1answer
66 views

Apply CSS and Javascript affect to images [closed]

Updated I am trying to add CSS and Javascript hover affect to some images in drupal 7 .. something like in this tutorial. http://callmenick.com/2014/03/06/image-overlay-hover-effects-with-css3-t ... ...
0
votes
0answers
24 views

drupal_add_js doesn't 'stick' outside of hook_js_alter and hook_page_alter

Putting together a module that needs to insert javascript into each based on the contents of the page being viewed. The following code block works fine in hook_js_alter and hook_age_alter: ...
0
votes
1answer
16 views

the javascript for dragging and dropping not loading - drupal 7

for some reason when I add new modules the tabledrag.js is not loading. Tried taking the modules out, clearing cache several times. Aggregated js as well. Can anyone help.
1
vote
2answers
82 views

Problems adding javascript to a specific page

Drupal Version: 6.x Currently, I have a custom module created. In my template, I keep html code that I would like to embed within a container, such as a div, with a particular id. For this question, ...
0
votes
1answer
33 views

Can the jQuery global $ be protected from external Javascript?

I'm working on a Drupal 6 site that uses the Regpacks signup form service, and apparently the iFrame it creates includes Javascript that redefines the $ global as a function. So any Javascript on the ...
0
votes
2answers
26 views

Javascript amateur's problem [closed]

I have a function: jQuery(function($){ $(document).ready(function(){ $('.Testimonials').each(function(){ var theContent = $(this).html(); theContent = '-' + ...
0
votes
1answer
61 views

How to get a scrolling background image using CSS or Java Script within Drupals folder structure

I Found a site with a cool Background function. It scrolls like a slide show. Here is the example: EXAMPLE I am trying to figure out how to do this within Drupal. I have found a bunch of tutorials ...
0
votes
0answers
12 views

print commerce line items separately from order

I want to print a receipt for each line item in an order either as the order is saved. Think of each line item as a ticket and instead of printing a receipt for the order containing information about ...