INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS
Come Join Us!
Are you a
Computer / IT professional?
Join Tek-Tips now!
- Talk With Other Members
- Be Notified Of Responses
To Your Posts
- Keyword Search
- One-Click Access To Your
- Automated Signatures
On Your Posts
- Best Of All, It's Free!
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.
Partner With Us!
"Best Of Breed" Forums Add Stickiness To Your Site
(Download This Button Today!)
"...This is easily the most helpful website I've ever used, and this is the best forum with the quickest response time bar none...."
Where in the world do Tek-Tips members come from?
Syntax Colouring in .JS, .INC and other files
Posted: 23 May 01
If you want syntax colouring (coloring), pop-up property lists etc. then you need to use the HTML Editor for the source files:
The following solution was provided by Dan_Guest ! It works and is very easy...
Do what they say to do here for a .js file (instead of a .htc file that the article is concerned with):
[ie set the default editor for files with extension .js (or whatever) to HTMLEditor - via the Open With... dialog.]
Then add the line:
as the first line of your .js file
There you go, you now have colored keywords etc. when you view the source of the .js file. This should also work for other script file extensions such as .vb (where the top line would be:
NOTE: This top line tells the HTML Editor which language to use - but MUST be prefixed with a comment character of that language (// or ') - else it will error at runtime.
NOTE 2: .js, .vb / .vbs and .inc files will be displayed as plain text in any browser that navigates to that file. To HIDE these files from prying eyes, simply change the file extension to .ASP.
NOTE 3: Include files do not need this top-line comment - as they should already have any language tags in them.
Back to Microsoft: Visual InterDev FAQ Index
Back to Microsoft: Visual InterDev Forum
Join Tek-Tips® Today!
Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.
Here's Why Members Love Tek-Tips Forums:
- Talk To Other Members
- Notification Of Responses To Questions
- Favorite Forums One Click Access
- Keyword Search Of All Posts, And More...
Register now while it's still free!
Already a member? Close this window and log in.
Join Us Close