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

Pulling user data from external database

I have a game that utilizes mongodb to store the user information. What I am trying to do is use drupal as a community front so users can register for the game in drupal. The problem is that I don't ...
2
votes
1answer
35 views

Drupal Services 3 Login and CSRF

I'm working on a Phonegap app (JS) anndn I'm confused how to pass along the CSRF token with my requests. Would I need to call user/login.json first and then store the token? For future requests how do ...
-2
votes
0answers
30 views

Document Ready Jquery not executing [on hold]

I am trying to run a test on Drupal 7 hosted locally in MAMP with a bootstrap subtheme. I am trying to execute the following code but it doesn't work if I use $(document).ready. Can anyone spot what ...
0
votes
0answers
14 views

How to add JQuery on a Drupal 5 page [closed]

I am using Drupal 5 and I want to use the JQuery plugin to add a slideshow on my news page. How do I do this? Can I just paste some scripts on the of the page? Thanks a lot for your help!
0
votes
0answers
15 views

Views Ajax Pager not working when loading view with ajax

I have a page with a view that has a pager with ajax. the pager is working fine when the page first run. the page has a button that loads the next page using ajax, the view is loaded fine but the ...
1
vote
1answer
58 views

Drupal 8 JavaScript and Best Practice

I am building a theme for Drupal 8 that I want to make available in the drupal.org theme section. As such, I want it to conform to best practice code wise. When adding JavaScript, I notice there has ...
0
votes
1answer
19 views

Adding javascript to a view?

I have a view in Drupal 7 that displays a list of all the nodes of a content type in alphabetical order. What would be the best way to implement javascript that only displays nodes starting with a ...
-1
votes
1answer
33 views

Drupal 7 js popup [closed]

Trying to put a popup window on my drupal 7 site that hides/shows on click. Here's the popup.js file: Drupal.behaviors.my_custom_behavior = { attach: function(context, settings) { function ...
0
votes
2answers
44 views

Using Simple jQuery click() events in Drupal 7

I've been able to get jQuery to load and work for some basic things such as: (function ($) { console.log('jquery called'); $(document).click(function() { var h1 = $('h1').text(); ...
2
votes
2answers
54 views

Hide “Submit”/“Save” button until file has finished uploading

I'm having a problem where my site users are submitting a form before the files they are uploading into filefield are finished, this is causing an ajax error to pop up along the lines of "an ajax HTTP ...
-2
votes
0answers
26 views

Drupal 7: Embed external js file per page (in editor)?

I read how to embed external js files in your template, but how can you embed js files in the for a single page in the editor? I tried jQuery with getScript() but no luck. <script ...
-1
votes
2answers
39 views

Trigger highlight in maparea when mouseover on link

I've created a content type where I can load an image into a text editor and use Image Map Editor to create area to be highlighted when mouse moves over mapped region. At the same time, below the ...
1
vote
1answer
38 views

Construct the src in a javascript tag from node fields

I have a drupal 7 instance where I would like to create nodes that call reports from a separate site using javascript. Currently I construct the HTML tags myself which look something like this: ...
0
votes
3answers
38 views

How to make single page website in Drupal

[single_page_website][1] The single page website module works for bartik and zen themes. How about other themes? How to make single page in Drupal 7 website generally?
1
vote
0answers
23 views

Dropping host part of the url when loading resources

I have a particular problem with the site here. It's a b2b site and it has a word 'advertise' in the domain name. When Drupal loads resources (css/js) it refers to the full url, including that domain ...
0
votes
1answer
25 views

Custom Validation on Address Field

In addition to the validation that already takes place using the addressfield module, I'd like to check for (and fix) items like: Building to Bldg Room to Rm Circle to Cir Avenue to Ave Is there ...
1
vote
4answers
71 views

Hide/Show a DIV

In node.tpl.php, I have: <a href="#" id="hideshow">Show </a> <div id="comments" style="width: 300px; border" 1px solid #777; padding:10px;> Some ...
0
votes
1answer
16 views

