Forum Moderators: open

Message Too Old, No Replies

Cloaking Javascript?

Can external js files be cloaked?

         

Philosopher

4:29 pm on Jul 26, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm just curious if it is possible to cloak an external JS file. I've been cloaking here and there for a while, but haven't ever tried.

It's easy enough to setup my script to do so, but it's getting the correct mime type sent by the server as with my current setup the server sends a text/html header.

Brett_Tabke

4:34 pm on Jul 26, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Sure - why not?

Philosopher

4:39 pm on Jul 26, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Well, I guess the question is, how do you get the server to both parse the js file AND send the correct mime type?

Generally, for an html file I would add

AddType text/x-server-parsed-html .html

to the .htaccess file, but obviously if I use the above command to get js parsed, then the server associates it with the mime type of text/html instead of application/x-javascript