Connecting Tech Pros Worldwide Forums | Help | Site Map

onresize it not working with XMLHTTP

FrankIsHere@gmail.com
Guest
 
Posts: n/a
#1: Jan 7 '06
This should attach the event to the onresize of the window object, but
when I try to resize the browser after executing the page it does not
work... only after I refresh the page. But then of course that's after
the HTTP request. Here is the code:

<HTML>
<HEAD>
<script language="javascript">
function Loadit() {
var oHTTP = new ActiveXObject("Microsoft.XMLHTTP");
var sURL = "http://tempuri.org";
var sHttpMethod = "GET";
oHTTP.Open(sHttpMethod, sURL, false);
oHTTP.Send();
document.write("\<body onresize=\"alert('resize test
1');\"\>\</body\>\</html\>");
}
</script>
</HEAD>
<BODY onload="Loadit()" >

</BODY>
</HTML>



I even tried it by triggering this script right before the body end:
<script>window.attachEvent("onresize", alert('resize test 2'))</script>

How do I make the onresize statement execute?! Is this a bug? I'm
using IE 6

Thanks!


JMB
Guest
 
Posts: n/a
#2: Jan 8 '06

re: onresize it not working with XMLHTTP


<HTML>
<HEAD>
<script language="javascript">
function Loadit() {
alert('loading page');
}

function resizeFunct()
{

alert('RESIZE TEST');

}

window.onload=Loadit;
window.onresize=resizeFunct;


</script>
</HEAD>
<body></body>
</HTML>

The thing that sux about this is that the onresize event works twice. So,
you get two notices.

Hope this gives you a point of reference though.

Take it easy,
Jim

<FrankIsHere@gmail.com> wrote in message
news:1136618889.443150.272950@z14g2000cwz.googlegr oups.com...[color=blue]
> This should attach the event to the onresize of the window object, but
> when I try to resize the browser after executing the page it does not
> work... only after I refresh the page. But then of course that's after
> the HTTP request. Here is the code:
>
> <HTML>
> <HEAD>
> <script language="javascript">
> function Loadit() {
> var oHTTP = new ActiveXObject("Microsoft.XMLHTTP");
> var sURL = "http://tempuri.org";
> var sHttpMethod = "GET";
> oHTTP.Open(sHttpMethod, sURL, false);
> oHTTP.Send();
> document.write("\<body onresize=\"alert('resize test
> 1');\"\>\</body\>\</html\>");
> }
> </script>
> </HEAD>
> <BODY onload="Loadit()" >
>
> </BODY>
> </HTML>
>
>
>
> I even tried it by triggering this script right before the body end:
> <script>window.attachEvent("onresize", alert('resize test 2'))</script>
>
> How do I make the onresize statement execute?! Is this a bug? I'm
> using IE 6
>
> Thanks!
>[/color]


JMB
Guest
 
Posts: n/a
#3: Jan 8 '06

re: onresize it not working with XMLHTTP


Made it not repeat. Since you are using an Active X controller for the
XMLHTTPREQUEST onject, I didn't add a facility to verify the different
browsers.

<HTML>
<HEAD>
<script language="javascript">
var resizeValue=1;

function Loadit() {
var oHTTP = new ActiveXObject("Microsoft.XMLHTTP");
var sURL = "http://tempuri.org";
var sHttpMethod = "GET";
oHTTP.open(sHttpMethod, sURL, false);
oHTTP.send(null);

}

function resizeFunct()
{

if(resizeValue%2==0)
alert('RESIZE TEST');

++resizeValue;

}

window.onload=Loadit;
window.onresize=resizeFunct;


</script>
</HEAD>
<body></body>
</HTML>

That should be exactly what you are looking for.

Later


<FrankIsHere@gmail.com> wrote in message
news:1136618889.443150.272950@z14g2000cwz.googlegr oups.com...[color=blue]
> This should attach the event to the onresize of the window object, but
> when I try to resize the browser after executing the page it does not
> work... only after I refresh the page. But then of course that's after
> the HTTP request. Here is the code:
>
> <HTML>
> <HEAD>
> <script language="javascript">
> function Loadit() {
> var oHTTP = new ActiveXObject("Microsoft.XMLHTTP");
> var sURL = "http://tempuri.org";
> var sHttpMethod = "GET";
> oHTTP.Open(sHttpMethod, sURL, false);
> oHTTP.Send();
> document.write("\<body onresize=\"alert('resize test
> 1');\"\>\</body\>\</html\>");
> }
> </script>
> </HEAD>
> <BODY onload="Loadit()" >
>
> </BODY>
> </HTML>
>
>
>
> I even tried it by triggering this script right before the body end:
> <script>window.attachEvent("onresize", alert('resize test 2'))</script>
>
> How do I make the onresize statement execute?! Is this a bug? I'm
> using IE 6
>
> Thanks!
>[/color]


Closed Thread