browscap.ini is not configured in php.ini

In my status report I'm still getting this error: Browscap data / browscap.ini is not configured in php.ini. When I searched on the internet I found this topic that suggested this: [browscap] ...
0
votes
0answers
13 views

Trigger the 'add more' button with javascript, to add a set amount of field values

Is there any way to add a certain amount of field values to a standard node add/edit form (when unlimited option has been chosen) using a select input? At the moment I have this working using ...
0
votes
1answer
30 views

Field Collection Major Error! Help Needed!

Here what my screen looks like when I try to add new field collection item. http://i58.tinypic.com/hrf11d.jpg Then I got this message in Chrome when going back to the previous page in browser: ...
0
votes
0answers
13 views

leaflet behavior with js injector

I want to manipulate Leaflet behavior based on user events. I am using JS injector for a View in drupal 7. Something very simple like... (function ($) { Drupal.behaviors.leaflet= { ...
-1
votes
1answer
22 views

Link static HTML, Javascript and CSS3 in a Drupal Site

I am trying to have collaborative development of a HTML5 web app which people could navigate too through my drupal site. I was planning on putting the html, JS and CSS3 files in my sites/default/files ...
0
votes
0answers
20 views

Problem with Views accordion if using multiple accordions on same page

I'm using the views accordion module and it's working really well on this D7 site. However, a client has now requested that two different lists are displayed on one page. I've set them both to be ...
0
votes
0answers
13 views

How and where does drupal call Drupal.behaviors.password attach method?

I am experiencing a bug in my setup. The symptom is, that the translate variable in Drupal.behaviors.password in core module user/user.js populated from the passed in settings (settings.password) is ...
0
votes
2answers
22 views

Create a script page for handling ajax

I am a bit confused on the appropriate way to generate a drupal page for handling ajax posts. For example I'm creating a custom module that has favorites buttons. When a user clicks the button the ...
0
votes
1answer
29 views

Add html code to a content block

I need to insert an html code into a content block. As the html code has some javascript links and css, I've done a module to include all the references in the .info file. The problem is that I don't ...
0
votes
1answer
39 views

Colorbox Iframe Resizing

I am trying to resize an colorbox containing an iframe. The following code works fine on normal sites but in Drupal it is having problems. Can anyone suggest what I am doing wrong? The colorbox is ...
0
votes
0answers
12 views

Gallery formatter Issues: Scrollbar but no green arrows in thumbnail div

When using Gallery Formatter, I don't see the green arrows. There is just a hideous grey bar. I tried using the jQuery updater module, but this didn't seem to work. (I tried 1.9 and 1.5 and 1.1) I get ...
0
votes
0answers
41 views

How to add a custom javascript code in a Drupal BLOCK

The title says it all. I want to add a series of advertising javascript code like adsense, facebook likebox javascript code. How can I add a javascript code as a block and put it on sidebar first. ...
0
votes
0answers
17 views

Need to know the most essential JS and CSS files for a Druapl 7 page

I am creating a module that has a page that is intended to be a viewer for a certain kind of content. The content itself is a Drupal Book viewer meant to behave like an epub reader. Basically I want ...
0
votes
0answers
34 views

my css and javascript files do not load and do not work?

my uploaded drupal7 website worked correctly for 2 days.but suddenly when i refresh it,every things go wrong. site loads with no css and no java,and no pictures. it said that the css (and js) files ...
1
vote
1answer
34 views

Dynamic arguments in an AJAX link

I have a link that uses Drupal's use-ajax CSS class to AJAX-load some node teasers. The callback for the link uses arguments to set a range in the Entity Field Query used to return the teasers: ...
0
votes
1answer
41 views

Need help with Drupal javascript behaviors

I'm a bit lost with this and could do with some help from a Drupal JS veteran. In my module I'm dynamically generating a settings form based on a CSS file, part of which provides a font select list ...
1
vote
1answer
68 views

Term reference with radio buttons + bootstrap tooltip

In the details of a user I have a term reference that is presented as radio buttons. You can select one radiobutton. The html looks like this: <div id="edit-field-abonnement-und" ...
2
votes
0answers
29 views

Drupal Create Form with Javascript? [closed]

I am wondering if there is a way to create a Drupal form on the fly with javascript? I know I can create a form, but how could I create all the Drupal hidden fields and other required pieces? Or if ...
0
votes
0answers
12 views

Is it possible to respond to other module's ajax events?

We are rendering a Google Map inside a Fieldable Panels Pane. After the pane is placed using the In Place Editor, the editor closes and the pane content is rendered with ajax. However, the map is not ...
0
votes
1answer
69 views

FullCalendar links open a new tab, don't want that

I have D7 with FullCalendar (7.x-2.0) installed. When viewing a month view and clicking on an event, the event opens in a whole new browser tab (no matter what browser I'm using). I don't want that, ...
0
votes
3answers
95 views

How to get drupal module path in javascript?

I'm trying to use this: var path = Drupal.settings.mymodule.basePath;but I'm getting this error: Uncaught TypeError: Cannot read property 'basePath' of undefined.
1
vote
0answers
39 views

How do I add onclick Google Analtyics custom event “add to cart” to add to cart button in Drupal Commerce?

I want to fire a Google Analytics custom event called "add to cart" when someone adds a product to the cart. I am using classic Google Analytics, not Universal. I tried adding this to the ...
0
votes
0answers
25 views

Implement vw, vh & vmin polyfill into drupal site

I'm trying to implement a polyfill into my drupal 7 site to give support to older browsers for vw units. The problem is that I don't really know what files are needed or where they need to go, as I've ...
1
vote
1answer
53 views

Injected javascript in google DFP module drupal 7

Currently I am setting up the Google DFP module and I have been trying to work out how the JavaScript is working. In the module there is a section for injecting JavaScript which is what Google DFP ...
0
votes
0answers
18 views

Overlay is throwing a JS error causing several Problems

I've been experiencing an odd problem lately with the Overlay Module (See Image). It's throwing errors on admin pages and causing CKeditor and other things like the Module Filter Module not to work. ...
0
votes
3answers
301 views

Execute jquery function if Ajax callback form complete

I got a custom ajax callback which replaces my checkbox options based on the select option. Now after the checkboxlist get's updated i need to execute a jquery function on those checkboxes. How can ...
0
votes
3answers
68 views

create a downloadable file after submit webform

Hello Im not sure if this can be done, but Im trying to make a simple app where you create your own lexical analyzer. So in the webform I ask the necessary information, then I need the following: ...
0
votes
1answer
24 views

Conditional loading of admin? (When using a JavaScript router)

I am writing a Single Page Frontend to a Drupal backend using AngularJS. It is basically a module that bootstraps the Single Page Application. HOWEVER, because the application takes control over the ...
0
votes
2answers
49 views

Properly building array and using with drupal_json_encode()?

I am trying to pass data from my database to a javascript variable, however I'm not sure if I'm correctly using drupal_json_encode(), or correctly building my 2D array. When I check my console, the ...
0
votes
1answer
64 views

drupal_add_js and variables into anonymous functions, objects undefined?

Pulling my hair out. Read a lot of stuff about scopechain and closure to tackle this one myself. And as i understand at some level, i can't get this to work. I wrote a module for likebuttons (like ...
0
votes
1answer
45 views

Drupal Add Javascript type=text/javascript

I am trying to add javascript to my page and use type="text/javascript" however when I include the following it just encloses it in script tags. How can I fix this? Also, how can I add the ...
1
vote
1answer
14 views

Drupal Webform Customization

I'm using drupal 7, and I'm having a lot of trouble using the webforms. I have a set of radio buttons, but each radio button needs to have an associated input field with it. Code example: <input ...
-3
votes
1answer
39 views

Change value input field according to other fields

I have 10 input fields when you create a product (= node). I have an input field amount, price & reduction and sell price. So when the field amount, price & reduction are filled in I want to ...