[1.0] XScript - InitScriptMode option

  1. #1

    [1.0] XScript - InitScriptMode option

    Hi,

    This might be a feature request.

    Is there a way to configure the XScript control so that the Javascript is linked or in the init script as opposed to inline? It would also be cool if it is minified/compressed if included as an external file.

    Thanks!
  2. #2

    RE: [1.0] XScript - InitScriptMode option

    Is there a way to configure the XScript control so that the Javascript is linked or in the init script as opposed to inline? It would also be cool if it is minified/compressed if included as an external file.
    Not currently, but I would really like this feature too. It's on my TODO list and I don't think this should be a problem to implement.


    I'll post an update once committed to svn, although it's going to be tough for us to fit this in during the next couple weeks. We'll do our best.


    Geoffrey McGill
    Founder
  3. #3
    Hi,

    is there any improvement on this thread?

    how could i use my script files?
    like

    <ext:XScript ID="XScript1" runat="server">
        <script type="text/javascript" src="Scripts.js" />
        </ext:XScript>

    thanks...
  4. #4
    Did this functionality ever make it into 2.0?
    The reason I ask is for performance optimization.
    Last edited by michaeld; Jul 09, 2013 at 9:15 PM.
  5. #5

    Updates?

    I just checked the Repository and did not find anything on this still.

    Performance measurement sites like YSlow and PageSpeed indicate a best strategy to move client code to the end of a page. I cannot do that given that I have to call Ext.Net functions where the htmlbin renders them, and thus keep includes in order to address any calls of the ext.net library.

    Anyway, that's why this feature is a big win if 2.X can do that for me.
  6. #6
    Performance measurement sites like YSlow and PageSpeed indicate a best strategy to move client code to the end of a page.
    It is not required with Ext.Net because UI is built in Ext.onReady event (when all resources are loaded and DOM tree is ready) therefore moving scripts to the end will give you nothing
  7. #7
    Quote Originally Posted by Vladimir View Post
    It is not required with Ext.Net because UI is built in Ext.onReady event (when all resources are loaded and DOM tree is ready) therefore moving scripts to the end will give you nothing
    I believe what you're describing is execution order, not load (thus compilation) order. The reason the profiling services recommend moving javascript loads to the end is to allow objects in the dom to be made available sooner. Granted that makes more sense in a non-ajax environment where all the dom is not rendered in runtime, but there are other reasons in SEO as well. For instance, I have a number of public pages that use content sections that are not rendered dynamically on the client-side so crawlers can read the critical text and terms close to the top of the page.

    Of course, I can move the ResourcePlaceHolder for ScriptFiles to the end, but the problem this causes is compilation order will fail if I have any xscripts in the htmlbin of any objects that refer to Ext objects or calls. In other words, they'll reference libraries that won't have been loaded yet.

    The only way to get this all to settle is getting xscript objects to be rendered at the end of the page (or at a placeholder after the scriptfiles placeholder). Linked would be even better.

    Moreover, its probably easier and faster to minify all of the javascript code in the stream as one blob instead of multiple if and when that functionality becomes available... which I think was part of this original thread suggestion.

    The best implementation would be to minify in ext.net internally. ASP.NET 4.5 has features to do this but none that I know I can work out of XScripts given the way you've implemented the write streaming engine.
    Last edited by michaeld; Jul 17, 2013 at 5:57 AM.
  8. #8
    Hi @michaeld,

    Thank you for the details.

    As far as I can understand that relates to this thread.
    http://forums.ext.net/showthread.php?25742

    It looks that we were able to achieve the requirement.

    Please clarify do you still expect something from us on this topic?

Similar Threads

  1. XScript with mcv3 razor
    By zhdl in forum 2.x Help
    Replies: 3
    Last Post: Aug 27, 2012, 4:05 AM
  2. [CLOSED] Xscript
    By jeybonnet in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Jan 19, 2011, 8:27 PM
  3. [CLOSED] InitScriptMode Linked
    By jeybonnet in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Oct 29, 2010, 1:38 PM
  4. [CLOSED] InitScriptMode
    By flaviodamaia in forum 1.x Help
    Replies: 6
    Last Post: Oct 23, 2010, 1:58 AM
  5. [CLOSED] InitScriptMode
    By jchau in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Mar 09, 2009, 4:03 PM

Posting Permissions