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:
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?
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
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,
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
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
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
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
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
@ 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
10 matches
Mail list logo