0

Looking at some sample javascript code at http://alexgorbatchev.com/SyntaxHighlighter/manual/api/autoloader.html I see:

<script src="shCore.js" type="text/javascript"></script>
<script src="shAutoloader.js" type="text/javascript"></script>
<script type="text/javascript">
SyntaxHighlighter.autoloader(
 'js jscript javascript /js/shBrushJScript.js',
 'applescript /js/shBrushAppleScript.js'
);
SyntaxHighlighter.all();
</script>

In this example, what is a SyntaxHighlighter? a global variable? a singleton? a what?

asked Feb 18, 2012 at 12:40
0

2 Answers 2

2

Syntax highlighter might be an object literal with a method named all. This is generally done to organize functions into namespaces to avoid populating the global namespace. It might be defined as such: Check out this http://jsfiddle.net/PQbEU/2/

syntaxhighligter = {
 all: function(inputColor) {
 if (!inputColor) 
 inputColor= prompt("Enter a color");
 $('#all').css({
 background: inputColor
 });
 }
}
syntaxhighligter.all();​
answered Feb 18, 2012 at 17:16
Sign up to request clarification or add additional context in comments.

Comments

1
answered Feb 18, 2012 at 16:54

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.