Script for showing pictures in a web-view

In Domino 5 I have a code for showing pictures on web in a view. This code does not work in Domino 6. Instead of the picuture I got this square with a red cross… ¨

What’s wrong with my code since it does not work in 6?

The view contains this code who is used to show the picture i the view on web:

path := “/” + @ReplaceSubstring(@Subset(@DbName;-1) ; “\” ; “/”);

“<SCRIPT LANGUAGE="JavaScript">showImage("” + path + “/ff62e73046cbd46ec12567c3002d2db5/” +

@Text(@DocumentUniqueID) + "/Art/0.7C?OpenElement\")</SCRIPT>"

The $ViewTemplate-form has this code in JSheader:

function showImage(urlText){

var img = new Image();

img.src = urlText;

var htmlString = img.src;

var maxHeight = 80;

var maxWidth = 200;

var faktor = 1;

var t;

var i;

if(maxHeight < img.height) faktor = maxHeight / img.height;

h = img.height * faktor;

w = img.width * faktor;

faktor = 1;

if(maxWidth < w) faktor = maxWidth / w;

h = h * faktor;

w = w * faktor;

if(h==0){

for(i=1;i<1000;i++){i=i};

tmpString = '<img src="' + urlText + '" height=80 width=80';

}

else{

tmpString = '<img src="' + urlText + '" height=' + h + " width=" + w;

}

document.write(tmpString);

}

Subject: Script for showing pictures in a web-view

Here’s what I use in a view column formula:

“a onClick='picWindow=window.open("/” + @WebDbName + “/” +
@Text(@DocumentUniqueID) + “/$File/” + @AttachmentNames + “", "",
"scrollbars,resizable,width=550,height=550");if (window.picWindow != null)
window.picWindow.focus(); return false;’ href=‘’>” + Title + “]”

Note that you have to prepend a left square bracket [ and a less-than sign <
because this forum will strip that out.

Subject: Script for showing pictures in a web-view

I know why it won’t work but you might not like the answer !!

I too reference pictures in a way similar to you:

/mkt/staffdir.nsf/StaffVsno/A73D3E2F2E7F96A8802567920074A6C8/Photo/0.7C?OpenElement&FieldElemFormat=jpg

The problem is with the 0.7C this should now be 0.84. I don’t know why but it changes when I edit my documents in Notes 6.

Cheers

Paul

Subject: Simple troubleshooting (WAS: Script for showing pictures in a web-view)

Whenever this happens, right-click on the image and grab its properties in the browser. This will indicate what the full path to the image is, and will therefore give you a clue as to where the error is arising.

You do seem to have a lot of complex Javascript in there for something as simple as displaying an image…