Hi, please investigate why the drupal 6 version of jqzoom gives a script error in IE7.

Comments

tseven’s picture

The problem is the extra comma at the end of the variable definition:

$(document).ready(function(){var jqz_options = { zoomWidth: 350, zoomHeight: 340, }; $(".jqzoom").jqzoom(jqz_options);});

Notice the comma after 340, that's what ie7 doesn't like.

I've come up with a quick and dirty hack to remove the comma.

In jqzoom.module find
$option_string .= '}; ';
and place
$option_string = substr($option_string, 0, strlen($option_string)-2) . ' ';
above it.

This will cut off the ending comma, and add the space back in at the end. If I weren't in the middle of a time-sensitive project I'd rewrite the original function so the comma doesn't exist in the first place... but for now this will have to do.

selinav’s picture

Title: script errors in IE7, ok in IE8 » errors in IE
Assigned: Unassigned » selinav

Hello,

Nice module!

In IE7 and IE6, I've neither a loading message nor a box with the zoom.

I've tried to patch with you code above but when I do it, it doesn't work in all navigators.

Thanks in advance for your help

//edit ////////////////
I'm not correctly read, I've read "under" instead of "above".

/* if IE7 or IE6 *///////////////////////////////
	$var_nav = explode(' ',$_SERVER['HTTP_USER_AGENT']);
	$var_nav = $var_nav[0];
	
	if (ereg("MSIE 7", $_SERVER["HTTP_USER_AGENT"]) || ereg("MSIE 6", $_SERVER["HTTP_USER_AGENT"]) ) {
    	$option_string = substr($option_string, 0, strlen($option_string)-2) . ' ';
	} 
	///////////////////////////////////////////////////////////////////////////
	
mandclu’s picture

I also had the issue with errors thrown by IE. The fix in IE does successfully fix. Personally I'd consider it a more elegant solution to put the parameter/value strings into an array and then use an implode function, but this way gets the job done.

matt v.’s picture

Status: Active » Fixed

I just committed a fix more along the lines of what surge_martin suggested. Thanks everyone for help in finding and suggesting fixes for the issue!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.