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

[Solved] Postback is causing javascript error '$telerik' not defined

1 Answer 148 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Mark Davis
Top achievements
Rank 1
Mark Davis asked on 03 Apr 2008, 12:23 AM
To improve performance on our web site, we only add RADTooltip instances to our control hierarchy (ASP.NET) when a user is logged in. We do have RADEditor instances but these have "Enabled" set to false.

This works great - no Telerik script files are downloaded until we need them.

Unfortunately, when a postback occurs, a "scriptStartupBlock" is being emitted and causing a JavaScript error, since none of the Telerik client libraries have been downloaded. Here is the script:

if (!$telerik.isSafari)
{
 var links = document.body.getElementsByTagName('link');
 if (links && links.length>0)
 {
  var documentHead = document.getElementsByTagName('head')[0];
  if (documentHead)
  {
   for (var i=links.length-1;i>=0;i--)
   {
    var linkTag = links[i];
    if (linkTag.title == 'Telerik stylesheet')
    {
     if ($telerik.isIE)
     {
      linkTag = linkTag.cloneNode(true);
     }
     documentHead.appendChild(linkTag);
    }
   }
  }
 }
}

1 Answer, 1 is accepted

Sort by
0
Lini
Telerik team
answered on 03 Apr 2008, 06:33 AM
Hi,

Thank you for the information. This bug will be fixed for the official release in two weeks.

Kind regards,
Lini
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Editor
Asked by
Mark Davis
Top achievements
Rank 1
Answers by
Lini
Telerik team
Share this question
or