That would make sense, since `do` is a language keyword:
do {
code to be executed
}
while (var <= endvalue);
I am sure there is a way to escape it, though in the same way I am
fearful of using if/else/for/while/var and all the test as name/value
pairs in JS or jQ, I would look to change it.
I have for a long time used 'act' which to me works better than do, as
do means positive action, so you get into cases where you will see
do=noprocess, or do=donotprocess, the cases of double-negative can
lead to confusion.
act={add, update, delete, inset} that all is pretty clear.
Sorry I was not more help, just my opinion.
--
Scott * If you contact me off list replace talklists@ with scott@ *
On Sep 27, 2009, at 5:37 AM, indre1 wrote:
After 3 DAYS, I finally figured it out:
$.get('profile.php', { do: 'addfriend', id: userId }
The problem is, that the word "do" is reserved or something, thus you
can't use it in get, ajax and probably elsewhere. test.php?
do=something will never work from jQuery then, or how should I escape
it?
Is this a bug or just something everyone has to know? Strangely, on FF
it all worked.
$.get('profile.php', { action: 'addfriend', id: userId } works
perfectly.
On Sep 27, 1:27 pm, indre1 <ind...@gmail.com> wrote:
Well, the problem still seems to be in the get() function. For
example, IE gives the following error: Object doesn't support this
property or method
With:
(function($) {
$.fn.followUser = function(userId) {
this.fadeOut(250, function(){
$.get('profile.php', { do: "addfriend", id:
userId }, function
(data){
return this.html('<p>Follower added</
p>').fadeIn(250);
});
});
}
})(jQuery);
If I remove the whole $.get() part, the error is gone. Chrome will
start fading out too. The code will then look like:
(function($) {
$.fn.followUser = function(userId) {
this.fadeOut(250, function(){
});
}
})(jQuery);
I even tried replace the get() with ajax(), but ran into the same
problem.
Btw, thanks for the attr('rel') suggestion. This is something I was
also looking for, but couldn't figure it out :) The html is now:
<script type="text/Javascript">
$(function(){
$('div#followButton a').click(function(){
$('div#followButton a').followUser($
(this).attr('rel'));
});});
</script>
...
<div id="followButton">
<a rel="2">test1</a>
</div>
On Sep 26, 6:48 pm, Matt Quackenbush <quackfu...@gmail.com> wrote:
@ Mike - Thanks for making me take a closer look at the original
code. I
get it now. My bad.
/me crawls back into his cave to hibernate some more