<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    Jeff<br>
    <br>
    &nbsp;&nbsp;&nbsp; Both this approach (settings) and inline can work.<br>
    &nbsp;&nbsp;&nbsp; I suggested this because you have a script that needs dynamic
    values.<br>
    &nbsp;&nbsp;&nbsp; Making the script a function you can call with the two value and
    the inline approach would be another approach.<br>
    <br>
    Nevets<br>
    <br>
    <br>
    On 11/28/2010 10:04 AM, <a class="moz-txt-link-abbreviated" href="mailto:jeff@ayendesigns.com">jeff@ayendesigns.com</a> wrote:
    <blockquote cite="mid:4CF27D94.9080704@ayendesigns.com" type="cite">
      <div class="moz-text-html" lang="x-western"> Ah, gotcha. Not sure
        this is more intuitive than the other way, but if
        it's common practice then so be it :)<br>
        Thanks!<br>
        <br>
        On 11/28/2010 11:02 AM, Steve Ringwood wrote:
        <blockquote cite="mid:4CF27D12.9030501@mailbag.com" type="cite">
          Jeff<br>
          &nbsp;&nbsp;&nbsp; <br>
          &nbsp;&nbsp;&nbsp; You still want to drupal_add_js(),&nbsp;&nbsp; but instead of one
          call you
          want two.<br>
          <br>
          &nbsp;&nbsp;&nbsp; The first is to add your mymodule.js<br>
          <br>
          &nbsp;&nbsp;&nbsp; The second is to do something like<br>
          <br>
          &nbsp; $settings = array(<br>
          &nbsp;&nbsp;&nbsp; 'MyModule' =&gt; array(<br>
          &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 'value1' =&gt; 'some value',<br>
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'value2' =&gt; 'some other value'<br>
          &nbsp;&nbsp;&nbsp;&nbsp; )<br>
          &nbsp; );<br>
          <br>
          &nbsp; drupal_add_js( $settings, 'setting' );<br>
          <br>
          &nbsp; You also need to modify mymodule.js to use the values
          something like<br>
          <br>
          &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; var settings = Drupal.settings.MyModule;<br>
          &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // Now you can use<br>
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // settings.value1 and settings.value2<br>
          <br>
          &nbsp;&nbsp; (of course you need to change MyModule to your actual
          module name
          and I would suggest more meaningful names than value1 and
          value2)<br>
          <br>
          Nevets<br>
          <br>
          <br>
          On 11/28/2010 9:43 AM, <a moz-do-not-send="true"
            class="moz-txt-link-abbreviated"
            href="mailto:jeff@ayendesigns.com">jeff@ayendesigns.com</a>
          wrote:
          <blockquote cite="mid:4CF27887.6060002@ayendesigns.com"
            type="cite">
            <div class="moz-text-flowed" style="font-family: -moz-fixed;
              font-size: 13px;" lang="x-western">Nothing
              confuses me faster than mixing php and js (and especially
              escaping the
              quotes). In this case, my confusion is the concept and not
              the
              gobblygook. <br>
              <br>
              <br>
              I have a module invoking hook_block, and a function that
              creates and
              returns the block content. In this function I invoke
              drupal_add_js to
              gather the contents of ./mymodule.js <br>
              <br>
              <br>
              So far so good. However, the js needs to be
              dynamic...there are two
              function values that need to be embedded in it. I'm
              thinking that with
              this being the case, drupal_add_js might not be the way to
              go (back to
              escaping quotes), but wanted to poll first for best
              practice, since
              I'll be contributing this module. <br>
              <br>
              <br>
              Thanks, <br>
              <br>
              Jeff <br>
              <br>
              <br>
            </div>
          </blockquote>
          <br>
        </blockquote>
      </div>
    </blockquote>
    <br>
  </body>
</html>