[mochikit] Re: $ in jQuery, Prototype and Mochikit

2007-09-03 Thread olilo

On Sep 3, 7:42 am, Bob Ippolito [EMAIL PROTECTED] wrote:
 MochiKit doesn't actually use $, it's just an alias for getElement
 that we export for the user's convenience. You can load whatever
 library you want after MochiKit and let it take over use of $, nothing
 will break.

 -bob

 On 9/2/07, jack.tang [EMAIL PROTECTED] wrote:



  Hi, all

  I blogged one case in my blog (http://jack.lifegoo.com/?p=163) which
  described the complaint of $ in jQuery, Prototype and Mochikit,
  could you please take it consider and reduce the conflicts?

  Thanks.

  /Jack

We are using MochiKit and JQuery.

JQuery tells to use the 'jQuery.noConflict()' but we continued to have
compatibility problems.

After investigation a little bit, I found a solution:

we first load MochiKit, then JQuery, and we add than little code just
before the /head

script type=text/javascript
  jQuery._$ = MochiKit.DOM.getElement;
  var $j = jQuery.noConflict();
/script

$ refers to MochiKit's getElement
$j refers to JQuery's $

PS: I hope the html tags will render correctly (there is no preview)


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
MochiKit group.
To post to this group, send email to mochikit@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/mochikit?hl=en
-~--~~~~--~~--~--~---



[mochikit] Re: Debugging in IE[67]?

2007-07-23 Thread olilo

On Jul 22, 7:01 pm, Alberto Simões [EMAIL PROTECTED] wrote:
 Hi

 This is not properly mochikit, as I am not sure if the code failing is
 really from mochikit or if it is mine. My code is working fine in
 Firefox, but it needs to work on IE as well. Unfortunately, it
 doesn't.
 Now, while we have a lot of plugins for firefox to help debugging,
 what one can use in IE?

 Thank you in advance,
 Alberto
 --
 Alberto Simões

I'm using 2 usefull addons for IE:

  * DebugBar:
   - DOM Inspector, HTTP Inspector, Javascript Inspector and
Javascript Console, HTML Validator)
   - http://www.debugbar.com/
  * WebDevHelper:
   - javascript logging, http logging, ...
   - http://projects.nikhilk.net/Projects/WebDevHelper.aspx

For javascript debugging, I'm using the MS Script Editor [1] which can
normally be enabled from MS Excel or MS Word [2]. You can place a
'debugger' statement in your code to start debugging from that place.

[1] not to be confused with the MS Script Debugger
[2] Menu - Tools - Macros - MS Script Editor


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
MochiKit group.
To post to this group, send email to mochikit@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/mochikit?hl=en
-~--~~~~--~~--~--~---



[mochikit] NamedErrors are uncaught

2007-07-05 Thread olilo

Whenever I raise a NamedError, Firefox and IE tell me the error is
'uncaught'. But if I raise a standard javascript error, I don' have
this problem.

The standard error displays the message in a prettier manner and most
of the time I can have access to the error stack. I don't have theses
features with the NamedError.

Here is an little code snippet:

MyTest = function(param) {
  bindMethods(this);

  if (param == 1)
this._raise_a_named_error();
  else
this._raise_a_standard_error();
};

MyTest.prototype = {
  _raise_a_named_error: function() {
var err = new NamedError(TestException);
err.message = a named error;
throw err;
  },

  _raise_a_standard_error: function() {
throw new Error(a standard error);
  }
};

// test code:
a1 = new MyTest();
a2 = new MyTest(1);


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
MochiKit group.
To post to this group, send email to mochikit@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/mochikit?hl=en
-~--~~~~--~~--~--~---



[mochikit] Re: Bug in MochiKit.DOM ???

2006-08-31 Thread olilo

Beau Hartshorne wrote:
 On 30-Aug-06, at 6:10 AM, Zachery Bir wrote:

  Maybe, *shrug*, every Javascript reference I've seen points out that
  css style attributes need to be camel cased. Just because they're in
  quotes here doesn't strike me as obviating that. It's still in
  Javascript source. :^)

 computedStyle('background-color', 'red') is valid in MochiKit 1.4.
 computedStyle('backgroundColor', 'red') works too, but I like the
 first form. It makes sense for us to note the discrepancy or adjust
 other MochiKit functions to accept either. backgroundColor is an
 artifact of the native DOM API, not JavaScript.

 Beau

I had a similar problem with some html attributes (not css attributes)
with IE.

When trying to set the colspan attribute on a TD tag, I had to use
this:
  {'align': 'left', 'colspan': '4', 'colSpan': '4'}

colspan alone did nothing in IE. When looking at the generated
source, I noticed that IE writed colSpan camelCased. I added the
camelCased attribute in my objet and it worked in IE.

I had the same problem with the bgcolor attribute. I had to use bgColor
with IE.

I'm using MochiKit 1.3.1


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
MochiKit group.
To post to this group, send email to mochikit@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/mochikit
-~--~~~~--~~--~--~---