<div>
Hi Dario,
</div><div><br></div><div>please read the documentation about ajaxError: http://api.jquery.com/ajaxError/ it suggests that you check the parameters to the function. </div><div>You can either convert the script to a function by sending #asFunction: and provide an array of variable names, or you add that script in your file library like so:</div><div>jQuery(function($){</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>$(document).ajaxError(function(event, jqXHR, ajaxSettings, thrownError) {</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>alert("error " + thrownError);</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>});</div><div>});</div>
<div><div>That'll also register the event handler and be not so difficult to read. Downside is that you cannot easily send that back to the server as you don't have a callback URL at hand, but for debugging purposes that should be fine.</div><div><br></div><div>Kind Regards</div><div>Karsten</div><div><br></div>-- <br><div>Karsten Kusche - Dipl. Inf. (FH) - karsten@heeg.de</div><div>Georg Heeg eK - Köthen</div><div>Handelsregister: Amtsgericht Dortmund A 12812 </div><div><br></div></div>
<p style="color: #A0A0A8;">Am Mittwoch, 5. Juni 2013 um 14:55 schrieb dtrussardi@tiscali.it:</p>
<blockquote type="cite" style="border-left-style:solid;border-width:1px;margin-left:0px;padding-left:10px;">
<span><div><div>Ciao, <div><br><div>with the Ryan changes all works fine.</div><div><br></div><div><br><blockquote type="cite"><div><div>Hi Dario,</div>
<div>I think the trouble is that when you have two or more ajax scripts to be run you are not guaranteed which will run first. If you use a callback and send serializeThis to the ajax object, it runs before any scripts:</div>
<div> </div>
<div>html anchor</div>
<div> callback: [ self setIndex: aValue ];</div>
<div> onClick: (html jQuery ajax</div>
<div> serializeThis;</div>
<div> script: [ :s | (s jquery: anId) html: [ :h | self renderStuffOn: h ].</div>
<div> s << (s jQuery: anId2) html: [ :h | self renderSomeOtherStuffOn: h ] ]...<br></div></div></blockquote><div><br></div><div>I think the use of callback is more clear but some test id do don't solve the problematic.</div><div><span style="white-space: pre; "> </span></div><div>At the top of my rendering i have this code :</div><div><br></div><div><span style="white-space:pre">                 html document addLoadScript: (html jQuery ajaxSetup
                         onError: (html javascript
                        alert: 'The session erase a jq error.'</span><span style="white-space: pre;"> ))</span><br></div><div><span style="white-space: pre;"><br></span></div><div><span style="white-space: pre;">and when i work with callback the system erase the alert.</span></div><div><span style="white-space: pre; "><br></span></div><div><span style="white-space: pre; ">How i can use the callback in this problematic, or the Ryan indications is the only solution.</span></div><div><span style="white-space: pre; "><br></span></div><div><span style="white-space: pre; "><span style="white-space:pre">        </span>Thanks,</span></div><div><span style="white-space: pre; "><br></span></div><div><span style="white-space: pre; "><span style="white-space:pre">                </span>Dario</span></div><div><br></div><blockquote type="cite"><div>
