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

HomeHomeGetting StartedGetting StartedInstalling DNN ...Installing DNN ...How do I add java script to my pageHow do I add java script to my page
Previous
 
Next
New Post
5/10/2013 2:44 AM
 

 

you can create a folder in  in dnn project and put all the js files to all folder and top of control put this path 

<script src="/DesktopModules/TestDotnetnukeprojec/Scripts/New.js" type="text/javascript"></script>

 

please  make sure that your path should start with DesktopModules then only this link would work

thanks 

Manish

 
New Post
5/10/2013 3:12 AM
 
Hi,

You can also add it from server side by using below code in Page_Init event handler.

HtmlGenericControl js1 = new HtmlGenericControl("script");
            js1.Attributes["type"] = "text/javascript";
            js1.Attributes["src"] = this.TemplateSourceDirectory + "/Scripts/test.js";
            Page.Header.Controls.Add(js1);

Here test.js file is under Scripts folder.

Thanks,
Avinash Kumar
Mindfire Solutions
 
New Post
5/10/2013 2:16 PM
 

I wanted to say thanks everyone for trying to help... I think in most cases the idea of putting the JavaScript in the Footer or Header of the text/html module is very workable... in this case the JWPlayer script had a few issues.

Mike, I really like your suggestion with the DigFlash module I tried it on a few of the major browsers and it worked great.  I really like how the player is keyboard accessible too.  I haven't tried it with a device that doesn't have flash support but your documentation sounds like that it covered too.  The only thing I can't figure out is how to center the player on the page.  If you know of a trick for centering I would love to hear from you.  If that can't be done it isn't a show stopper.  Very Nice!  

Regards,

Chris 

 
Previous
 
Next
HomeHomeGetting StartedGetting StartedInstalling DNN ...Installing DNN ...How do I add java script to my pageHow do I add java script to my page


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