Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8230545
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T17:10:34+00:00 2026-06-07T17:10:34+00:00

Simple question. Does AMD DOJO implementation support these type of declarations? text!./plain.html define([../Widget,text!./plain.html], function(Widget,plain){

  • 0

Simple question.

Does AMD DOJO implementation support these type of declarations?

  1. text!./plain.html

    define(["../Widget","text!./plain.html"],
      function(Widget,plain){
      return new Widget({name:"mainApp",template:plain});
    }); 
    
  2. Load non-modules, let’s say underscore.js

    require(['dir/underscore.js'], function(){
     _.reduce ...
    });
    
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T17:10:36+00:00Added an answer on June 7, 2026 at 5:10 pm

    Yes, but the precise syntax is different to that used in the question.

    • The Dojo Loader (1.7)
      • Plugins
        • dojo/text

    The plugin for loading character data is dojo/text.

    The extension should not be used when loading a JavaScript library and the location of the file is set via either a relative of the dojotoolkit base or a packages location declaration in dojoConfig:

    require(['underscore'], function( _ ){
     _.reduce ...
    });
    

    Configure the namespace in the Dojo configuration to avoid messy import paths – see dojoConfig in the loader documentation.

    Also, consider using the dojo/global module and/or defining a Dojo module as a wrapper for Underscore.js:

    //_.js
    define(['dojo/global', 'underscore'], function(global){
      return global._
    });
    

    With the above consideration, you must have loaded the actual .js file manually. If in conjunction with the dojo/text plugin, one would create a wrapper which also loads the required JS and evaluates it, following could do the trick.

    /var/www/dojo-release-1.7/ext_lib/_.js – this sample file is hierachially placed in a library namespace, alongside dojo, dijit, dojox

    define(['dojo/global', 'dojo/text!./Underscore.js'], function(global, scriptContents){
      global.eval(scriptContents);
      return global._ // '_' is the evaluated reference from window['_']
      /** 
       * Alternatively, wrap even further to maintain a closure scope thus hiding _ from global
       *  - so adapt global.eval to simply eval
       *  - remove above return statement
       *  - return a dojo declared module with a getInstance simple method
      */
      function get_ () { return _ };
      var __Underscore = declare('ext_lib._', [/*mixins - none*/], {
            getInstance: get_
      });
      // practical 'static' reference too, callable by 'ext_lib.getInstance' without creating a 'new ext_lib._'
      __Underscore.getInstance = get_;
      return __Underscore;
    });
    

    A sample of defining own modules using declare here
    Note: this code is untested; feel free to add corrections.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Simple question - why does the Decimal type define these constants? Why bother? I'm
Simple question: does SQLite support FULL-TEXT searches? If not, is there any way I
Just have a simple question. Does CR11 R2 has CONFIDENCE function from Excel? http://support.microsoft.com/kb/828124
this is a simple question: does Silverlight (3.0?) support this kind of encoding? Encoding
A simple question. Does this version support generators? I wanted to test out using
I have a simple question. Why does this not work? type Test1() = member
I got a simple question: Why does Eclipse scream about implementing these two interfaces?
Simple question: does the Java memory/synchronization model guarantee atomic pointer writes? That is, if
Simple question - what does this actually do? var oq = (ObjectQuery<TEntity>)L2EQuery; return ExecuteFirstorDefault<TEntity>(oq,
* Simple question : Why does this function throw an exception when evaluated ?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.