[Solved]: javascript error when viewing image with firefox [Solved]: javascript error when viewing image with firefox
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

[Solved]: javascript error when viewing image with firefox

Started by PCG, June 16, 2008, 06:43:42 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

PCG

I get a java script error after clicking on an image to see a larger size. The error only seems to appear with firefox on windows and os x.

Example from os x:
Error: Warning: unrecognized command line flag -psn_0_2490369
Source File: file:///Applications/Firefox.app/Contents/MacOS/components/nsBrowserContentHandler.js
Line: 706

The error is independent from the theme, there are no mods/plugins installed, it happens with every image.

Link: http://www.ibanezcollectors.com/gallery/displayimage.php?album=8&pos=3  (click the image)

Any help would be greatly appreciated.

PCG

Sami

I don't see that error , tried with FF on windows
Probably it's a bug on FF on mac
Not related to Coppermine IMO
‍I don't answer to PM with support question
Please post your issue to related board

steveeh131047

Sami,

I'm running FF2 under windows. When I click the Intermediate image I get the full size image in a new window, but I also get a FF "Error Console" window pop up. The Error console window is empty!

Steve

Nibbler

From memory, that's caused by using

<a href="javascript:"

instead of

<a href="javascript:;"

I don't know if that's related to the mac issue.

PCG

I got it with FF2 on the PC also.   

Searching returned this thread: http://forums.mozillazine.org/viewtopic.php?t=532094

It seems that, "In Firefox, when "javascript:" is entered as an address, it opens the error console." 


Is there a way to modify the '<a href="javascript:"' reference to a standard URL in Coppermine?

<a href="javascript:" onclick="return MM_openBrWindow('picEditor.php?id=51','Crop_Picture','scrollbars=yes,toolbar=no,status=yes,resizable=yes')" ...

Nibbler

Check theme_html_picture() in your custom theme.

PCG

It seems to happen in all of the themes, including the "classic" theme.

Quote from: Nibbler on June 16, 2008, 10:24:51 PM
Check theme_html_picture() in your custom theme.

What would I be looking for and where would I find this call?

Nibbler

If it happens in all themes then you must have edited include/themes.inc.php. Upload a clean copy.

PCG

Quote from: Nibbler on June 16, 2008, 10:41:40 PM
If it happens in all themes then you must have edited include/themes.inc.php. Upload a clean copy.

Did not modify the file to my knowledge, but grabbed a fresh download and uploaded include/themes.inc.php. 

No joy. I still get the error console.  Any other ideas?


PCG

Looking through "include/themes.inc.php". I found:


$pic_html = "<a href=\"javascript:;\" onclick=\"MM_openBrWindow('displayimage.php?pid=$pid&amp;fullsize=1','" . uniqid(rand()) . "','scrollbars=yes,toolbar=no,status=no,resizable=yes,width=$winsizeX,height=$winsizeY')\">";


Yet the rendered code is:
<a href="javascript:" onclick="MM_openBrWindow('displayimage.php?pid=47&amp;fullsize=1','8972373614856d477e8ed8','scrollbars=yes,toolbar=no,status=no,resizable=yes,width=1370,height=2051')"><img src="albums/userpics/11027/normal_Ibanez_Artist_AR300_sn_I815227.JPG" class="image" alt="Click to view full size image" border="0"><br></a>


Is it odd to be missing the ";"?

Nibbler

OK, I found the previous thread (http://forum.coppermine-gallery.net/index.php/topic,48072.0.html) and I think the same solution used there will work for you.

PCG

The code change worked. Adding "void(0)" keeps the console window from opening.

$pic_html = "<a href=\"javascript:;\" ...


to

$pic_html = "<a href=\"javascript:void(0);\" ...


Thanks Nibbler.

Joachim Müller


Nibbler

No, but we should avoid using javascript links like that anyway.