I keep all my behaviours in separate functions. For instance if I
had a fancy table widget I'd have a function called initTable()
that contained the behaviour code. I'd call it initially upon page
load, then call it again when necessary if content has been updated
via ajax.
[...]
It's a tricky line to balance. We either get to replace 1.1.2 and
cause some possible confusion with Safari issues (for users who
upgraded very quickly) or push out 1.1.3 and cause more confusion
having two releases occur in just a couple hours.
Where would be the confusion if the changelog
Untested, but reading the code I assume this would work:
$(#something).ajaxSuccess(fn);
function fn(r, s) {
$(this).unbind(ajaxSuccess);
// do what you want, then rebind
$(this).ajaxSuccess(fn);
}
It seems unbind doesn't work on ajaxSuccess or ajaxStop...
Still didn't find how to
In a page that gets modified by ajax calls, I would like to run my
own function after each change.
My function does ajax calls, so if I use the ajaxSuccess binding, it
goes recursively and crash...
Any idea?
-Nicolas
--
Nicolas Brush HOIZEY
Clever Age : http://www.clever-age.com/
You can use ajaxSuccess but go ahead and take advantage of the
settings object. Something like:
$().ajaxSuccess(function(e, xhr, settings) {
if (settings.myTag) return;
// do your extra work and call ajax
$.ajax({
myTag: 1,
url: blah.php,
type: 'post'
$().ready(function(){
$().ajaxStart($.blockUI).ajaxStop($.unblockUI);
});
Maybe ajaxStop is better than ajaxSuccess for my needs, but I don't
need to block the UI.
-Nicolas
--
Nicolas Brush HOIZEY
Clever Age : http://www.clever-age.com/
Gastero Prod : http://www.gasteroprod.com/
Photos
Untested, but reading the code I assume this would work:
$(#something).ajaxSuccess(fn);
function fn(r, s) {
$(this).unbind(ajaxSuccess);
// do what you want, then rebind
$(this).ajaxSuccess(fn);
}
It seems unbind doesn't work on ajaxSuccess or ajaxStop...
-Nicolas
--
Nicolas
var select = $('[EMAIL PROTECTED] myselect]');
var cachedOnChange = select[0].onchange;
I get the onchange in a function, great!
select[0].onchange = null;
What is the difference between this and unbind('change') or removeAttr
('onchange')?
I just found that althrough it works like you
var select = $('[EMAIL PROTECTED] myselect]');
var cachedOnChange = select[0].onchange;
I get the onchange in a function, great!
select[0].onchange = null;
What is the difference between this and unbind('change') or
removeAttr
('onchange')?
I just found that althrough it works like
$('li.expandable:not([a.on])')
A couple things to note:
1. you don't need to repeat li.expandable inside the :not
I think it is you MUST NOT repeat... ;)
-Nicolas
--
Nicolas Brush HOIZEY
Clever Age : http://www.clever-age.com/
Gastero Prod : http://www.gasteroprod.com/
Photos :
No idea?
Le 9 févr. 07 à 10:07, Nicolas Hoizey a écrit :
Hello,
Let's say I have the folowing code I can't change (it's not mine) :
select name=myselect
onchange=this.nextSibling.visibility='hidden';
option value=1One/option
option value=2Two/option
/select
How can I put
I think you don't have to use eval..., I'd try this:
var select = $('[EMAIL PROTECTED] myselect]');
var cachedOnChange = select[0].onchange;
I get the onchange in a function, great!
select[0].onchange = null;
What is the difference between this and unbind('change') or removeAttr
select.bind('change', function() {
if (confirm('Are you sure?')) {
cachedOnChange();
The function uses 'this', which is not available anymore when I
call it...
I did this:
select.onchange = cachedOnChange;
select.onchange();
And it seems to work well!
I'm not sure there are
Hello,
Let's say I have the folowing code I can't change (it's not mine) :
select name=myselect
onchange=this.nextSibling.visibility='hidden';
option value=1One/option
option value=2Two/option
/select
How can I put my own change event handler, but being able to run
the
Nicolas emailed me, and I felt it was somewhat my duty/
responsibility to get jQuery to work in greasemonkey again, so here
it is!
jQuery 1.1.1 -- http://userscripts.org/scripts/show/7373
It works so well, thank you a lot! Could you just explain here what
you did, so that everyone can
In order to get jQuery to work with greasemonkey, the document.ready()
code needs to be removed. This is ok because by the time greasemonkey
is run, the page has already finished loading so we do not need this
event to be called. Find below the code removed from jQ 1.1.1
Thanks!
-Nicolas
I'm wondering if there is a way to rewrite the url in the browser bar
without refreshing the page.
You can only modify the anchor (after the #), as it is done by some
Ajax and Flash sites.
-Nicolas
--
Nicolas Brush HOIZEY
Clever Age : http://www.clever-age.com/
Gastero Prod :
I right, or do you authorize such bandwidth abuse?
-Nicolas
On 1/30/07, Nicolas Hoizey [EMAIL PROTECTED] wrote: Hello,
I want to improve some of my Greasemonkey scripts by using jQuery
instead of traditionnal JS.
I tried to load the library during execution[1] and it didn't work
I would guess that the best way would be to pack the jQuery source
into
the greasemonkey xpi and access it using the chrome URI interface
somehow. I have very limited experience with firefox extensions but
that
would seem to be the best way in terms of bandwidth and in terms of
of bandwidth and in terms of
usability (you wouldn't need to add a dynamic script load to every
page
load just to use jQuery in your user scripts)
-blair
Nicolas Hoizey wrote:
Hello Joan,
Yes, I remember the threads talking about this, and I was curious
about it. After some days I figured out
maybe you could insert jquery by adding a generated script
element to
the head and setting its source to a data uri [1] containing the
jquery
code?
ok, i've tested it. it basically works, but firefox crashes after
one or
two reloads :/
I tried also, and it crashes also! :(
Hello,
I want to improve some of my Greasemonkey scripts by using jQuery
instead of traditionnal JS.
I tried to load the library during execution[1] and it didn't work as
intended. It was loaded from jquery.com, so I didn't want it anyway.
I can't load it from my host either.
I found a
22 matches
Mail list logo