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  |  

AppTheory specializes in solutions based on the DotNetNuke platform and has 2 employees on the DotNetNuke Core Team.
  Ads  
OnyakTech
 


  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
Verndale
 


DotNetNuke Forums
 
  Forum  DotNetNuke® Pro...  ClientAPI Compo...  Prototype or Mootools with DNN ClientAPI?
Previous Previous
 
Next Next
New Post 2/16/2007 2: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 2: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 6:06 AM
User is offline Jon Henning
1622 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 10: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 10: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.

 


Jetkey Smart Map
Smart Map is an AJAX powered Google Map module that displays driving directions, proximity search results and data from your own databases. Smart Map reads GPX (GPS data) files, GeoRSS feeds, and KML data. You can pass any querystring parameter to Smart Map and into your own custom queries to control what data displays on the map.
smartmap.jetkey.com
DNNSpired.com
Inspired to extend DotNetNuke®, everyday.
www.DNNSpired.com
TMA Resources
TMA Resources is a software company providing eBusiness solutions for the Association market.
www.tmaresources.com

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