Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
In some IE browsers the code below generates a warning, due to the undefined variable i
Drupal.behaviors.comment = function (context) {
var parts = new Array("name", "homepage", "mail");
var cookie = '';
for (i=0;i<3;i++) {
Is recommended to define the variable var i=0; before assigning any value
Drupal.behaviors.comment = function (context) {
var parts = new Array("name", "homepage", "mail");
var cookie = '';
var i = 0;
for (i=0;i<3;i++) {
I've seen the same javascript issues in other modules like Outbrain.
Comment | File | Size | Author |
---|---|---|---|
#1 | comment_js_style.patch | 812 bytes | ChrisKennedy |
Comments
Comment #1
ChrisKennedy CreditAttribution: ChrisKennedy commentedHere's a patch.
Comment #2
Jody Lynn