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.

CommentFileSizeAuthor
#1 comment_js_style.patch812 bytesChrisKennedy
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ChrisKennedy’s picture

Title: Javascript issues » Undefined variable warning in comment.js
FileSize
812 bytes

Here's a patch.

Jody Lynn’s picture

Version: 6.10 » 6.x-dev

Status: Needs review » Needs work

The last submitted patch, comment_js_style.patch, failed testing.

Status: Needs work » Closed (outdated)

Automatically closed because Drupal 6 is no longer supported. If the issue verifiably applies to later versions, please reopen with details and update the version.