<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1044626" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1044626</link>
    <description></description>
    <language>en</language>
          <item>
    <title>Your &#039;mapsurface.js&#039; is</title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/insert-script-end-page-jquery#comment-1244227</link>
    <description> &lt;p&gt;Your &#039;mapsurface.js&#039; is triggered by the dcument.load event. I suspect that the load event has, on occasion, already occurred by the time the script has returned to your page.&lt;/p&gt;
 </description>
     <pubDate>Wed, 12 Aug 2009 23:43:43 +0000</pubDate>
 <dc:creator>webwiz</dc:creator>
 <guid isPermaLink="false">comment 1244227 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>The jQuery source reveals</title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/insert-script-end-page-jquery#comment-1244084</link>
    <description> &lt;p&gt;The jQuery source reveals that &lt;code&gt;getScript&lt;/code&gt; inserts a &lt;code&gt;script&lt;/code&gt; element into &lt;code&gt;head&lt;/code&gt;, whose &lt;code&gt;src&lt;/code&gt; attribute is set to the given URL.&lt;/p&gt;
&lt;p&gt;Lines 253-278 of &lt;a href=&quot;http://dev.jquery.com/browser/tags/1.3.2/src/ajax.js&quot;&gt;ajax.js [v1.3.2]&lt;/a&gt;:&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;var head = document.getElementsByTagName(&amp;quot;head&amp;quot;)[0];&lt;br /&gt;var script = document.createElement(&amp;quot;script&amp;quot;);&lt;br /&gt;script.src = s.url;&lt;br /&gt;...&lt;br /&gt;// Handle Script loading&lt;br /&gt;...&lt;br /&gt;head.appendChild(script);&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;(Note: a newer version of this code in svn uses &lt;code&gt;insertBefore&lt;/code&gt; to add the generated &lt;code&gt;script&lt;/code&gt; element as the first child of &lt;code&gt;head&lt;/code&gt;, instead of &lt;code&gt;appendChild&lt;/code&gt; as above in the current release.)&lt;/p&gt;
&lt;p&gt;As for viewing generated source, there are some Firefox extensions that can help.  &lt;a href=&quot;https://addons.mozilla.org/firefox/addon/60&quot;&gt;Web Developer&lt;/a&gt; has a &quot;View Generated Source&quot; function, and &lt;a href=&quot;https://addons.mozilla.org/en-US/firefox/addon/655&quot;&gt;View Source Chart&lt;/a&gt; shows modified DOM data.  I&#039;m not sure how reliably they work.  I&#039;ve yet to find them useful.&lt;/p&gt;
 </description>
     <pubDate>Thu, 06 Aug 2009 21:49:25 +0000</pubDate>
 <dc:creator>Abhishek Reddy</dc:creator>
 <guid isPermaLink="false">comment 1244084 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>Well, what do you know, it</title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/insert-script-end-page-jquery#comment-1244081</link>
    <description> &lt;p&gt;Well, what do you know, it does work in FF/Linux. I didn&#039;t know that it did that. The map view isn&#039;t working right in IE or Safari but Firefox is okay.&lt;/p&gt;
&lt;p&gt;I guess there&#039;s no problem after all, but in case others are looking for this it would be good to have an answer as to how the getScript is inserting the link and how you can view source with javascript modification.&lt;/p&gt;
 </description>
     <pubDate>Thu, 06 Aug 2009 20:29:07 +0000</pubDate>
 <dc:creator>Megan</dc:creator>
 <guid isPermaLink="false">comment 1244081 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>Megan wrote:
Now that I&#039;m</title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/insert-script-end-page-jquery#comment-1244080</link>
    <description> &lt;p&gt;&lt;div class=&quot;quote-msg&quot;&gt;&lt;div class=&quot;quote-author&quot;&gt;&lt;em&gt;Megan&lt;/em&gt; wrote:&lt;/div&gt;Now that I&#039;m calling it through document.ready using getScript it just doesn&#039;t work the way it&#039;s supposed to. But I can&#039;t see where it&#039;s being called to find out if there&#039;s anything I can do about it. Maybe getScript is putting the script call at the end of the page and it&#039;s still not working right??&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;Can you describe what isn&#039;t working correctly, and how it is supposed to work?  I&#039;m not sure I&#039;ve understood this script right.  Using Firefox 3.5 on GNU/Linux, most things appear to load and render more or less normally.  The only data that wouldn&#039;t display were the Links and Searches detailed views, but that looks more like a server-side issue.&lt;/p&gt;
 </description>
     <pubDate>Thu, 06 Aug 2009 20:20:00 +0000</pubDate>
 <dc:creator>Abhishek Reddy</dc:creator>
 <guid isPermaLink="false">comment 1244080 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>Well, I&#039;m not sure exactly</title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/insert-script-end-page-jquery#comment-1244073</link>
    <description> &lt;p&gt;Well, I&#039;m not sure exactly how the document.ready worked, but when I had the script just called at the end of the page the jquery stuff would take forever to render.&lt;/p&gt;
