How to save init script when debug and attach it manually, if not a localhost?

  1. #1

    How to save init script when debug to attach it manually, if not a localhost?

    I use different js files (that contains #{some id} placeholders) for each aspx page and use ResourceManager.GetInstance().AddScript(script). But this approach slows down the page opening. Can I save the init file when it is generated during debugging on localhost and then attach it to page "manually" when it is not a localhost. Moreover, disable scripts generation on the published site.
    Last edited by gappov; Nov 13, 2012 at 9:26 PM.
  2. #2

    Hello!

    Hey, is there anybody there?
  3. #3
    At the moment, there is no way to automatically save the initialization <script> to a local file. You could however just manually view the Html > Source of the Page, the copy/paste the contents of the init script block into a separate .js file.

    But there is another problem... there is a way to disable the JavaScript files from rendering by setting RenderScripts="None", but there is no way to disable the initialization script from being sent to the page. This is something we would have to add a property for if you're interested.
    Geoffrey McGill
    Founder
  4. #4
    I do not want to save the init script locally (to user). I want it to save init script on the development machine (on local server), while debugging. And everything else I do. Can ResourceManager or other class return init script as string?
    My goal: put all scripts in the cache. I would like to have independently control of the script version (for example by adding a version number in the js file URL ).
    I prefer to have a script file for each aspx. When we publish, or just while debugging, these scripts are compressed and saved, for example, in "jsmin" folder. On the page is embedded the path switch: if not localhost then take "jsmin" folder
    In this case there is no need to generate scripts on the server. for highly loaded sites or for old servers, it may be actual

    Is there a possibility to render my own scripts separately from the init script and save it wherever I want? These scripts contain #{some id-s}

    How to freeze random number in this URL /extnet/extnet-init-js/ext.axd?efbe2c53e3d84e5580aa568d625c73dd ?
    Last edited by gappov; Nov 14, 2012 at 5:44 PM.
  5. #5
    What are the opinions?
  6. #6

    Solved

    But the solution does not satisfy me.
    I put all my custom script inside xstsript blocks. The pages opening time fell by 5 times. Conclusion: usinf of AddScript is dangerous.
    But as it is now to minify (compress) the scripts?
    And anyway, why should these scripts are located in the body of the page? They must be in a separate file, to put it to the browser cache.
    But what about the # {} ?

    And it is unfortunate that I talk to myself like crazy... >;[

Similar Threads

  1. [CLOSED] Call init script manually
    By fpw2377 in forum 1.x Legacy Premium Help
    Replies: 7
    Last Post: Sep 12, 2012, 5:52 AM
  2. [CLOSED] Weird error with init script being called twice from IE
    By PhilG in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Jan 13, 2012, 10:10 AM
  3. [CLOSED] How to include Ext JS Script manually
    By Hari_CSC in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Jul 23, 2010, 12:24 PM
  4. Replies: 4
    Last Post: Jul 09, 2009, 3:47 PM

Tags for this Thread

Posting Permissions