Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Script doesn't work without alerts :(

Reply
Thread Tools

Script doesn't work without alerts :(

 
 
Jarod
Guest
Posts: n/a
 
      01-05-2006
Hey
var service = this.WebServiceURL +"/SessionFun?sessionID="+ this.SessionID ;

var xmlDoc=document.implementation.createDocument("", "", null);


try

{

xmlDoc.async = false;

xmlDoc.load(service);

alert("now it works");

}



When you delete last alert the xmlDoc in older browser will be empty I
tried to put a pause there I wrote a code that just stops browser for 1, 2,
10 seconds... but the xmlDoc is still empty. And if I hit an alert after 0,1
s it works. How to make it work without alert ?

Jarod

 
Reply With Quote
 
 
 
 
Jarod
Guest
Posts: n/a
 
      01-05-2006
> Hey
> var service = this.WebServiceURL +"/SessionFun?sessionID="+ this.SessionID
> ;
>
> var xmlDoc=document.implementation.createDocument("", "", null);
>
>
> try
>
> {
>
> xmlDoc.async = false;
>
> xmlDoc.load(service);
>
> alert("now it works");
>
> }
>
>
>
> When you delete last alert the xmlDoc in older browser will be empty I
> tried to put a pause there I wrote a code that just stops browser for 1,
> 2, 10 seconds... but the xmlDoc is still empty. And if I hit an alert
> after 0,1 s it works. How to make it work without alert ?
>

I forgot to mention that it doesn't work in NN 7.0.In higher versions like
NN 8.0 and FF 1,5 works great.
Jarod

 
Reply With Quote
 
 
 
 
Lee
Guest
Posts: n/a
 
      01-05-2006
Jarod said:

>When you delete last alert the xmlDoc in older browser will be empty I
>tried to put a pause there I wrote a code that just stops browser for 1, 2,
>10 seconds... but the xmlDoc is still empty.


What sort of code did you write to stop the browser?
Unless you used setTimeout(), you probably stopped your browser from doing
anything at all, including loading the document.

 
Reply With Quote
 
Jarod
Guest
Posts: n/a
 
      01-05-2006
>>When you delete last alert the xmlDoc in older browser will be empty I
>>tried to put a pause there I wrote a code that just stops browser for 1,
>>2,
>>10 seconds... but the xmlDoc is still empty.

>
> What sort of code did you write to stop the browser?
> Unless you used setTimeout(), you probably stopped your browser from doing
> anything at all, including loading the document.
>


it doesn't matter I tried to use some pause function with while I tried
setTimeout doesn't matter. And it can take even 10s and doesn't help. But
one alert for 0,05s is great. Maybe there is a way to display and close
alert from code ?
Jarod

 
Reply With Quote
 
Lee
Guest
Posts: n/a
 
      01-05-2006
Jarod said:
>
>>>When you delete last alert the xmlDoc in older browser will be empty I
>>>tried to put a pause there I wrote a code that just stops browser for 1,
>>>2,
>>>10 seconds... but the xmlDoc is still empty.

>>
>> What sort of code did you write to stop the browser?
>> Unless you used setTimeout(), you probably stopped your browser from doing
>> anything at all, including loading the document.
>>

>
>it doesn't matter I tried to use some pause function with while I tried
>setTimeout doesn't matter. And it can take even 10s and doesn't help. But
>one alert for 0,05s is great. Maybe there is a way to display and close
>alert from code ?


No. How did you try to use setTimeout()?

 
Reply With Quote
 
VK
Guest
Posts: n/a
 
      01-05-2006

Jarod wrote:
> >>When you delete last alert the xmlDoc in older browser will be empty I
> >>tried to put a pause there I wrote a code that just stops browser for 1,
> >>2,
> >>10 seconds... but the xmlDoc is still empty.

> >
> > What sort of code did you write to stop the browser?
> > Unless you used setTimeout(), you probably stopped your browser from doing
> > anything at all, including loading the document.
> >

>
> it doesn't matter I tried to use some pause function with while I tried
> setTimeout doesn't matter. And it can take even 10s and doesn't help. But
> one alert for 0,05s is great. Maybe there is a way to display and close
> alert from code ?


First of all,
async = true
*always and forever*

