[jQuery] Re: Avoiding concurrency when updating a database through AJAX

2008-07-08 Thread Luis Abreu

>  This is definitely more of a general AJAX topic than a JQuery question
>  per se.  What are some strategies for avoiding concurrency errors when
>  updating a database through AJAX?  That is, what are some ways to
>  prevent a given user from modifying the same row in a database with
>  simultaneous requests (say, that he updates one column with an AJAX
>  call, then immediately submits a form that updates the same row).  How

I'd say this is the same problem you have whenever you don't have a
single user application. My favourite strategy is optimistic locking,
but there are other options out there:

http://en.wikipedia.org/wiki/Optimistic_concurrency_control

btw, I tend to use a timestamp or integer version number.

>  have other people solved this problem?  Is the best option to make the
>  AJAX call synchronous?
never make synchronous ajax calls. even though it might take more
time, you should always design your app so that it won't use ajax sync
calls (sync calls will block the browser and nobody wants that,
right?)


-- 
Regards,
Luis Abreu
email: labreu_at_gmail.com
PT Blog: http://weblogs.pontonetpt.com/luisabreu
EN Blog:http://msmvps.com/blogs/luisabreu/default.aspx
http://www.pontonetpt.com
MVP profile: http://mvp.support.microsoft.com/profile/luis.abreu


[jQuery] opera 9: known problems with opacity and hexdecimal text colors?

2008-07-07 Thread Luis Abreu
Hello guys.
 
Newbie here, so sorry if this has been mentioned before. 
 
I'm trying to apply a fadein effect to a span which has text. Here's the
html:
 

  
  Location

 
And here's the code I'm applying to change the opacity:
 
$("a.menuItem img").css("opacity", .5);
$("a.menuItem span").css("opacity", .5);
 
The problem: if I have a hexadecimal defined color (differente from the
"basic" colors - ex.: red, white, etc) the text isn't shown. It will only
appear on the mouse over event because during it I change the opacity from
.9 to .9. Has anyone seen this in the past?
 
Thanks and sorry for the poor English.
 
-- 
Regards,
Luis Abreu
email: labreu_at_gmail.com
PT Blog: http://weblogs.pontonetpt.com/luisabreu
EN Blog:http://msmvps.com/blogs/luisabreu/default.aspx
http://www.pontonetpt.com
MVP profile: http://mvp.support.microsoft.com/profile/luis.abreu
 
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Kevin Pepperman
Sent: segunda-feira, 7 de Julho de 2008 22:48
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: How to replace a div content?
 
Try setting the div html to empty first.
 
jQuery("#elem").html("").html('my text');
On Mon, Jul 7, 2008 at 10:04 AM, SimDigital <[EMAIL PROTECTED]> wrote:

How could i replace a html content inside the div?

I have 1 div (ini text) and everytime i click a
button, i want to replace the html content inside the #ELEM to new
one.

I try to use:

jQuery("#button").click(function() {
   jQuery("#elem").html('my text');
});

but everytime i click the button, the html is not replaced, resulting
something like:

 my textmy text

What is the solution?



-- 
Paul Lynde  - "I sang in the choir for years, even though my family belonged
to another church." 
No virus found in this incoming message.
Checked by AVG - http://www.avg.com
Version: 8.0.138 / Virus Database: 270.4.6/1538 - Release Date: 07-07-2008
07:40