Discussion:
Browser / AJAX help
Dave Maharaj :: WidePixels.com
2010-02-01 01:45:05 UTC
Permalink
I have a "star" click to bookmark type feature. It works in FF, IE but not
Opera or Chrome.

Filled star = page book marked
Empty star = not bookmarked

In FF and IE first click changes the star from empty to filled, click filled
star turns back to empty (info saved in db successfully).

In Opera and Chrome clicking the stars fills them and 2nd click will return
it back to empty but it never saves to the db. If i bookmark 20 pages in FF,
go to Chrome or Opera and un-select the bookmarked selections it saves
(deletes the bookmark) but it never saves any new bookmarks.

My js looks like this:

$("a.bookmarked").live('click', function(){
var url_id = $(this).attr('id').split('_');
var status = $(this).attr('class');

$(this).toggleClass("not");



$.ajax({
type: "POST",
cache:false,
url: '/bookmark/'+url_id[1],
});
return false;
});

Any ideas?

Dave
Andreas Möller
2010-02-01 05:09:14 UTC
Permalink
Have you checked the console to see whether the parameter you pass to your server side script is empty or not?

The code you pasted lacks a curly bracket, a closing parenthesis and a semi-colon, but I assume you've got it in your original code, haven't you?


Best regards,

Andreas
Dave Maharaj :: WidePixels.com
2010-02-01 05:12:53 UTC
Permalink
Yes its there...just a miss on the copy / paste. No errors reported in FF or
IE using firebug / IE developer bar. Cant find one for chrome. Just weirs
how Opera and Chrome wont save a new bookmark yet if there is a bookmark
saved fromFF or IE theni go to Chrome or Opera they will remove a bookmark,
but wont save one.

Dave

-----Original Message-----
From: Andreas Möller [mailto:***@l8m.de]
Sent: February-01-10 1:39 AM
To: jquery-***@googlegroups.com
Subject: RE: [jQuery] Browser / AJAX help

Have you checked the console to see whether the parameter you pass to your
server side script is empty or not?

The code you pasted lacks a curly bracket, a closing parenthesis and a
semi-colon, but I assume you've got it in your original code, haven't you?


Best regards,

Andreas
Andreas Möller
2010-02-01 12:27:28 UTC
Permalink
Post by Dave Maharaj :: WidePixels.com
Yes its there...just a miss on the copy / paste. No errors reported in FF or
IE using firebug / IE developer bar.
Like, in the Firebug console?


Best regards,

Andreas
Dave Maharaj :: WidePixels.com
2010-02-02 00:32:56 UTC
Permalink
This is the function.

$("a.bookmarked").click(function(){
var url_id = $(this).attr('href');
var status = $(this).attr('class');

$(this).toggleClass("not");

$.ajax({
type: "POST",
cache:false,
url: url_id,

});
return false;
});

No matter what I try still same thing. Will not work in Chrome or
opera...frustrating.

Any other ideas?

Thanks,

Dave

-----Original Message-----
From: Andreas Möller [mailto:***@l8m.de]
Sent: February-01-10 8:57 AM
To: jquery-***@googlegroups.com
Subject: Re: [jQuery] Browser / AJAX help
Post by Dave Maharaj :: WidePixels.com
Yes its there...just a miss on the copy / paste. No errors reported in
FF or IE using firebug / IE developer bar.
Like, in the Firebug console?


Best regards,

Andreas

Continue reading on narkive:
Loading...