Hallo!!
According to my previous post with popups hanging, now I'm trying to bypass
this strange behaviour using loading JavaScript image not by image.src=URL
but straight away from stream using HTTP GET method.
The problem is, how to assign stream from downloaded image (ex. GIF89a) to a
JavaScript Image object ?
Below is my code with explanation what I'm trying to do:
<script type="text/javascript">
var xmlhttp;
/*@cc_on @*/
/*@if (@_jscript_vers ion >= 5)
var ids = ["Msxml2.XMLHTTP .5.0","Msxml2.X MLHTTP.4.0",
"Msxml2.XMLHTTP .3.0","Msxml2.X MLHTTP", "Microsoft.XMLH TTP"];
for(var i=0; !xmlhttp && i<ids.length; i++) { try { xmlhttp = new
ActiveXObject(i ds[i]); } catch(ex) { xmlhttp = false; } }
@end @*/
if (!xmlhttp && typeof XMLHttpRequest! ='undefined') { xmlhttp = new
XMLHttpRequest( ); }
if (xmlhttp) {
xmlhttp.open("G ET","http://test2/load?BINARY_ID= 42311183",true) ; //zczytuje
obrazek
xmlhttp.onready statechange=fun ction() {
if (xmlhttp.readyS tate==4) { //downloading complete!
alert(xmlhttp.r esponseText); // is OK image is loaded type is GIF89a
obrazek = new Image(); // OK
obrazek = xmlhttp.respons eBody; // this is my dream !!!!! heheh
alert(obrazek.w idth); //it's null of course, and my dream is that
obrazek.width should equal to real image readed from HTTP stream.
document.getEle mentById("docum ent_image")=obr azek; //another dream, where
document_image is an image declared in HTML body as <img
id="document_im age">
}
}
xmlhttp.send(nu ll);
}
</script>
Thanks for any help, solution, info!!!
Serge!
According to my previous post with popups hanging, now I'm trying to bypass
this strange behaviour using loading JavaScript image not by image.src=URL
but straight away from stream using HTTP GET method.
The problem is, how to assign stream from downloaded image (ex. GIF89a) to a
JavaScript Image object ?
Below is my code with explanation what I'm trying to do:
<script type="text/javascript">
var xmlhttp;
/*@cc_on @*/
/*@if (@_jscript_vers ion >= 5)
var ids = ["Msxml2.XMLHTTP .5.0","Msxml2.X MLHTTP.4.0",
"Msxml2.XMLHTTP .3.0","Msxml2.X MLHTTP", "Microsoft.XMLH TTP"];
for(var i=0; !xmlhttp && i<ids.length; i++) { try { xmlhttp = new
ActiveXObject(i ds[i]); } catch(ex) { xmlhttp = false; } }
@end @*/
if (!xmlhttp && typeof XMLHttpRequest! ='undefined') { xmlhttp = new
XMLHttpRequest( ); }
if (xmlhttp) {
xmlhttp.open("G ET","http://test2/load?BINARY_ID= 42311183",true) ; //zczytuje
obrazek
xmlhttp.onready statechange=fun ction() {
if (xmlhttp.readyS tate==4) { //downloading complete!
alert(xmlhttp.r esponseText); // is OK image is loaded type is GIF89a
obrazek = new Image(); // OK
obrazek = xmlhttp.respons eBody; // this is my dream !!!!! heheh
alert(obrazek.w idth); //it's null of course, and my dream is that
obrazek.width should equal to real image readed from HTTP stream.
document.getEle mentById("docum ent_image")=obr azek; //another dream, where
document_image is an image declared in HTML body as <img
id="document_im age">
}
}
xmlhttp.send(nu ll);
}
</script>
Thanks for any help, solution, info!!!
Serge!
Comment