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  |  

PortalWebHosting
  Need Help?  
Professional technical support for DotNetNuke is available from DotNetNuke Corporation.
 


  Ads  
r2i.ntegrated
 


  Sponsors  

Meet Our Sponsors

The Official Microsoft ASP.NET Website
Portal Webhosting - Hosting For Developers
Red-Gate Software
MaximumASP
SourceGear - Tools for Developers
.: CounterSoft :.
 


DotNetNuke Forums
 
  Forum  DotNetNuke® Pro...  ClientAPI Compo...  Prototype or Mootools with DNN ClientAPI?
Previous Previous
 
Next Next
New Post 2/16/2007 1:36 PM
User is offline Charlie Solomon
23 posts
www.beldintechnologies.com
10th Ranked


Prototype or Mootools with DNN ClientAPI? 
I'm trying to use the mootools javascript framework (whose "$()" notation is based on the prototype js framework) in my module, but having some weird issues that I believe are caused by the following code in the DNN ClientAPI javascript (dnn.js, line 895, DNN v4.3.7):

//-- prototype/atlas shorthand functions
function $()
{
  var ary = new Array();
  for (var i=0; i<arguments.length; i++)
  {
    var arg = arguments[i];
    var ctl;
    if (typeof arg == 'string')
      ctl = dnn.dom.getById(arg);
    else
      ctl = arg;

    if (ctl != null && typeof(Element) != 'undefined' && typeof(Element.extend) != 'undefined')   //if prototype loaded, we must extend the object
        Element.extend(ctl);
       
    if (arguments.length == 1)
      return ctl;

    ary[ary.length] = ctl;
  }
  return ary;
}


I am using the $('mydiv') notation to access an element on the page and change its innerHTML property.  But when I do, another div element's contents are modified (cleared).  The 2 div's have unique id's.  My reason for suspecting this function is that I can successfully do the task if I use dnn.dom.getById(arg) directly... but then I don't have access to the mootools extension methods.

Any ideas?


Charlie Solomon
Beldin Technologies
Custom Software Solutions, DotNetNuke Modules
www.beldintechnologies.com
 
New Post 2/16/2007 1:59 PM
User is offline Charlie Solomon
23 posts
www.beldintechnologies.com
10th Ranked


Re: Prototype or Mootools with DNN ClientAPI? 
Update:

I implied that the function listed above is causing my problem... I didn't mean to.  I can make my code work if I use dnn.com.getById directly, and don't use mootools/prototype notation.

So I guess my real question here is has anyone been successful using mootools or prototype in the context of a DNN installation?  I'd really like to access some of the features of the mootools framework.

Thanks.


Charlie Solomon
Beldin Technologies
Custom Software Solutions, DotNetNuke Modules
www.beldintechnologies.com
 
New Post 2/19/2007 5:06 AM
User is offline Jon Henning
1605 posts
www.codeendeavors.com
5th Ranked










Re: Prototype or Mootools with DNN ClientAPI? 
Modified By Jon Henning  on 2/19/2007 9:07:55 AM)

The whole idea of the $ function and who "owns" that "namespace" has become quite muddy.  When I first learned of the use of $ and found that MS was adopting the same notation, I decided to do it as well.  For at the time, I felt that all frameworks simply used it as a quick way to get the reference to a DOM element.  Soon afterwards I learned that frameworks like prototyle use it for much more.  Apparently, MS learned this as well, and decided to switch to $get.  What I never understood is why they went through all the trouble of creating a nice namespace hierarchy, minimizing chances to have conflicting functions, then decided to scrap the whole idea and make shortened alias' with the $.  In essence, they are saying they "own" the $ namespace.  I have commented back and forth on this issue here.

Unfortunatly, I cannot just yank my $() function since I have to worry about backwards compatibility (at the time MS did it they were in beta so they could).  My $ function should be functioning with prototype last time I checked.

Hope this gives you a little more insight.


 
New Post 7/18/2007 9:21 AM
User is offline Nick
34 posts
10th Ranked


Re: Prototype or Mootools with DNN ClientAPI? 

I'm up against the same problem, has anyone found a fix?

 
New Post 7/18/2007 9:32 AM
User is offline Charlie Solomon
23 posts
www.beldintechnologies.com
10th Ranked


Re: Prototype or Mootools with DNN ClientAPI? 

I dropped MooTools in my module development shortly after this post because I couldn't get all the functionality to work... Jon's function above uses the Prototype ".Extend" method to access that framework's functionality if it is loaded, so like he said above, Prototype should work.



Charlie Solomon
Beldin Technologies
Custom Software Solutions, DotNetNuke Modules
www.beldintechnologies.com
 
Previous Previous
 
Next Next
  Forum  DotNetNuke® Pro...  ClientAPI Compo...  Prototype or Mootools with DNN ClientAPI?
 


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.

 


Icthus Technologies
Building Faith on the Internet
www.icthustech.com
Efficion Consulting
A premier DotNetNuke consulting firm providing complete DNN services including: custom module development, skinning and design, installation and integration services.
www.efficionconsulting.com
DotNetNuke Training by Engage Software
Specializing in customized training, architecture and module solutions for large scale implementations lead by DNN Core Team Member Christopher Hammond.
engagesoftware.com

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