Sign In  |  Register
 
 DotNetNuke Powered!
DotNetNuke Support Forums

Add Javascript to body tag

Rate this topic:

Please Register to post a reply.
Another benefit of registration is the ability to subscribe to and recieve notifications of new posts.

AuthorMessages
lynngrin
Posts:91



12/17/2007 6:52 PM  

Hello John

How do I insert a body onunload to the body tag e.g. followed by some javascript?

<script type="text/javascript">
//
Javascript content here

//]]>
</script>

Thanks

Lynnn


www.drivewaydesign.eu For A Dream Driveway

www.a2zdom.com Domain name matters


John Mitchell
Posts:3084



12/17/2007 8:22 PM  

Hi Lynn,

This thread should help :

http://www.dotnetnuke.com/Community/Forums/tabid/795/forumid/108/threadid/94585/scope/posts/Default.aspx

 

lynngrin
Posts:91



12/17/2007 8:44 PM  
Thanks John

I was looking for that post for ages, I must have by passed it in the belief that it didn't exist after all.

www.drivewaydesign.eu For A Dream Driveway

www.a2zdom.com Domain name matters


tigris7
Posts:18



01/30/2008 4:04 PM  
Man... thanks sooooooo much for that info. This was killing me.
tigris7
Posts:18



01/31/2008 10:16 AM  

I am attempting to pass a variable to clients side script,edit the value, and return it to server side. To start with, for testing, I did the following in the server side:

If ClientAPI.BrowserSupportsFunctionality(ClientAPI.ClientFunctionality.DHTML) Then

    ClientAPI.RegisterClientReference(Page, ClientAPI.ClientNamespaceReferences.dnn)

    ClientAPI.RegisterClientVariable(Page, "Of", "TestValue", True)
    DNNClientAPI.AddBodyOnloadEventHandler(MyBase.Page, "GetURL()")   

End If

So this calls function GetURL() on the clientside in the page load server side event. In GetURL() I have:

function GetURL()

{

    var sOF = dnn.getVar('Of');

    //alert('Value is: ' + sOf);

    //perform manipulation on sOf...   

    //dnn.setVar('r_sOf", sOf);

}

    'var sOF = dnn.getVar('Of');' alone causes a  javascript error

What am I doing wrong? For testing I put GetURL() in the dnncore.js file and I am calling it from admin/security/signin.ascx

eyitomi
Posts:44



03/06/2008 6:47 AM  

Hi Lynn,

  I think you should be able to help me out. I would like to know which file to edit the javascript on my DNN site? Also do you know where to control the CSS in DNN?

 

Thanks in advance

eyitomi
Posts:44



03/06/2008 6:47 AM  

Hi Lynn,

  I think you should be able to help me out. I would like to know which file to edit the javascript on my DNN site? Also do you know where to control the CSS in DNN?

 

Thanks in advance

eyitomi
Posts:44



03/06/2008 6:47 AM  

Hi Lynn,

  I think you should be able to help me out. I would like to know which file to edit the javascript on my DNN site? Also do you know where to control the CSS in DNN?

 

Thanks in advance

lynngrin
Posts:91



03/07/2008 4:54 AM  

Hello eyitomi

You can control a lot of your css styling using default.css or your skin.css   However, if you require specific styling you might consider using the FCKEditor or perhaps linking to a specialstyle.css file in your file manager or a new folder created for the purpose in your site root.

You can add a javascript link directly to your page and control it at the site of the folder/myjavascript.js location  - perhaps witin your skin or file manager.

If you want to know where to edit the javascript for all your DNN I suggest you look in your site root.

 

I hope that helps.

Lynn

 


www.drivewaydesign.eu For A Dream Driveway

www.a2zdom.com Domain name matters


eyitomi
Posts:44



03/07/2008 5:39 AM  

Hi Lynn,

  Many thanks for this!!! It's been very helpful. Also, We bought a menu module which is fantastic. But for some reason, the default DNN menu is still at the top of the page and I was wondering how to hide or get rid of that menu?

 

Kind Regards,

Eyitomi

lynngrin
Posts:91



03/07/2008 6:27 AM  

Hi Eyitomi

Find the default DNN menu located in your skin and remove it, re-install or ftp the edited skin and refresh your page. Make sure that you have an alternative means of navigation on the page you are using.

 

Lynn


www.drivewaydesign.eu For A Dream Driveway

www.a2zdom.com Domain name matters


eyitomi
Posts:44



03/07/2008 8:45 AM  

Hi Lynn,

  I wish I knew where to do this. Can you help me please? I don't know where everything is located as there are a lot of files and I don't know where to look at for the files.

 

Thanks In Advance,

Segun

lynngrin
Posts:91



03/07/2008 10:59 AM  

Hi Segun

 

The main javascript files for your DNN is located in the root folder named js. I suggest you make a back up before you edit anything.

If you are referring to your skin that you are trying to locate:

If not located on your PC - 

In your site root folder navigate to:

>Portals >_default  for host skin (or 0 )>Skins >SkinFolderName >NameOfSkin.ascx

Edit accordingly.

Lynn


www.drivewaydesign.eu For A Dream Driveway

www.a2zdom.com Domain name matters


Please Register to post a reply.
Another benefit of registration is the ability to subscribe to and recieve notifications of new posts.

Forums >DotNetNuke Support >General-DNN-Help > Add Javascript to body tag



ActiveForums 3.7
Visit our Store for great DotNetNuke Modules and Skins
DNNMasters Sitemap/Google Sitemap 3.0

Item codeSM3-01
Price$29.00
Product Information 
DotNetNuke CSS NavMenu 3.3 (Developers)

Item codeCSSNM33DEV
Base Price$149.00
Product Information 
Snapsis PageBlaster 3.3.2 for DotNetNuke - Professional Edition

AuthorJohn Mitchell
Base Price$79.00
Product Information