views:

56

answers:

3

Hi there,

what is the recommended place to put .js files - not really talking about jquery etc.... but my own custom js files..

The scripts directory seems to contain ajax, jquery etc... So is this the correct place?

OR would a better place be COntent?

I also was doing a search and saw some arguments for placing the JS files in the VIEWS directory - but is it supported?

Any ideas or comments really appeciated

Is there a document that outlines what each directory should be used for ?

I was thinking of placing my images like this Content/Images

Thanks again

+3  A: 

I think that as far as .js files are scripts, then you should put them into Scripts folder. If you are worried about mixing your own scripts with jquery and all that microsoft stuff, then just put them into separate subfolders.

ŁukaszW.pl
+3  A: 

You'd only want them in the Views directory if you were dynamically creating scripts based on data from the controller. This approach isn't great - you should try and separate Javascript from Html.

Otherwise, Scripts is the best place for them.

Tim
A: 

I think Scripts folder is the best choice. Don't put them into Views folders, because when you want to use an existing script in a view folder; it became a nightmare.

Edit: I had a mistake and wrote Content folder. I corrected it now.

bahadir arslan
Why content and not the Scripts? Isn't it the best choice?
ŁukaszW.pl
I thought Content equals to scripts. I only compaired with Content and Views directories, not sub directories. Of course Content\Scripts is best choice. If you look again, i don't say anything about Scripts folder.
bahadir arslan
No.. By default Scripts and Content folders are separate siblings not parent-child.
ŁukaszW.pl
Yes you are right. This is my mistake. I was wrong.
bahadir arslan