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

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Module template to wrap JavaScriptModule template to wrap JavaScript
Previous
 
Next
New Post
1/26/2007 1:04 PM
 

I have been trying to prduce a simple module as a quick and easy methos of being able to customise JavaScript I use on existing sites I wish to port.

I picked on a simple Marquees script that uses a couple of Divs and is Initiated by a call to the window.onload=populateMarquee

This seemed to be straight forward enough so I added the code to load the script to the Private sub Page_Load 

Unfortunately this doesnt work - it seems the populat function isint called

I tried to see what was going on by viewing the page source generated and sving it as an htm file

This seems to run the JavaScript code perfectly well when it is viewed in Explorer

How do I get the window.onload funtion to fire or do i need to use a different method to do this from DotnetNuke

I have noticed some articles that suggest the preferred method is to ad the code entry point as an event - this appeals as I can write more modules to do a similar task (implmenting Javascript) and not have conflicts with initalising calls

 


Dave DNN 4.3.5 IIS - 6 ?? SQL Server 2005
 
New Post
1/26/2007 1:37 PM
 

just found part of the solution to my problem on

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

This seemed to work great but then on closer inspection I discovered that this does indeed trigger the function as required but the javascript code seems to only behave correctly when read in from a file - not quite what I had evisaged as I was hoping to allow certain parameters to be set and stored by the DNN interface


Dave DNN 4.3.5 IIS - 6 ?? SQL Server 2005
 
New Post
1/29/2007 9:27 AM
 

Have you had a look at the ClientAPI document (page 6)? 

Another example of this functionality in DotNetNuke is found in how it allows for
multiple client side functions to subscribe to the body.onload event. When DNN wants
to set focus to a control when the body loads it will do so by utilizing the
AddBodyOnloadEventHandler method.  

Public Shared Sub AddBodyOnloadEventHandler(ByVal objPage As Page, ByVal strJSFunction As String) objPage Page object being rendered strJSFunction Javascript function to call

This method is used in the SetFormFocus method found in the Globals.vb file.

ClientAPI.AddBodyOnloadEventHandler(control.Page, "__dnn_SetInitialFocus('" & control.ClientID & "');")

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Module template to wrap JavaScriptModule template to wrap 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