[jQuery] Re: document.body is null on, Google Web optimiser redirects.

2009-11-09 Thread paulroon
FYI anyone with this same issue..
Not really a JQuery issue. GWO control scripts need to be loaded
before jQuery. it is a race condition.
jQuery is still loading whilst the redirect is in operation.. hence no
body in the DOM.


On 6 Nov, 16:57, paulroon paulr...@gmail.com wrote:
 Hey all,

 Head scratching here, We have GoogleWebOptimiserrunning some A/B
 tests on our site.
 Effectively Google drops a cookie that triggers a redirect to another
 version of the same page.

 We have (seemingly without change) started seeing a JS Error during
 the redirection that is coming from jQuery. Specifically jQuery
 1.3.2.
 If I drop the version from 1.3.2 down to our old 1.2.6 version the
 issue goes away.
 Here is a firebug console output

 document.body is null
    document.body.appendChild( div );\n

 thanks in advance


[jQuery] Low Pro instance talking to each other

2009-10-12 Thread paulroon

Hey all,

I'm pretty new to Low Pro for jQuery and trying to get things right
first time around

http://www.danwebb.net/2008/1/31/low-pro-for-jquery

I am trying to get multiple instances of low pro behaviors to fire
custom events in other low pro behavior / instances.
I do have a solution that seems to work ok for now, However I wonder
if anyone has a better solution as what I've got seems like it could
be a little more elegant.

Here's my example

...

script type=text/javascript
$(document).ready(function(){
$('#left').attach(LEFT);
$('#right').attach(RIGHT, LEFT);
});
/script

pclick me i am the a href=# id=leftLEFT event/a/p
pclick me i am the a href=# id=rightRIGHT event/a/p

using the following low pro

var LEFT = $.klass({
initialize: function() {},
onclick: function(el) { },
onTwoleftfeet: function() {
alert('...but i have 2 left feet.');
}
});

var RIGHT = $.klass({
initialize: function(otherBehavior) {
this.interactionInstance = otherBehavior.instances[0];
},
onclick: function(el) {
alert('First with the right.');
this.interactionInstance.onTwoleftfeet();
return false;
},
});

So it's passing the (already initialised) LEFT behavior into the RIGHT
which then has access to its internal instances array. Obviously we
could scale this by passing in arrays of behaviors, and looping
through instances, but I am questioning the approach in general.
For example the ordering of the attach calls is critical, and I sort
of feel there is a lot of work to do to find a partner instance.

Feedback is always appreciated