Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

$4.95 Windows Hosting at Webhost4life.com
  Need Help?  
Professional technical support for DotNetNuke is available from DotNetNuke Corporation.
 


  Ads  
WebHostForAsp.net
 


  Sponsors  

Meet Our Sponsors

DataSprings - Great Ideas. Always Flowing.
R2integrated - formerly bi4ce
Jango Studios - Skins, Modules and Hosting for DotNetNuke
eUKhost.com is commited to offer exceptional UK Windows Web Hosting solutions with quality 24x7 technical support.Our plans support ASP.Net, ASP, ASP.NET Ajax extensions, XML, MSSQL, MySQL, PHP,DNN, multiple domains and Shared SSL as standard.
SmarterTools
The Official Microsoft ASP.NET Website
 


DotNetNuke Forums
 
  Forum  DotNetNuke® Pro...  ClientAPI Compo...  addListener
Previous Previous
 
Next Next
New Post 4/16/2008 1:42 PM
User is offline jfs67
33 posts
10th Ranked


addListener 

I am presently using the YAHOO.util.Event class to manage some onunload events.

 

var pupped = YAHOO.util.Cookie.get("pupped");
            if( pupped == null || pupped == 'undefined') {                             
                YAHOO.util.Event.addListener(window, window.onbeforeunload ? 'beforeunload' : 'unload', function(e) {           
                    var y = YAHOO.util.Event.getPageY(e);
                    var surveyCompleted = <%=SurveyCompleted%>;
                    if (surveyCompleted == false && y <= 0) {
                        var x = YAHOO.util.Event.getPageX(e);
                        if (x > 20) {    //x has coordinates in IE. we can omit the back button click.
                            showPopup();
                        }else if (x <= 0){ //x is always "0" in FF. we cannot omit the back button click.
                            showPopup();}
                    }
                });
            } else { removePopupListener(); }

 

I presently do not see a way to handle this with the DNNClientAPI, but if there is a way to try I would like to know of this.  Any advice?  YUI is simply awesome and the code works perfectly in IE and FF.  The only concern is that if I did miss a way the DNNClientAPI may do the same, we could avoid uploading more js.

 
New Post 5/6/2008 10:54 AM
User is offline Jon Henning
1571 posts
www.codeendeavors.com
5th Ranked










Re: addListener 

Not sure what part of this you are struggling with, the cookie or the event handler.  Both can be done with the ClientAPI and the MSAJAX framework (which the ClientAPI will require in the next release).

MSAJAX allows you to attach events via the $addHandler global method.  The clientapi has a dnn.dom.attachEvent method, which has the following defined in its intellisense for the next release.

            /// <summary>
            /// Attatches an event to an element. - you are encouraged to use the $addHandler method instead - kept only for backwards compatibility
            /// </summary>
            /// <param name="ctl" type="Object">
            /// Control
            /// </param>
            /// <param name="type" type="String">
            /// Event name to attach
            /// </param>
            /// <param name="fHandler" type="Function">
            /// Reference to the function that will react to event
            /// </param>
            /// <returns type="Boolean" />  

Accessing cookies is straight forward.  you can either interact with the browser directly or I have helper methods in the ClientAPI.

dnn.dom.getCookie, dnn.dom.setCookie, dnn.dom.deleteCookie

 

 


 
Previous Previous
 
Next Next
  Forum  DotNetNuke® Pro...  ClientAPI Compo...  addListener
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, 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 DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


Bring2mind
Document Centric DNN Module Solutions
www.bring2mind.net
WEBPC™ DotNetNuke® sites for Small Business
WEBPC™ are internet consultants and web hosters catering to the small business market.
www.webpc.biz
Perpetual Motion Interactive Systems Inc.
A solutions company specializing in Microsoft enterprise technologies.
www.perpetualmotion.ca

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP