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

Why does ScriptRegistrar have to be at the bottom?

2 Answers 66 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Ignacio
Top achievements
Rank 1
Ignacio asked on 30 Jan 2010, 01:19 PM
I like all my javascript to be at the head section of my xhtml..... why does ScriptRegistrar need to be at the bottom?

2 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 01 Feb 2010, 08:38 AM
Hello Nacho Fuentes,

The ScriptRegistrar component needs to be after all other Telerik View components because they need to register with the registrar. This is required because the ScriptRegistar outputs the JavaScript files and initialization code required by those components.

Regards,
Atanas Korchev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Filip Ekberg
Top achievements
Rank 1
answered on 02 Feb 2010, 03:18 PM
This is discussed in the webinar ( http://tv.telerik.com/aspnet-mvc/webinar/understanding-telerik-extensions-aspnet-mvc-ctp ).

Not to leave you empty handed though, it's because loading Javascript stops the rendering of the page. The web-browser thinkgs that the javascript you include might effect your final UI and therefore stops the rendering when a Javascript file is requested.

So if you put the Script Registrar at the bottom you bascily avoid the printing of a blank page.

// Filip
Tags
General Discussions
Asked by
Ignacio
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Filip Ekberg
Top achievements
Rank 1
Share this question
or