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 ExtensionsModulesModulesjs file not foundjs file not found
Previous
 
Next
New Post
2/28/2012 6:28 PM
 

Hi, i have a boring error with the path of my js scripts file.
The file is physically in this path: c:\inetpub\wwwroot\dnn\desktopmodules\module\resources\scripts but when i try to call it from my module_view.ascx i can't found it.
I try to call it in this way:
<script type='text/javascript' src='desktopmodules/module/resources/scripts/modulejslib,js'></script>
<script type='text/javascript' src='/desktopmodules/module/resources/scripts/modulejslib,js'></script> 
<script type='text/javascript' src='resources/scripts/modulejslib,js'></script> 
but none seems to work

What is the correct way to call a script file?

Thanks for the help
Emiliano

 
New Post
2/29/2012 7:06 PM
 
it depends - if the script is in a folder off your module then a relative path (i.e. "/resources/scritps/modulejs.js") would be fine - note: many times it's better to add it via a server instruction as you can use the ~ to calculate the path. If you're targetting 6.1.0 or higher you might consider using ClientResourceManager.RegisterScript or even the DnnJsInclude control so that you js will be combined and minified

Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
New Post
3/1/2012 3:32 PM
 

Thank you for the tip, i use the ClientResourceManager.RegisterScript to register my js file.
 
New Post
6/14/2012 9:32 PM
 

Hi Cathal, you've mentioned that "... DnnJsInclude control so that you js will be combined and minified".

I'm using the control, but it neither combines nor minifies my scripts, am I missing something?

 
New Post
6/14/2012 10:41 PM
 

If you are developing locally in 'debug' mode, you won't need to deal with this but in production sites or situations where your web.config is not in debug mode your javscript files and css updates will not be added/recognized until the version is increased. There are certain times this happens for your automatically (possibly during module install, saving portal.css via site settings, etc.) but there is also a host option to force a version bump too. Until the version is increase somehow, CDF (the client dependency framework) will not recognize the js/css file additions/updates. 


Chris Paterra

Get direct answers to your questions in the Community Exchange.
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesjs file not foundjs file not found


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