0
votes
0answers
25 views

Addng Javascript files

Another question for you guys. Let me first explain that I am adding javascript files the way I think they are supposed to be added, by putting them in my template file using drupal_add_js. However, a ...
1
vote
4answers
50 views

How to get jquery working on Drupal 7 - for Newbies

I have been reading many tutorials online on how to get jquery working on drupal 7. Although there are many lines of code and examples, what i cannot find is what piece of code to put where (maybe it ...
0
votes
2answers
75 views

Javascript cost calculator

I used JavaScript to construct my calculator, and I'm wondering how to get it to work. I've tried drupal_add_js(), but it didn't work. I've tried two different modules that incorporate JavaScript, ...
0
votes
1answer
69 views

Having trouble adding a custom js file to my Drupal 7 site

I added a javascript file to my site in the theme's .info file scripts[] = js/myjs.js The js file loads and I can see that it's included in the head when I load the site, however the jQuery ...
0
votes
0answers
20 views

Calculations in a custom content type that display in saved content

Drupal 6.28, custom content type. I need to have users select numbers (possibly with attached text, e.g., 3 - meets expectations, 3.5 - exceeds some expectations) from two or three select lists (how ...
1
vote
3answers
129 views

Add Google Analytics JS file to every page

We use Google Analytics on each of our sites for our own reporting. We have implemented GA using the Google Analytics module, and everything works as expected. However, I'm also part of a large ...
3
votes
1answer
118 views

Is there advantage to using Drupal.settings, as opposed to directly passing json-encoded var to javascript function

Inside my custom views template, views-view-myview.tpl.php, I have a variable ("$myvar"), which I need to pass to a custom javascript function. Here is how I am currently doing it: A. json-encode ...
1
vote
0answers
58 views

Why won't JS fire on ubercart checkout page and how do I fix?

I need some custom JS (jQuery to be precise) to run on ubercart's /cart/checkout page. I turned off JS optimization and tried adding it to several different files that are already loading and the JS ...
1
vote
1answer
1k views

Adding jQuery to Drupal 7 site: drupal_add_js() adds but doesn't call?

I'm using jQuery accordion effects to display some information. I include the libraries: drupal_add_js('http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js', file); ...
1
vote
1answer
525 views

How is JavaScript included in Drupal 7?

My site is built on Drupal 7, and a number of my .js scripts are throwing this exception: Uncaught TypeError: Property '$' of object [object Window] is not a function. After some research, I think ...
0
votes
2answers
366 views

drupal_add_js causes blocks to be executed twice

I added this code to template.php (in Zen subtheme): function mytheme_preprocess_page(&$vars) { if ($vars['is_front']) { drupal_add_js (libraries_get_path('jquery.cycle') . ...
1
vote
4answers
2k views

drupal_add_js in html template file

I am using a zen subtheme and I am trying to add some javascript using the drupal_add_js on a certain node. When I use the drupal_add_js from within the html--node--XX.tpl.php file, it does not work. ...
2
votes
2answers
132 views

use drupal_add_js for file outside drupal dir

I would like to add a js file thats outside my drupal installation dir, but keep it relative to that dir. mysite |-- drupal |-- dirWithJsFile |-- thisfile.js i have already tried things ...
2
votes
4answers
9k views

How to auto resize the height of an iframe with Jquery?

Any idea on how to automatically resize the height of an iframe based on its content. The iframe source is coming from different domain. Any thoughts on how to achieved it via Jquery or native JS? ...
4
votes
2answers
314 views

Weighting Javascript in .info files

Drupal 7 adds a new 'weight' option to drupal_add_js so that you can control the order in which Javascript files are added to the page. Is there any way to do this when adding Javascript in .info ...