Using Requirejs in Javascript

Discussion in '.NET' started by sshankaran, Feb 16, 2011.

  1. sshankaran

    sshankaran

    Joined:
    Feb 16, 2011
    Messages:
    1
    Hi,

    I am using requirejs in my js files.
    If I have 3 pages and each page depends on more than one js files.For each page I have a master js file and in that I am specifying the other scripts to be loaded.
    For Example:

    Master1.js will have
    define(["abc","jquery-pubsub","x"],function(){ Here I will write my code}

    Master2.js will have
    define(["xyz","jquery-ElementValidator","y"],function(){ Here I will write my code}

    Master3.js will have
    define(["wpx","jquery-Printelement","dff"],function(){ Here I will write my code}


    My Question is

    I want to centralize the code where in all the define() are placed, so that I can avoid each developer doing that page, worry about the order and what scripts to be loaded. I have any new scripts, I can just go the central location and add the scripts pertinent to the page.

    Ex: If I have a master page, I should be able specify the scripts to be loaded for each page when the page is loaded, instead of loading all the scripts at time.

    Any idea is highly appreciated,
    Thanks
    sshankaran, Feb 16, 2011
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. confused
    Replies:
    3
    Views:
    380
    David Carlisle
    May 26, 2007
  2. confused
    Replies:
    3
    Views:
    428
    Pavel Lepin
    May 28, 2007
  3. chrisspencer02@yahoo.com

    Extract links from Javascript (not using Javascript)?

    chrisspencer02@yahoo.com, May 26, 2006, in forum: Javascript
    Replies:
    8
    Views:
    145
    Thomas 'PointedEars' Lahn
    May 30, 2006
  4. parez
    Replies:
    0
    Views:
    119
    parez
    Sep 11, 2007
  5. Abhishek
    Replies:
    5
    Views:
    204
    David Mark
    Aug 7, 2008
Loading...

Share This Page