[jQuery] Re: Ajax problem on Safari/Chrome browsers

2009-09-27 Thread indre1
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:

[jQuery] Re: Ajax problem on Safari/Chrome browsers

2009-09-27 Thread indre1
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?

[jQuery] Re: Ajax problem on Safari/Chrome browsers

2009-09-27 Thread indre1
Tested, it can be bypassed with ajax(): $.ajax({ type: GET, url: profile.php, data: do=addfriendid=2 }); But is the get and do thing a bug? On Sep 27, 3:37 pm, indre1 ind...@gmail.com wrote: After 3 DAYS, I finally

[jQuery] Re: Ajax problem on Safari/Chrome browsers

2009-09-27 Thread Mike McNally
You can always quote the word do on the left side of the colon: { do: something, x: y } It's not a bug, it's part of the Javascript language. On Sun, Sep 27, 2009 at 7:49 AM, indre1 ind...@gmail.com wrote: Tested, it can be bypassed with ajax():  $.ajax({                   type: GET,  

[jQuery] Re: Ajax problem on Safari/Chrome browsers

2009-09-27 Thread indre1
Ok, thanks. Should've noticed the highlighted word in editor. But if it's javascript, then why doesn't it throw errors with Firefox? On Sep 27, 3:55 pm, Mike McNally emmecin...@gmail.com wrote: You can always quote the word do on the left side of the colon:   { do: something, x: y } It's

[jQuery] Re: Ajax problem on Safari/Chrome browsers

2009-09-27 Thread Mike McNally
That particular aspect of Javascript syntax is basically a mistake from its original design. Different parsers may be more lenient. (There's no good reason for the syntax for object constants { x : y, ... } to forbid reserved words on the left side of the colons, because there's no ambiguity as

[jQuery] Re: Ajax problem on Safari/Chrome browsers

2009-09-27 Thread Scott Haneda
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

[jQuery] Re: Ajax problem on Safari/Chrome browsers

2009-09-26 Thread Mike McNally
On Sat, Sep 26, 2009 at 10:18 AM, Matt Quackenbush quackfu...@gmail.com wrote: That code should not work on _any_ browser.  In the onclick attribute you are grqbbing a reference to the containing div ($('#followButton2')), which clearly has no method named followUser. ... except that he's

[jQuery] Re: Ajax problem on Safari/Chrome browsers

2009-09-26 Thread Matt Quackenbush
That code should not work on _any_ browser. In the onclick attribute you are grqbbing a reference to the containing div ($ ('#followButton2')), which clearly has no method named followUser. Try something like this instead: script $(document).ready(function(){ $('div

[jQuery] Re: Ajax problem on Safari/Chrome browsers

2009-09-26 Thread Matt Quackenbush
@ 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