<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
Joel,<div><br class="webkit-block-placeholder"></div><div>You do not have to write multiple functions for LAJAX to target specific divs.</div><div><br class="webkit-block-placeholder"></div><div>If you have a function as such:</div><div><br></div><div><div>var targetDiv = null;<span class="Apple-tab-span" style="white-space:pre"></span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span></div><div>function updateDynamic()</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>{</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>var updateDIV = document.targetDIV;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>if(Lajax.state() == 4) {</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>document.getElementById(updateDIV).innerHTML=Lajax.result();</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>} else {</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>document.getElementById(updateDIV).innerHTML="Please wait...";</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>}<span class="Apple-style-span" style="white-space: pre; ">        </span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>}</div></div><div><br></div><div>Your LAJAX request could then be:</div><div><br></div><div>&lt;a href="javascript:document.targetDIV='update&lt;?php echo $currentRecord; ?&gt;';Lajax.post(url,updateDynamic,{parameters};"&gt;Link text here&lt;/a&gt;</div><div><br class="webkit-block-placeholder"></div><div> </div><div>With the targetDIV being a unique DIV ID and the Lajax.post or Lajax.get targeting that div. One function to cover all your bases.</div><div><br class="webkit-block-placeholder"></div><div>Hope this helps. </div><div><br class="webkit-block-placeholder"></div><div><div> <span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div>Andy Gaunt</div><div>T: 321-206-3658</div><div><a href="mailto:andy@fmpug.com">andy@fmpug.com</a></div><div><a href="http://www.fmpug.com">http://www.fmpug.com</a></div><div><br class="khtml-block-placeholder"></div><div>FMPug: A Developer's best Friend!</div><br class="Apple-interchange-newline"></span> </div><br><div><div>On Oct 4, 2007, at 3:42 PM, Joel Shapiro wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Hey Gjermund</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">I started using LAJAX because it was so ready-to-use without having to know much about JavaScript or AJAX.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">I've recently been getting into jQuery, and just discovered how to do something that's really pushing me to use jQuery more:</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">In LAJAX, you need to specify the &lt;div&gt; that the callback will go to.<span class="Apple-converted-space">  </span>In my current project, I have many divs (cells in a table) that can each get refreshed through an AJAX call to the DB.*<span class="Apple-converted-space">  </span>With LAJAX I needed to either reference by ID the specific DIV in each link, or create multiple LAJAX functions -- one for each div, (which I might have had to do due to the limitations of a jQuery plugin I was using).<span class="Apple-converted-space">  </span>Anyway, jQuery has a command called "this", which acts on the DOM** element that triggers the action -- so you don't need to specify WHERE to do an action... jQuery knows exactly where via its use of "this".<span class="Apple-converted-space">  </span>On top of that, there are various methods to 'traverse' the DOM, such as "parents" which goes up the hierarchical ladder of the DOM starting at the "this" element and stopping at whatever element you specify.<span class="Apple-converted-space">  </span>For instance:</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">I've got something like:</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">&lt;div class="cell"&gt;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span class="Apple-converted-space">  </span>&lt;div class="year"&gt;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span class="Apple-converted-space">    </span>&lt;ul class="year"&gt;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span class="Apple-converted-space">      </span>&lt;li&gt;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span class="Apple-converted-space">        </span>&lt;a&gt;xyzlink&lt;/a&gt;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span class="Apple-converted-space">      </span>&lt;/li&gt;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span class="Apple-converted-space">    </span>&lt;/ul&gt;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span class="Apple-converted-space">  </span>&lt;/div&gt;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span class="Apple-converted-space">  </span>&lt;div class="fall"&gt;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span class="Apple-converted-space">     </span>(etc.)</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span class="Apple-converted-space">  </span>&lt;/div&gt;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">&lt;/div&gt; &lt;!-- end of "cell" div--&gt;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">With the jQuery line:</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span class="Apple-converted-space">   </span>$(this).parents(".cell").load("ajaxpage.php");</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">I can have jQuery load ajaxpage.php into the outside &lt;div&gt; that is surrounding THAT PARTICULAR LINK (&lt;a&gt;) that triggered the call.<span class="Apple-converted-space">  </span>I don't need to specify that cell by any ID.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">*My setup is diffferent than the LAJAX sample, which loads results into a DIFFERENT div.<span class="Apple-converted-space">  </span>Mine reload into their same divs.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">**DOM in layperson's terms are the base html elements: &lt;html&gt;, &lt;body&gt;, &lt;p&gt;, &lt;div&gt;, &lt;span&gt;, &lt;a&gt;,<span class="Apple-converted-space">  </span>&lt;ul&gt;, &lt;li&gt;, etc.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Granted, it's taken me a little time to understand how jQuery works, but it is really cool... and I'm only just beginning.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Hope that's helpful,</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">-Joel</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">On Oct 2, 2007, at 4:49 AM, Gjermund Gusland Thorsen wrote:</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div> <blockquote type="cite"><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">I use LAJAX( <a href="http://www.fm-synergy.com/page1/page1.php">http://www.fm-synergy.com/page1/page1.php</a> )</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">I have not really looked at any of the other implementations...</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Are there anyone who compared them before you started?</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">ggt667</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">On 10/2/07, Steve Winter &lt;<a href="mailto:steve@bluecrocodile.co.nz">steve@bluecrocodile.co.nz</a>&gt; wrote:</div> <blockquote type="cite"><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Prototype - <a href="http://www.prototypejs.org">http://www.prototypejs.org</a>/</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Cheers</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Steve</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">-----Original Message-----</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">From: <a href="mailto:fx.php_list-bounces@mail.iviking.org">fx.php_list-bounces@mail.iviking.org</a></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">[<a href="mailto:fx.php_list-bounces@mail.iviking.org">mailto:fx.php_list-bounces@mail.iviking.org</a>] On Behalf Of Gjermund Gusland</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Thorsen</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Sent: Tuesday, 2 October 2007 8:54 a.m.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">To: FX.php Discussion List</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Subject: [FX.php List] [Poll] Which ajax implementation do you use?</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Which ajax implementation do you use?</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">The subject says it all.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">ggt667</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">_______________________________________________</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">FX.php_List mailing list</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><a href="mailto:FX.php_List@mail.iviking.org">FX.php_List@mail.iviking.org</a></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><a href="http://www.iviking.org/mailman/listinfo/fx.php_list">http://www.iviking.org/mailman/listinfo/fx.php_list</a></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">No virus found in this incoming message.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Checked by AVG Free Edition.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Version: 7.5.488 / Virus Database: 269.13.37/1042 - Release Date: 1/10/2007</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">6:59 p.m.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">No virus found in this outgoing message.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Checked by AVG Free Edition.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Version: 7.5.488 / Virus Database: 269.13.37/1042 - Release Date: 1/10/2007</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">6:59 p.m.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">_______________________________________________</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">FX.php_List mailing list</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><a href="mailto:FX.php_List@mail.iviking.org">FX.php_List@mail.iviking.org</a></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><a href="http://www.iviking.org/mailman/listinfo/fx.php_list">http://www.iviking.org/mailman/listinfo/fx.php_list</a></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div> </blockquote><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">_______________________________________________</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">FX.php_List mailing list</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><a href="mailto:FX.php_List@mail.iviking.org">FX.php_List@mail.iviking.org</a></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><a href="http://www.iviking.org/mailman/listinfo/fx.php_list">http://www.iviking.org/mailman/listinfo/fx.php_list</a></div> </blockquote><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">_______________________________________________</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">FX.php_List mailing list</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><a href="mailto:FX.php_List@mail.iviking.org">FX.php_List@mail.iviking.org</a></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><a href="http://www.iviking.org/mailman/listinfo/fx.php_list">http://www.iviking.org/mailman/listinfo/fx.php_list</a></div> </blockquote></div><br></div></body></html>