I realize now that I don't know whether I'm coming or going... <br><br>Excellent the distinction between server side and client side, would be good to do a little drawing showing the order in which things get executed and the params passed (interaction diagram or sequence diagram).<br>
<br>Victor<br><br><div class="gmail_quote">On Sun, Nov 28, 2010 at 4:00 PM, Earl Miles <span dir="ltr"><<a href="mailto:merlin@logrus.com">merlin@logrus.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im">On 11/28/2010 9:17 AM, <a href="mailto:jeff@ayendesigns.com">jeff@ayendesigns.com</a> wrote:<br>
> <script type="text/javascript"<br>
> src="<a href="http://www.mydomain.com/test.js" target="_blank">http://www.mydomain.com/test.js</a>"></script><br>
> <script type="text/javascript"><br>
> var settings = Drupal.settings.mymodule;<br>
> myfunction(<a href="http://settings.name" target="_blank">settings.name</a>,settings.total);<br>
> </script><br>
<br>
</div>The problem is likely order of code running. Settings won't have been<br>
read in yet. You need to use jquery's s ready() function. IMO you should<br>
put this directly into your test.js file and not embed inline javascript<br>
at all. If your javascript is going to do a .write() or something, you<br>
are best off using a <div> that will be replaced. So at the bottom of<br>
your test.js, something like this:<br>
<br>
// $(function() { }) is a synonym for $.ready().<br>
// This ensures that the code is not executed until the page is rendered.<br>
$(function() {<br>
<div class="im"> var settings = Drupal.settings.mymodule;<br>
myfunction(<a href="http://settings.name" target="_blank">settings.name</a>,settings.total);<br>
</div>});<br>
<br>
<br>
</blockquote></div><br>