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...Skins, Themes, ...Skins, Themes, ...adding my own javascriptadding my own javascript
Previous
 
Next
New Post
10/30/2007 12:20 PM
 

hallo the people,

I built this skin based on a .html template, as described in a good tutorial. Now I have a problem, my html file is a template of what will be shown between the <body> and </body> tags. So I wonder: how do I accesss the head section, for example to add some javascript? And can I modify the body tag? Because I need to make a javascript "onload". Do I have to build my skin in another way to access the head section and the body tag? I know there is a way of making skins based on a ascx file, rather then a html file, but this is quite misterious to me.

Thanks for advice

 
New Post
10/31/2007 3:40 AM
 

IMHO there is not much difference between html and ascx, I prefer the latter because I find it easier to change the properties of controls.

In ascx files you can add js code between script tags in the page. You can do something like this: 

<  script type = "text/javascript"   >
wndow.onload = function() { ....}

<  /  script  >

Peter


Peter Schotman
Cestus Websites voor DotNetNuke oplossingen in Nederland
Contact us for your custom design and skinning work.
 
New Post
11/1/2007 2:52 AM
 

well, I have a .js file with some function. In a normal static website I would put <script type="...." src="..."></script> into the head section of my page, and then I would change the <body> tag into <body onload=....>.... The problem with dnn is that I don't know how to access the <head> and the body tag.... Yes I can write javascript code into the html template, but the template doesn't contain <body> and <head> tags because these are generated automatically by dnn (as far as I understod).

 
New Post
11/1/2007 8:53 AM
 

hallo the people, I found out that I can modify the rest of the page (head, etc) by editing the file default.aspx. The problem is that this default.aspx applies to all the portals and not all the portals should have the same javascipts in the head section. Any idea?

 
New Post
11/1/2007 9:05 AM
 

I normally put my scripts at the bottom of my skin files.  I find the scripts to be more consistent that way.  And if you need one of the scripts to be called onload, you can use the JavaScript accessor to do that:

window.onload


Will Strohl

Upendo Ventures Upendo Ventures
DNN experts since 2003
Official provider of the Hotcakes Commerce Cloud and SLA support
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...adding my own javascriptadding my own javascript


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