Strange Behaviour
Have a quick look at the below HTML code. In this I'm trying to change an image dynamically when I selected through file control. It is working fine when I'm running it as a normal file. But when I'm running it from a server, it is not working. What could be the solution.
Quick help is appreciated.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Change Photo</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript" language="JavaScript">
function changePhoto(photoPath)
{
document.getElementById("photo").src = photoPath;
}
</script>
</head>
<body>
<img id="photo" src="<something>"/><p><input type="file" onChange="changePhoto(this.value)"></p>
</body>
</html>
|