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 ch
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 t
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 wrote:
> You can always quote the word "do" on the left side of the colon:
>
> { "do": "something", x: y }
>
> It's not a bug,
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 wrote:
>
> Tested, it can be bypassed with ajax():
>
> $.ajax({
> type: "GET",
>
Tested, it can be bypassed with ajax():
$.ajax({
type: "GET",
url: "profile.php",
data: "do=addfriend&id=2"
});
But is the get and "do" thing a bug?
On Sep 27, 3:37 pm, indre1 wrote:
> After 3 DAYS, I finally figured it
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?
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: "add
@ 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
On Sat, Sep 26, 2009 at 10:18 AM, Matt Quackenbush 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 created his own jQu
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:
10 matches
Mail list logo