<div>Regards,</div>
<div>John<br></div>
<div>On Wed, Jun 5, 2013 at 4:40 AM, <span dir="ltr"><<a href="mailto:dtrussardi@tiscali.it" target="_blank">dtrussardi@tiscali.it</a>></span> wrote:<br><blockquote type="cite"><div>
<div style="WORD-WRAP:break-word">
<div>Ciao,</div>
<div><br></div>
<div>i have a anchor based on this code:</div>
<div><span style="WHITE-SPACE:pre-wrap"></span></div>
<div><span style="WHITE-SPACE:pre-wrap"></span>html anchor</div>
<div><span style="WHITE-SPACE:pre-wrap"></span>script: (html jQuery this button</div>
<div><span style="WHITE-SPACE:pre-wrap"></span>text: true;</div>
<div><span style="WHITE-SPACE:pre-wrap"></span>primaryIcon: 'ui-icon-circle-plus'</div>
<div><span style="WHITE-SPACE:pre-wrap"></span>title: 'Successivo');</div>
<div><br></div>
<div><span style="WHITE-SPACE:pre-wrap"></span>onClick: (html jQuery ajax</div>
<div><span style="WHITE-SPACE:pre-wrap"></span><span style="WHITE-SPACE:pre-wrap"></span>( html jQuery ajax </div>
<div> <span style="WHITE-SPACE:pre-wrap"></span>script: [ :s | <span style="WHITE-SPACE:pre-wrap"></span>s << (s jQuery: #'base') load html:[:h|<b> <span style="WHITE-SPACE:pre-wrap"></span>"A"<span style="WHITE-SPACE:pre-wrap"> </span>self incrementaIndex: true.</b> </div>
<div><span style="WHITE-SPACE:pre-wrap"></span>"B1"<span style="WHITE-SPACE:pre-wrap"> </span><span style="WHITE-SPACE:pre-wrap"></span>(self renderingBaseOn: h)].<span style="WHITE-SPACE:pre-wrap"> </span></div>
<div><br></div>
<div><span style="WHITE-SPACE:pre-wrap"></span><span style="WHITE-SPACE:pre-wrap"></span>s << (s jQuery: #'orarioRiferimento') load html:[:h| <span style="WHITE-SPACE:pre-wrap"></span> "B2"<span style="WHITE-SPACE:pre-wrap"> </span>( self renderOrarioRiferimentoOn: h)]]);<span style="WHITE-SPACE:pre-wrap"> </span></div>
<div><span style="WHITE-SPACE:pre-wrap"></span>with: '>'.</div>
<div><br></div>
<div><br></div>
<div>My objective when a user click on this anchor is:</div>
<div><br></div>
<div><span style="WHITE-SPACE:pre-wrap"></span>A) <span style="WHITE-SPACE:pre-wrap"> </span> update a index with the <span style="WHITE-SPACE:pre-wrap"> </span><b>self incrementaIndex: true.</b></div>
<div><br></div>
<div><span style="WHITE-SPACE:pre-wrap"></span>B1) <span style="WHITE-SPACE:pre-wrap"> </span>update the div #base with:<span style="WHITE-SPACE:pre-wrap"> </span> <span style="WHITE-SPACE:pre-wrap"> </span> self renderingBaseOn: h</div>
<div><br></div>
<div><span style="WHITE-SPACE:pre-wrap"></span>B2) update the div #orarioRiferimento <span style="WHITE-SPACE:pre-wrap"> </span>with:<span style="WHITE-SPACE:pre-wrap"> </span> self renderOrarioRiferimentoOn: h</div>
<div><br></div>
<div><br></div>
<div>Where the B1 - B2 rendering is based on the index state.</div>
<div><br></div>
<div>Now i have a strange behavior because sometime the B2<span style="WHITE-SPACE:pre-wrap"> </span> div #orarioRiferimento<span style="WHITE-SPACE:pre-wrap"> </span> renderings is not aligned to the index.</div>
<div><br></div>
<div>As if the onClick script action is not execute in the definition sequence.</div>
<div><br></div>
<div><br></div>
<div>Any suggestions ?</div>
<div><br></div>
<div>What is the right definition to solve this problematic type ?</div>
<div><br></div>
<div><span style="WHITE-SPACE:pre-wrap"></span>Thanks,</div>
<div><br></div>
<div><span style="WHITE-SPACE:pre-wrap"></span>Dario</div>
<div><br></div>
<div><br></div></div><br>_______________________________________________<br>seaside mailing list<br><a href="mailto:seaside@lists.squeakfoundation.org">seaside@lists.squeakfoundation.org</a><br><a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br>
<br></div></blockquote></div><br><br clear="all"><br>-- <br><a href="http://jmck.seasidehosting.st/" target="_blank">jmck.seasidehosting.st</a>
_______________________________________________<br>seaside mailing list<br><a href="mailto:seaside@lists.squeakfoundation.org">seaside@lists.squeakfoundation.org</a><br><a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br></div></blockquote></div><br></div></div><div><div>_______________________________________________</div><div>seaside mailing list</div><div><a href="mailto:seaside@lists.squeakfoundation.org">seaside@lists.squeakfoundation.org</a></div><div><a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a></div></div></div></span>
</blockquote>
<div>
<br>
</div>