title: (JS) calling external .js function with <script> tag
body: <p>i'm looking to call a function cookiefix() which is located inside main.js and source  is linked at the bottom of my html. </p>
  
  <pre><code>echo '&lt;body&gt;';
  if(!isset($_COOKIE['clicked'])) {
  if(!isset($_COOKIE['count'])) {
  echo '&lt;script type="text/javascript"&gt;cookiefix();&lt;/script&gt;';
  echo '&lt;script type="text/javascript"&gt;'
  , 'document.cookie="count=1";'
  , '&lt;/script&gt;' ; }  }
  </code></pre>
  
  <p>I was using body onload="" and it worked fine, I know this probably sounds like an uber newby question but i've been searched for the last hour or so and nothing is working. </p>
  
  <pre><code>&lt;script src="js/main.js" type="text/javascript"&gt;cookiefix();&lt;/script&gt;
  </code></pre>
  
  <p>I've also tried linking to the source document, didn't work either..
  huge thanks to anyone who has a moment</p>
  
  <p>EDIT: If this isn't possible, is there an alternative to 'onload' for anything but ? I was having header issues with cookies and calling it from onload</p>