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 StartedNew to DNN Plat...New to DNN Plat...Adding JavaScript In DNN PageAdding JavaScript In DNN Page
Previous
 
Next
New Post
5/2/2014 1:39 PM
 
Michael Summers wrote:

It is so absurd going to hunt on the web on how to put JavaScript in a html module. This coding should have been done by the DEVELOPERS in DotNetNuke BETA 000001. i have no clue on how to create a custom module like Sibabrata Dash suggested. HTML and JavaScript go hand in hand. We are not in the 1980's with static HTML. we are in the year 2014

 the automatic removal of javascript in html modules is actually an issue with the html editor and not dnn -in this case telerik. However this is standard practice as all editors (fck, radeditor, ftb etc.) do it, as allowing a user to enter javascript is very dangerous as that javascript can perform many actions that potential hackers would like such as stealing authentication credentials of any user who views the page (e.g. the host user), or redirecting the site to a cloned version of itself where a hacker can then perform any action (i.e. a phishing attack). Whilst adding javascript requires a little more work, it is more secure, and hopefully means people will not accidentally leave their sites open to hackers.


Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
New Post
7/21/2014 8:26 PM
 

Mona 2010,

I just struggled with this and found that it is the rich text editor.  Choose "Basic Text Box" and then choose HTML. You can then insert your script tags and JavaScript code.  I added an Easy Slider into an HTML module using that method.  I also found that I could add the Easy Slider code/css/images folders to a subfolder to the js folder.  This way I can reference in other portals.  

Note that if you switch back to the rich text editor it will strip out the script tags. So do not mix script and rich text in the same HTML module.

Hope this helps!

 

 
New Post
7/23/2014 6:34 PM
 

Found some more issues:

1. AnythingSlider.js does not like the jquery.js located in \resources\libraries\jquery, but if the CDN version is used it works okay.  FYI...in Host Settings --> Advanced Settings --> CDN Settings --> Use javascript libraries CDN? checked will result in the CDN URL for Google jQuery 1.9.1 being inserted on each page.  There is no text box to insert this. 

2.  On at least two occasions when I inserted script code into a HTML Module using the Basic Text Box  --> Text option, the script was convert to include <br> </br> elements, so to avoid this I make sure to use the Basic Text Box --> HTML option.

3. Source URLs changed to /portals/... when I used /js/anythingslider/js.  Again not sure what post text processing is going on here, but sure wish we had an option to turn it off. The really weird thing it that it does not seem to be consistent, at least I have not learned the pattern yet.

 
New Post
7/23/2014 7:01 PM
 

Adding to the above...

4. The HTML option compresses the HTML, so be sure that any single line // comments are removed or replaced with block comments  /* */.   I spent several minutes trying to figure out why one section of code was not working until I realized in viewing the source for the page that the section of code had been compressed so that the single line comment was now commenting out the rest of the code.

FWIW: Here are my 2 cents on the use of JavaScript in the HTML module.  You have to make provision for it in the platform or lose to the flexibility of other platforms like WordPress.  If security is a concern then provide a way for only designers and admins to make those changes and not regular users.  Perhaps add a Code Module and limit that to hosts/admins/designer etc.

 

 
New Post
3/9/2016 1:26 AM
 
Hi,

I have a dnn module with a div inside. Through JavaScript I am trying to add a form and other elements inside the div in the dnn module. But since another form submit inside the dnn form doesn't work I am not able to proceed further. There are many complicated logics in my JS snippet for the validations and Submit click which I cannot change. So is there a way to insert this form within my JS snippet into the dnn module div without editing the JS snippet.

Waiting for your reply soon.
 
Previous
 
Next
HomeHomeGetting StartedGetting StartedNew to DNN Plat...New to DNN Plat...Adding JavaScript In DNN PageAdding JavaScript In DNN 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