This is a migrated thread and some comments may be shown as answers.

[Solved] Ajax for Javascript Detection

1 Answer 130 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Stuart
Top achievements
Rank 1
Stuart asked on 05 Dec 2007, 10:06 AM
Hi

until recently i used the non-prometheus version of ajax for my websites, but I am working towards moveing all my newer projects to prometheus ajax. My websites have a javascript and non javascript layer, and i use javascript to execute a command on the page load using ajax to set up the javascript layer.

<body onload="gotoPage('javascriptActive');">  
 <form id="frm" runat="server">  
  //All controls and ajax manager  
 </form> 
 <script langauge="javascript" type="text/javascript">  
    
  function gotoPage(ID)  
  {  
     var ajax = <%= ajaxMan.ClientID %> 
     ajax.AjaxRequest(ID);  
  }  
 </script> 
</body> 


Problem is on the first load it throws a js error and when i hit the refresh button it works as expected.

All the other ajaxified ontrols use the gotoPage javascript method and works 100 %

plz help

1 Answer, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 05 Dec 2007, 12:52 PM
Hello Stuart,

If you execute this immediately please switch to ASP.NET AJAX style using Sys.Application.load event where all components including RadAjaxManager are created and ready to use. Here is a link with more info:
http://www.asp.net/ajax/documentation/live/ClientReference/Sys/ApplicationClass/SysApplicationLoadEvent.aspx

Best wishes,
Vlad
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Ajax
Asked by
Stuart
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Share this question
or