MarcelB
Jul 4th, 2001, 09:38 AM
Hi all,
I have this page on which people can download a picture by rightclicking a link to it and selecting "Save target as...". Now I also want to be able to show the picture when someone leftclicks it. No problem so far.
But sometimes the picture that I want to show is too big to fit the page, so I want to resize it first. So I've written a function that determines the width and height of the picture, and then adjusts the display width and height according to the maximum width and height I give to the function as parameters.
So when a user leftclicks the link, it needs to be redirected to another ASP-page first, where I get the path to the picture as a parameter, then determine the display size by running it through the function, and show it on that new page. (My page is built up of frames, so the user won't notice the redirection)
So now on my page, the code gets something like this:
===========================
<form name="myform" method="post" action="show_picture.asp">
<input type="hidden" name="pic">
<a href="..\upload\049704.jpg" onClick="javascript:return submitform('..\upload\049704.jpg')">049704.jpg</a>
</form>
===========================
and the function submitform looks like this:
===========================
function submitform(sPic)
{
myform.pic.value = sPic;
myform.submit();
return false;
}
===========================
Now for some reason, I get this s t r a n g e error, namely:
'Expected hexadecimal digit' on the line of the href.
Anybody got any ideas on why I get this error, or an easier way to do what I want to do? Any help is highly appreciated.
Thanx in advance,
Marcel
I have this page on which people can download a picture by rightclicking a link to it and selecting "Save target as...". Now I also want to be able to show the picture when someone leftclicks it. No problem so far.
But sometimes the picture that I want to show is too big to fit the page, so I want to resize it first. So I've written a function that determines the width and height of the picture, and then adjusts the display width and height according to the maximum width and height I give to the function as parameters.
So when a user leftclicks the link, it needs to be redirected to another ASP-page first, where I get the path to the picture as a parameter, then determine the display size by running it through the function, and show it on that new page. (My page is built up of frames, so the user won't notice the redirection)
So now on my page, the code gets something like this:
===========================
<form name="myform" method="post" action="show_picture.asp">
<input type="hidden" name="pic">
<a href="..\upload\049704.jpg" onClick="javascript:return submitform('..\upload\049704.jpg')">049704.jpg</a>
</form>
===========================
and the function submitform looks like this:
===========================
function submitform(sPic)
{
myform.pic.value = sPic;
myform.submit();
return false;
}
===========================
Now for some reason, I get this s t r a n g e error, namely:
'Expected hexadecimal digit' on the line of the href.
Anybody got any ideas on why I get this error, or an easier way to do what I want to do? Any help is highly appreciated.
Thanx in advance,
Marcel