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

HomeHomeUsing DNN Platf...Using DNN Platf...Using Modules a...Using Modules a...JavaScript/HTML code not displaying in HTML ModuleJavaScript/HTML code not displaying in HTML Module
Previous
 
Next
New Post
6/12/2015 12:56 PM
 

I was asked to see if I could whip up some JavaScript code that would allow us to display a message about whether our  Urgent Care was open today and if not when it would re-open.  I put together some code that works in JSFiddle (https://jsfiddle.net/davelalande/gob0...) but not in our DNN website?  https://hannibalregionalmedicalgroup....

I have the RemoveScripts unchecked in the editor and have scripts that work on one of our other sites.  I'm using the header for the script code.  Not sure what's going on here?

Any words of wisdom would be appreciated.

Thanks, Dave

 
New Post
6/12/2015 2:15 PM
 
IIRC, ALL scripts are removed from the HTML module, no matter what your editor settings are.

Put your code in the module's header or footer via the Module's Settings.
 
New Post
6/12/2015 2:55 PM
 
Mike Riley wrote:
IIRC, ALL scripts are removed from the HTML module, no matter what your editor settings are.

Put your code in the module's header or footer via the Module's Settings.

I'm using the header for the script code.

 
New Post
6/12/2015 3:11 PM
 

I can see the script code in the browser "View page source".

<!-- Start_Module_660 --><script>
var today = new Date()
var open = ("We're open today from 9am - 5pm.");
var closed = ("We're closed and will open again tomorrow 9am - 6pm.");
if (today == 0) display.innerHTML = 'closed';
if (today.getHours() >= 9 && today.getHours() < 18) {
display.innerHTML = open;
} else {
display.innerHTML = closed;
}
</script><div id="dnn_ctr660_ModuleContent" class="DNNModuleContent ModDNNHTMLC">
<div id="dnn_ctr660_HtmlModule_lblContent" class="Normal">
<div><span id="display"></span></div>
</div>
</div><!-- End_Module_660 --></div></div>
 
New Post
6/12/2015 3:25 PM
 
Console shows:

ReferenceError: display is not defined
https://hannibalregionalmedicalgroup....
Line 450

English-Polish translations, one-to-one English/Polish tutoring, Windows server management, website development - HTML/JS/CSS/Razor
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Using Modules a...Using Modules a...JavaScript/HTML code not displaying in HTML ModuleJavaScript/HTML code not displaying in HTML Module


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