Hi Kosa.
Since I'm not really good at Javascript either, I was thinking that maybe we could do this with SAS (checking if the file does exist or not ; displaying the "popup" text just using standard HTML features included in the A tag (which is used for links)...
Here is your first example, transformed into a Print procedure using a format.
DATA x;
INPUT letters $1.;
CARDS;
A
B
C
D
E
F
;
RUN;
PROC FORMAT ;
VALUE $links
'A' = "C:\Temp\File_1.jpg"
'B' = "C:\Temp\File_2.jpg"
'C' = "C:\Temp\File_3.jpg"
'D' = "C:\Temp\File_4.jpg"
'E' = "C:\Temp\File_5.jpg"
'F' = "C:\Temp\File_6.jpg"
;
RUN;
DATA work.links ;
SET x ;
/* test if the file exists for each value */
IF FILEEXIST(PUT(letters,$links.)) THEN
value = ""!!letters!!"" ;
ELSE value = ""!!letters!!"" ;
RUN ;
ODS HTML BODY="C:\Temp\MY_FILE.html" STYLE=MAGNIFY;
TITLE "SHORTCUTS";
PROC PRINT DATA = work.links LABEL NOOBS ;
VAR value ;
LABEL value = "Click on shortcut to display the image" ;
RUN ;
ODS HTML CLOSE;
I hope it will be of any help.
Olivier
... View more