cgi / javascrip / perl / innerHTML quoting confusion

S

seven.reeds

Hi,

I am not a js expert by any stretch and this might be a perl question
more than js but I have to start somewhere so fingers crossed...

Ok, I am doing some ajax and have this '<input type='file"' input that
I am working on. It is accepting image files. When its value changes
I want to display the image in an associated DIV. I am building the
html and js lines in a perl script. THe relevant section looks like:

$HTML .= <<EOF;
<p><label for="IThumbnail">Path to Thumbnail</label>
<input type="file" name="IThumbnail" id="IThumbnail"
size=50
accept="image/gif,image/jpeg"
onchange="
document.getElementById('IThumbnailImageDiv').innerHTML
=
'<img src="file://' +
document.getElementById('IThumbnail').value +
'" alt="upload file" />'; return false; " /></p>

<div id="IThumbnailImageDiv"
style="float:left;
clear:both;">
</div>
EOF

I'm testing this with FireFox and have the js Console open. It tells
me that there are mis-matching quotes starting at: '<img

I have tried quoting the double qyotes inside the IMG tag I am building
with "\" and "\\" but neither works. This has to be a simple mistake
but I am not seeing it.

help?
 
R

Randy Webb

seven.reeds said the following on 6/20/2006 3:45 PM:
Hi,

I am not a js expert by any stretch and this might be a perl question
more than js but I have to start somewhere so fingers crossed...

Ok, I am doing some ajax and have this '<input type='file"' input that
I am working on. It is accepting image files. When its value changes
I want to display the image in an associated DIV.

Your script error aside, you won't be able to do what you are trying to
do anymore. It has been decided that showing an image from the client
file system on a web-based page is a security violation so you can't do it.
 
S

seven.reeds

Your script error aside, you won't be able to do what you are trying to
do anymore. It has been decided that showing an image from the client
file system on a web-based page is a security violation so you can't do it.

Thanks Rand,

it figures. sigh

all the best
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top