starrwriter
Programmer
Can anyone tell me how to stop the script below from removing the back slashes in the image URL? Here's the result I get in the alert:
<img src=C:WindowsDesktopimage1.jpg width="100" height="100" border="0">
function getImageDims(imgurl)
{
var oImage = new Image();
oImage.onload = new Function(
'alert("<img src='+imgurl + ' width="+this.width + " height="+this.height + [" border=0>"])'
);
oImage.src = load.value;
}
</script>
</head>
<body>
<input type="file" name="load"> <input type="button" value="Get Image Data" onclick="getImageDims(load.value)">
The URL is displayed correctly with slashes in the <input type="file" text field, but the script changes load.value by removing the slashes.
<img src=C:WindowsDesktopimage1.jpg width="100" height="100" border="0">
function getImageDims(imgurl)
{
var oImage = new Image();
oImage.onload = new Function(
'alert("<img src='+imgurl + ' width="+this.width + " height="+this.height + [" border=0>"])'
);
oImage.src = load.value;
}
</script>
</head>
<body>
<input type="file" name="load"> <input type="button" value="Get Image Data" onclick="getImageDims(load.value)">
The URL is displayed correctly with slashes in the <input type="file" text field, but the script changes load.value by removing the slashes.