Hi,
The doc of RequireJS
http://requirejs.org/docs/api.html - Section 1.2.7 -
Console Debugging points out that the code
*require('shCore').SyntaxHighlighter *
works only if module definition of *shCore* has been loaded into browser.
Assume that shCore.js follows module
pattern<http://www.adequatelygood.com/2010/3/JavaScript-Module-Pattern...
and the *absolute* URL of shCore.js is shCore_URL, then there are at least
2 ways to make your
code work.
1. Define a module named 'shCore' to use it later
* define( 'shCore', ['shCore_URL'], function(intermediate_var)
{
return intermediate_var;
});
require('shCore').SyntaxHightlighter;
*
2. Put all business code with shCore in a callback
* require( [ "shCore_URL"] , function(shCore)
{
var sh = shCore.SyntaxHightlighter;
//Business code with SyntaxHighlighter
});
*