&lt;p&gt;Now that I&#039;m calling it through document.ready using getScript it just doesn&#039;t work the way it&#039;s supposed to. But I can&#039;t see where it&#039;s being called to find out if there&#039;s anything I can do about it. Maybe getScript is putting the script call at the end of the page and it&#039;s still not working right?? &lt;/p&gt;
&lt;p&gt;Here&#039;s the page in question:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.uwaterloo.ca/facultystaff/&quot; title=&quot;http://www.uwaterloo.ca/facultystaff/&quot;&gt;http://www.uwaterloo.ca/facultystaff/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Press alt-X in a native browser (I think it only works in IE/Win and Safari/Mac) to see what it does. This is a really old legacy script that I don&#039;t think is being maintained anymore but at the moment we don&#039;t have a better way of tracking clicks on external links.&lt;/p&gt;
 </description>
     <pubDate>Thu, 06 Aug 2009 14:20:00 +0000</pubDate>
 <dc:creator>Megan</dc:creator>
 <guid isPermaLink="false">comment 1244073 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>I&#039;ve had the same problems</title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/insert-script-end-page-jquery#comment-1244057</link>
    <description> &lt;p&gt;I&#039;ve had the same problems with a similar setup, but only because I was loading another javascript not through jQuery.  jQuery would load but the other won&#039;t, and I get an error.  But you are calling the other script vai jQuery so it should work in theory.&lt;/p&gt;
 </description>
     <pubDate>Thu, 06 Aug 2009 07:37:07 +0000</pubDate>
 <dc:creator>jamespvee</dc:creator>
 <guid isPermaLink="false">comment 1244057 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>Megan wrote:
jQuery&#039;s</title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/insert-script-end-page-jquery#comment-1244036</link>
    <description> &lt;p&gt;&lt;div class=&quot;quote-msg&quot;&gt;&lt;div class=&quot;quote-author&quot;&gt;&lt;em&gt;Megan&lt;/em&gt; wrote:&lt;/div&gt;jQuery&#039;s document.ready means that none of the jQuery stuff can be done until this script is loaded&lt;/div&gt;&lt;br /&gt;
Are you sure about this? AFAIK document.ready fires the moment the DOM is loaded. It&#039;s true that any scripts placed high in the document - in the &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt; for example - get interpreted before the parser moves on to load the rest of the page. That&#039;s due to the expectation that a script &lt;strong&gt;might&lt;/strong&gt; issue a &#039;document.write&#039; that changes the DOM.&lt;/p&gt;
&lt;p&gt;That&#039;s why, with few exceptions, scripts should be placed just before the closing  tag. The DOM has been loaded by this time; the jQuery &#039;document.ready&#039; fires; and you are in business.&lt;/p&gt;
&lt;p&gt;If the tracking script takes significant time to load, there&#039;s something amiss. All browsers have made significant improvements to their implementation of JS over the last couple of years, loading and running orders of magnitude faster than a few years ago... I suggest you check your page loading profile in a tool such as Safari&#039;s Web Inspector (under Resources) or YSlow for Firefox.&lt;/p&gt;
 </description>
     <pubDate>Wed, 05 Aug 2009 23:39:38 +0000</pubDate>
 <dc:creator>webwiz</dc:creator>
 <guid isPermaLink="false">comment 1244036 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>I&#039;m not sure how you&#039;d view</title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/insert-script-end-page-jquery#comment-1244029</link>
    <description> &lt;p&gt;I&#039;m not sure how you&#039;d view generated source.  But it seems like mapsurface.js initializes a variable called _ms that you could test for in a Firebug console.&lt;/p&gt;
&lt;p&gt;Also try passing a function to getScript as a second parameter, to check if loading succeeded.&lt;/p&gt;
&lt;p&gt;I just tried an isolated test case that was at least able to load the script successfully, and initialize _ms.  It&#039;s not obvious why it might be failing for you.  Could you provide a live demo to look at?&lt;/p&gt;
 </description>
     <pubDate>Wed, 05 Aug 2009 20:21:08 +0000</pubDate>
 <dc:creator>Abhishek Reddy</dc:creator>
 <guid isPermaLink="false">comment 1244029 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
