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...Administration ...Administration ...Injecting Scripts into the HeaderInjecting Scripts into the Header
Previous
 
Next
New Post
9/27/2007 2:15 PM
 

I really am not clicking with something about using javascripting on my DNN pages. 

For instance, I have some code that I can work into a regular old HTML page using javascript in the header for say, rollover images.

Now, where/how would I place that code into the "header" of my DNN site?

I'd really appreciate some help on this one.  Thanks!


Chad Voller -- MCP, DNN Aficionado
Leapwise Media
View my View Chad Voller's profile on LinkedIn
 
New Post
9/27/2007 2:49 PM
 

You can either put that script reference in your skin, or you can use in specific pages using the Page Header Tags setting in the Settings for a specific page (within a <script> tag).  Does that make sense?

Hope it helps,


Brian Dukes
Engage Software
St. Louis, MO
866-907-4002
DNN partner specializing in custom, enterprise DNN development.
 
New Post
9/27/2007 3:26 PM
 

Ah, I never even knew that page header tags section was there!  Thank you very much!  I will go to work on using it there.  I appreciate it.


Chad Voller -- MCP, DNN Aficionado
Leapwise Media
View my View Chad Voller's profile on LinkedIn
 
New Post
9/27/2007 4:26 PM
 

Ok, so I tried in a test environment to put a javascript in a single page header in the Settings > Page Header Tags area.  I simply copied and pasted the javascript from the HTML <HEAD> section of my Dreamweaver HTML document, updated the page, and now I cannot edit the page.  It's not a big dea b/c it's a test environment.

However, I cannot delete the page, update any modules on the page, delete any modules, etc.  I cannot even delete the page from the Admin > Pages area in my test portal.  Weird.  Here's the script.

<script type="text/JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}-->

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>


Chad Voller -- MCP, DNN Aficionado
Leapwise Media
View my View Chad Voller's profile on LinkedIn
 
New Post
9/27/2007 4:31 PM
 

FYI, commenting out javascript doesn't do anything, browsers still read it if it is commented out (it is actually suggested that you comment it out so that browsers that don't read Javascript will see it as a comment, and others will read it without problem).  You would need to comment it out in the javascript with /*...*/ or //...

Anyway, is there a javascript error in your browser when you see the page?  Can you do into design mode?


Brian Dukes
Engage Software
St. Louis, MO
866-907-4002
DNN partner specializing in custom, enterprise DNN development.
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Injecting Scripts into the HeaderInjecting Scripts into the Header


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