Synchronized requests simply do not work in JavaScript without real
thread management mechanics. More correctly - they do "work" but it's
far away from what you would call "work" for a synchronized process.
So simply forget that this flag exists (default value is true, exactly
what you need). For request status there is readyState property, so you
have to emulate *normal* synchronization manually over
onreadystatechange. Thank you very much to script engine makers (on
both sides), but what is - it is.

Secondly: it is forbidden by the rules of this universe what
synchronized thread "works" upon alert(), and upon alert() only. That
must be a combined bug where several errors are twisted together. More
code would help.

Also it may be connected with alert() call priority so system let it go
through or even changes async from true to false. That's a *pure
speculation* as async=true behavior is studied rather badly (as no one
uses it).

 
Reply With Quote
 
Jarod
Guest
Posts: n/a
 
      01-05-2006
>> it doesn't matter I tried to use some pause function with while I tried
>> setTimeout doesn't matter. And it can take even 10s and doesn't help. But
>> one alert for 0,05s is great. Maybe there is a way to display and close
>> alert from code ?

>
> First of all,
> async = true
> *always and forever*
>


I tried it before writting to group nothing changed. With alert it works
without alert it doesn't.

> Also it may be connected with alert() call priority so system let it go
> through or even changes async from true to false. That's a *pure
> speculation* as async=true behavior is studied rather badly (as no one
> uses it).
>


Any ideas how to make it work ?
Jarod

 
Reply With Quote
 
Jarod
Guest
Posts: n/a
 
      01-05-2006
>>>>When you delete last alert the xmlDoc in older browser will be empty
>>>> I
>>>>tried to put a pause there I wrote a code that just stops browser for 1,
>>>>2,
>>>>10 seconds... but the xmlDoc is still empty.
>>>
>>> What sort of code did you write to stop the browser?
>>> Unless you used setTimeout(), you probably stopped your browser from
>>> doing
>>> anything at all, including loading the document.
>>>

>>
>>it doesn't matter I tried to use some pause function with while I tried
>>setTimeout doesn't matter. And it can take even 10s and doesn't help. But
>>one alert for 0,05s is great. Maybe there is a way to display and close
>>alert from code ?

>
> No. How did you try to use setTimeout()?
>


For real it doesn't matter because it doesn't work in anyway.
But let's say:

xmlDoc.onload = window.setTimeout(...);
without using xmlDoc.onload... just after xmlDoc.load()
window.setTimeout(...)
Of course non of them helped ( but it worked code was paused ).
Jarod

 
Reply With Quote
 
VK
Guest
Posts: n/a
 
      01-05-2006

Jarod wrote:
> Any ideas how to make it work ?


If by "it" you mean the originally posted piece:

var service = this.WebServiceURL +"/SessionFun?sessionID="+
this.SessionID ;
var xmlDoc=document.implementation.createDocument("", "", null);
try
{
xmlDoc.async = false;
xmlDoc.load(service);
alert("now it works");
}

then no one knows I guess because there is nothing explicetly terrible
in it, but "this.WebServiceURL" suggests that this is a part of a
constructor we have no idea about. So please either post the code or
provide a link.

 
Reply With Quote
 
Jarod
Guest
Posts: n/a
 
      01-05-2006
> If by "it" you mean the originally posted piece:
>
> var service = this.WebServiceURL +"/SessionFun?sessionID="+
> this.SessionID ;
> var xmlDoc=document.implementation.createDocument("", "", null);
> try
> {
> xmlDoc.async = false;
> xmlDoc.load(service);
> alert("now it works");
> }
>
> then no one knows I guess because there is nothing explicetly terrible
> in it, but "this.WebServiceURL" suggests that this is a part of a
> constructor we have no idea about. So please either post the code or
> provide a link.
>


this.WebServiceURL = http://localhost/myWebservice.asmx;
and this code as a whole not this peace works in all new browsers but it
doesn't in NN 7.0.
If I add "alert("");" like in above it works in NN 7.0. Question is how to
make it work without alert.
Jarod

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Q: form validation withOUT alerts canoe414@telecom-digest.zzn.com Javascript 5 07-19-2007 02:00 AM
Javascript alerts - work on some pages but not on others thatsMaBoy ASP .Net 5 03-13-2007 01:09 PM
Inbox alerts Ralph Firefox 4 09-20-2005 02:35 AM
HELP ---starting to get these alerts SHRED Firefox 1 10-09-2004 06:17 AM



Advertisments