473,732 Members | 2,219 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Script doesn't work without alerts :(

Hey
var service = this.WebService URL +"/SessionFun?sess ionID="+ this.SessionID ;

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

{

xmlDoc.async = false;

xmlDoc.load(ser vice);

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

Jan 5 '06 #1
10 6554
> Hey
var service = this.WebService URL +"/SessionFun?sess ionID="+ this.SessionID
;

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

{

xmlDoc.async = false;

xmlDoc.load(ser vice);

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

Jan 5 '06 #2
>>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

Jan 5 '06 #3
VK

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
onreadystatecha nge. 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).

Jan 5 '06 #4
>> 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

Jan 5 '06 #5
>>>>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.setTimeo ut(...);
without using xmlDoc.onload.. . just after xmlDoc.load()
window.setTimeo ut(...)
Of course non of them helped ( but it worked code was paused ).
Jarod

Jan 5 '06 #6
VK

Jarod wrote:
Any ideas how to make it work ?


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

var service = this.WebService URL +"/SessionFun?sess ionID="+
this.SessionID ;
var xmlDoc=document .implementation .createDocument ("", "", null);
try
{
xmlDoc.async = false;
xmlDoc.load(ser vice);
alert("now it works");
}

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

Jan 5 '06 #7
> If by "it" you mean the originally posted piece:

var service = this.WebService URL +"/SessionFun?sess ionID="+
this.SessionID ;
var xmlDoc=document .implementation .createDocument ("", "", null);
try
{
xmlDoc.async = false;
xmlDoc.load(ser vice);
alert("now it works");
}

then no one knows I guess because there is nothing explicetly terrible
in it, but "this.WebServic eURL" 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.WebService URL = 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

Jan 5 '06 #8
"Jarod" <bl*****@NOSPAM .gazeta.pl> writes:
xmlDoc.async = false;
xmlDoc.load(ser vice);
alert("now it works");
If I add "alert(""); " like in above it works in NN 7.0. Question is
how to make it work without alert.


If adding alert changes anything, it suggests a timing problem.
The "xmlDoc.asy nc = false" assignment suggests that something
could happen asynchroneously . If it did, then maybe a delay is
needed, so my suggestion would be that the assignment fails to
make the request synchroneous in NN7. You could live with that
and change it to always be asynchroneous, or you could look
for a workaround for NN7 (as well as a way to safely detect
the need for that workaround).

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html>
'Faith without judgement merely degrades the spirit divine.'
Jan 6 '06 #9
>>> xmlDoc.async = false;
xmlDoc.load(ser vice);
alert("now it works");

If I add "alert(""); " like in above it works in NN 7.0. Question is
how to make it work without alert.


If adding alert changes anything, it suggests a timing problem.
The "xmlDoc.asy nc = false" assignment suggests that something
could happen asynchroneously . If it did, then maybe a delay is
needed, so my suggestion would be that the assignment fails to
make the request synchroneous in NN7. You could live with that
and change it to always be asynchroneous, or you could look
for a workaround for NN7 (as well as a way to safely detect
the need for that workaround).


Async set to true doesn't change anything ;( I tried it. But I don't know
why this alert makes it work ? [It's probably not about time... but about
some interuption ...]
Jarod

Jan 6 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
4230
by: Johnny Knoxville | last post by:
I've added a favicon to my site (http://lazyape.filetap.com/) which works fine if you add the site to favourites the normal way, but I have some JavaScript code on a couple of pages with a link, which when you click it bookmarks the site (much easier). The favicon is never saved if the site is bookmarked this way. Does anyone have any ideas how to fix this?? This is the code: <script language="JavaScript">
2
2067
by: kaeli | last post by:
Okay, trying to get the for...in loop syntax and obviously doing something wrong. I have a form and a select with options. The explicit indexing I usually use works fine and alerts all the values. The for...in loop gives undefined for both IE and NN, but for IE, kills it with way too many alerts. NN6 gives the right number of alerts (5 options, 5 alerts) but all say undefined. Anyone know what I did wrong? AFAIK, selectElement.options...
15
1586
by: AV | last post by:
Hallo any idea why the following code doesn't work? ////////////////////////////////// function myfunc(){ with(this){ prop="hallo world"; } }
5
1664
by: zaw | last post by:
Hi I am working on implementing this script to shopping cart. Basically, it copies fill the shipping address from billing automatically. I believe one or more syntax is not netscape compatible. Can anyone point out which one it is and how to make it both netscape and MS browser compatible? I hope if I can make the script compatible for those two at extreme, it will probably work with most browser out there. As you would notice, this form...
0
1405
by: Pete Beech | last post by:
Hi, We have an ASP.NET 1.1 webapp, deployed on an integration and a production server - exactly the same code. One of the pages has client side validation script, using the validation Webcontrols. The HTML rendered out from production is different to that from integration, although they are both running ASP.NET 1.1 (verified using aspnet_regiis -lk, looking
7
10982
by: C.Joseph Drayton | last post by:
I have a problem that I am hoping someone can help me with. First let me describe the problem. I have an HTML form that in one field has an onBlur call to a JavaScript function. When you exit the field, it calls the JavaScript routine, which in turn calls a PHP script. The PHP script runs returns the value needed. And returns to the JavaScript. The JavaScript function is then supposed to set alerts depending on the values returned from...
7
3190
by: mattrapoport | last post by:
Hello - I am kinda new to the HTML DOM so I apologize in advance for my ignorance. I have a table made from divs. I am trying to write a script that appends a new row to the table (by cloning the last row) and then adding some text to the fields in that row. My script works perfectly in IE but not even close in Firefox. Here's my HTML ... HTML:
19
3826
by: thisis | last post by:
Hi All, i have this.asp page: <script type="text/vbscript"> Function myFunc(val1ok, val2ok) ' do something ok myFunc = " return something ok" End Function </script>
28
3449
by: Peter Michaux | last post by:
Hi, I'm playing with dynamic script insertion to make a request to the server for a JavaScript file to be automatically run when it arrives in the browser. It works but... The page caching is too good. When I revisit the page or refresh the page, and then redo the script insertion, the browser doesn't even hit the server to check for a newer version of the JavaScript file. The same old script runs with each insertion.
0
8946
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8774
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9447
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9235
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9181
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8186
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6031
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4809
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2721
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.