[thelist] onClick="open problem

Kelly Hallman khallman at wrack.org
Wed Feb 5 12:12:00 CST 2003


On Wed, 5 Feb 2003, Hugh Blair wrote:
> > As you suspected earlier, I think the problem may be in the fact that
> > you're trying to call an HTML file that is in a script directory.
> >
> > It's highly likely that this directory is forcing a script handler.
>
> What's confusing me about that is that there are html files in the
> /cgi-bin/store/html directory that are successfully being served.
> Why would this /images directory *not* serve html files?

I'm assuming you don't have administrative access here, so that you might
know how the server is actually configured..  It's possible that the
settings of the html directory in question are actually different from the
images directory.  A plain HTML page would never cause a 500 error unless
some handler was being used.  A look at the error log would probably give
you a better idea of why this error is being generated, but I don't know
if you have access to the error log...

> OK - I changed the line to: (on one line)
> <a href="%%userFieldTwo%%" title="Click here for larger image."
> target="view" onClick="window.open('%%userFieldTwo%%', 'view',
> 'width=420,top=50,left=50,scrollbars=yes, resizable=yes'); return
> false;">%%image%%</a>
>
> No change. I still get a 500 error. Drat, I really want to have
> these html pages in that directory.

The Javascript suggestion had nothing to do with fixing the 500 error, so
that doesn't surprise me.  I'm pretty sure if you move the file to some
location that you can actually fetch/verify with a browser, it will also
work here, with your Javascript/perl/etc.  In other words, I don't think
the 500 error has anything to do with Javascript, or the client at all...

> If I move this html file to /(root) it pulls the html page, but the
> image is broken. Since the image is also in
> /cgi-bin/store/html/images/1014-f.jpg, and the scripts can call it from
> there, why can't a browser also access it? This just confuses me.

If you use a relative path to an image such as src="1014.jpg" and you move
the URL of the page from /cgi-bin/store/html/images/ to / your browser
will try to find the src="1014.jpg" now as /1014.jpg ... since that
URL/image does not exist, it comes up as broken.

Change the img src="" to an absolute reference and it will work.

--
Kelly Hallman
http://wrack.org/







More information about the thelist mailing list