Advanced search  

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

Pages: [1]   Go Down

Author Topic: [Solved]: javascript error when viewing image with firefox  (Read 9398 times)

0 Members and 1 Guest are viewing this topic.

PCG

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
[Solved]: javascript error when viewing image with firefox
« on: June 16, 2008, 06:43:42 pm »

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
« Last Edit: June 17, 2008, 05:16:38 pm by Nibbler »
Logged

Sami

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 3686
  • BMossavari
    • My Project
Re: javascript error when viewing image with firefox
« Reply #1 on: June 16, 2008, 10:02:14 pm »

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
Logged
‍I don't answer to PM with support question
Please post your issue to related board

steveeh131047

  • Supporter
  • Coppermine frequent poster
  • ****
  • Offline Offline
  • Posts: 217
Re: javascript error when viewing image with firefox
« Reply #2 on: June 16, 2008, 10:15:48 pm »

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
Logged

Nibbler

  • Guest
Re: javascript error when viewing image with firefox
« Reply #3 on: June 16, 2008, 10:21:06 pm »

From memory, that's caused by using

Code: [Select]
<a href="javascript:"
instead of

Code: [Select]
<a href="javascript:;"
I don't know if that's related to the mac issue.
Logged

PCG

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Re: javascript error when viewing image with firefox
« Reply #4 on: June 16, 2008, 10:24:00 pm »

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?

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

Nibbler

  • Guest
Re: javascript error when viewing image with firefox
« Reply #5 on: June 16, 2008, 10:24:51 pm »

Check theme_html_picture() in your custom theme.
Logged

PCG

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Re: javascript error when viewing image with firefox
« Reply #6 on: June 16, 2008, 10:29:25 pm »

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

Check theme_html_picture() in your custom theme.

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

Nibbler

  • Guest
Re: javascript error when viewing image with firefox
« Reply #7 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.
Logged

PCG

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Re: javascript error when viewing image with firefox
« Reply #8 on: June 16, 2008, 10:58:12 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?

Logged

PCG

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Re: javascript error when viewing image with firefox
« Reply #9 on: June 16, 2008, 11:05:25 pm »

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

Code: [Select]
$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:
Code: [Select]
<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 ";"?
Logged

Nibbler

  • Guest
Re: javascript error when viewing image with firefox
« Reply #10 on: June 16, 2008, 11:10:03 pm »

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.
Logged

PCG

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Re: javascript error when viewing image with firefox
« Reply #11 on: June 17, 2008, 04:36:53 pm »

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

Code: [Select]
$pic_html = "<a href=\"javascript:;\" ...

to

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

Thanks Nibbler.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: [Solved]: javascript error when viewing image with firefox
« Reply #12 on: June 21, 2008, 04:25:28 pm »

@Nibbler: potential bug?
Logged

Nibbler

  • Guest
Re: [Solved]: javascript error when viewing image with firefox
« Reply #13 on: June 21, 2008, 04:34:23 pm »

No, but we should avoid using javascript links like that anyway.
Logged
Pages: [1]   Go Up
 

Page created in 0.022 seconds with 20 queries.