Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesCorrect way to include JavaScript files.Correct way to include JavaScript files.
Previous
 
Next
New Post
8/26/2011 2:30 AM
 
Hi,

Outside DNN, what I always do when developing is have a "Scripts" folder in which I nicely organize my javascript (jquery) "Helper" files...normally one per page.

Starting with DNN, I'd like to stay on that route and was wondering what would be the correct way including these files within a module / control.

I've seen some samples including them from the code behind, but IMO that is a bad practice.  (maybe just me, but let's not go into that)

Just stuck with the path actually, and while I'm sure something like "src='~/DesktopModules/MyModule/Scripts/WhateverHelper.js'" will work, I thought I'd just ask.
 
New Post
8/26/2011 8:00 AM
 
the normal way would be to include them with your module and use relativepaths (e.g. "/scripts" - though src="~/DesktopModules/MyModule/Scripts/WhateverHelper.js'" is fine also. Another alternative is to add them in your skin and use the <%=SkinPath %> variable to dynamically inject the skin location

Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
New Post
8/26/2011 9:08 AM
 
hmm...for some reason that just does not work (i know....it should!)

will circle back to it, and just keep my script inside my view for now.
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesCorrect way to include JavaScript files.Correct way to include JavaScript files.


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out