Skip to main content
Participant
August 22, 2008
Question

ext1.ext2 ?

  • August 22, 2008
  • 2 replies
  • 654 views
How can I get Dreamweaver to recognise .js.php files as .js files ?

Regards,
OGLES
This topic has been closed for replies.

2 replies

Inspiring
August 23, 2008
OGLES wrote:
> How can I get Dreamweaver to recognise .js.php files as .js files ?

You can change how Dreamweaver handles file extensions by reading this:
http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_16410

However, it only applies to the "last" file extension, that is if you change .php files to be read as JavaScript files, then you'll lose PHP support, as Dreamweaver can associate one file extension with one document type.

If you do not specifically need the PHP support in the files, then you should only use .js files only. Otherwise, within Dreamweaver you might get what you're looking for by adding an open script tag above your JavaScript code and a closing script tag at the end of your content, and then comment them out with // comments, like:
//<script>
function demo(){
alert('');
}
//</script>

The comments will prevent the browser from "seeing" the script tag, but Dreamweaver will see it as a real script tag because it is seeing the file as part of the HTML of a PHP page.

FYI: While this forum is named Dreamweaver Extensions, the extensions part of it does not have to do with file extensions, rather extensions refers to add ons, such as those found at the Adobe Exchange:
http://www.adobe.com/cfusion/exchange/

General Dreamweaver and web questions should be asked in the Dreamweaver General forum:
http://www.adobe.com/cfusion/webforums/forum/categories.cfm?forumid=12&catid=189&entercat=y
and dynamic server coding related question can be asked in Application Development forum:
http://www.adobe.com/cfusion/webforums/forum/categories.cfm?forumid=12&catid=263&entercat=y



--
Danilo Celic
| http://blog.extensioneering.com/
| WebAssist Extensioneer
| Adobe Community Expert
OGLESAuthor
Participant
August 23, 2008
quote:

//<script> function demo(){ alert(''); } //</script>


Genius, thanks ! Just what I needed..
Inspiring
August 23, 2008
Rename it, deleting the .php extension. I always put my javascript files in
a subdirectory named scripts and have never had this problem.

HTH

Steve

"OGLES" <webforumsuser@macromedia.com> wrote in message
news:g8mjuq$pp$1@forums.macromedia.com...
> How can I get Dreamweaver to recognise .js.php files as .js files ?
>
> Regards,
> OGLES