If you don't want to use an onload tag, just make sure your ajax is called in a script block at the very end of the html. I often put all of the _javascript_ functions (or script includes) that get called by functions on the page the top of the html. I put the ones that run when the page loads at the bottom of the html.

 

I try to avoid using the onload event because it often fails inconveniently on the " call instead of in the actually broken code. It gets even worse to find the error when "MyBrokenFunction()" isn't the one with the problem, it is actually due to the _javascript_ interpreter giving up on a syntax error further up the page, so MyBrokenFunction() is never even parsed at all.

 

You can also do this:

 

 var objTimer = self.setTimeout("MyPage.MyFunct(MyParams, MyFunct_CallBack)", 200);

 

This will create a 200 millisecond delay before the function runs.

 

You should also end your event in the callback with:

 

 self.clearTimeout(objTimer);

 

There may be some downsides to doing it this way so I am open to suggestions.

 

 

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of CalleManthey
Sent: Monday, September 18, 2006 10:16 AM
To: Ajax.NET Professional
Subject: [ajaxpro] onLoading: "AjaxPro is undefined"

 

 

Hi,

 

I try to get the global onLoading function to work.

I placed the func in the <script ... > part of the header of the aspx

page, added the loadingInfo div tag but when running the page the error

comes up:

"AjaxPro" is undefined.

 

All my other async AjaxPro function are running perfectly - on many

pages.

 

Where is my error?

 

Calle

 

 

 


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ajax.NET Professional" group.

To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]

For more options, visit this group at http://groups.google.com/group/ajaxpro

The latest downloads of Ajax.NET Professional can be found at http://www.ajaxpro.info/

Don't forget to read my blog at http://weblogs.asp.net/mschwarz/
-~----------~----~----~----~------~----~------~--~---

Reply via email to