<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/wordpress-mu-1.0" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: Followup: Creating rich GUIs with Javascript in Symfony</title>
	<link>http://symfony.sopca.com/2007/06/13/followup-creating-rich-guis-with-javascript-in-symfony/</link>
	<description>Symfony, PHP and web development directly from the horse's mouth</description>
	<pubDate>Fri, 09 Jan 2009 02:32:27 +0000</pubDate>
	<generator>http://wordpress.org/?v=wordpress-mu-1.0</generator>

	<item>
		<title>by: Krof Drakula</title>
		<link>http://symfony.sopca.com/2007/06/13/followup-creating-rich-guis-with-javascript-in-symfony/#comment-2442</link>
		<pubDate>Sat, 26 Jul 2008 14:37:22 +0000</pubDate>
		<guid>http://symfony.sopca.com/2007/06/13/followup-creating-rich-guis-with-javascript-in-symfony/#comment-2442</guid>
					<description>&lt;p&gt;I've never had a problem loading up my Javascript files - but it seems to me you're trying to use scripts without having the appropriate resources when executing. There can be a number of reasons, most of which I can't really discount due to lack of input, but I'd check the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;make sure the script tags are loaded in the correct order. Having your JS files load after the main library scripts is crucial. Have a look at the resulting head script tags and make sure they're loaded in the correct order. If not, trace my post for possible gotchas.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Symfony is bundled with Prototype and can override jQuery's $ function when using Javascript helpers - use "jQuery.&lt;em&gt;" instead or wrap your functions inside (function($) { /&lt;/em&gt; your code */ })(jQuery);&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;if your script is executing when pasting it in the template, make sure that upon execution, the DOM elements are already parsed into the DOM model. Basically, you don't want to modify the DOM until it is ready. If you have standalone statements like $("div.hidden").hide(); try wrapping the whole code block inside&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;$(function() { /* ... */ });&lt;/p&gt;

&lt;p&gt;That's shorthand for $(document).ready(function() { /* ... */ });. Without it, the DOM elements you're trying to manipulate don't exist yet when the code executes (in the case of having a bare statement in a script inside the head).&lt;/p&gt;

&lt;p&gt;If all else fails, feel free to contact me at krof dot drakula at gmail dot com.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I&#8217;ve never had a problem loading up my Javascript files - but it seems to me you&#8217;re trying to use scripts without having the appropriate resources when executing. There can be a number of reasons, most of which I can&#8217;t really discount due to lack of input, but I&#8217;d check the following:</p>
<ul>
<li>
<p>make sure the script tags are loaded in the correct order. Having your JS files load after the main library scripts is crucial. Have a look at the resulting head script tags and make sure they&#8217;re loaded in the correct order. If not, trace my post for possible gotchas.</p>
</li>
<li>
<p>Symfony is bundled with Prototype and can override jQuery&#8217;s $ function when using Javascript helpers - use &#8220;jQuery.<em>&#8221; instead or wrap your functions inside (function($) { /</em> your code */ })(jQuery);</p>
</li>
<li>
<p>if your script is executing when pasting it in the template, make sure that upon execution, the DOM elements are already parsed into the DOM model. Basically, you don&#8217;t want to modify the DOM until it is ready. If you have standalone statements like $(&#8221;div.hidden&#8221;).hide(); try wrapping the whole code block inside</p>
</li>
</ul>
<p>$(function() { /* &#8230; */ });</p>
<p>That&#8217;s shorthand for $(document).ready(function() { /* &#8230; */ });. Without it, the DOM elements you&#8217;re trying to manipulate don&#8217;t exist yet when the code executes (in the case of having a bare statement in a script inside the head).</p>
<p>If all else fails, feel free to contact me at krof dot drakula at gmail dot com.</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: PHP programmer</title>
		<link>http://symfony.sopca.com/2007/06/13/followup-creating-rich-guis-with-javascript-in-symfony/#comment-2441</link>
		<pubDate>Sat, 26 Jul 2008 14:17:15 +0000</pubDate>
		<guid>http://symfony.sopca.com/2007/06/13/followup-creating-rich-guis-with-javascript-in-symfony/#comment-2441</guid>
					<description>&lt;p&gt;Hi&lt;/p&gt;

&lt;p&gt;I have problem with own js scripts. In /web/js/ I have jquery file and my own file with script. jQuery is loaded globaly in /apps/config/view.yml and my own script is loaded on module level in /apps/module/config/view.yml
And it doesn't work correct. I use Firebug and jQuery and my own script looks like loaded correctly, but my scripts doesn't work. But if I paste my js script into template all works perfect.
It's strange because I don't paste jQuery into template ind it works.&lt;/p&gt;

&lt;p&gt;So do you know how to load own raw javascript files?&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Hi</p>
<p>I have problem with own js scripts. In /web/js/ I have jquery file and my own file with script. jQuery is loaded globaly in /apps/config/view.yml and my own script is loaded on module level in /apps/module/config/view.yml<br />
And it doesn&#8217;t work correct. I use Firebug and jQuery and my own script looks like loaded correctly, but my scripts doesn&#8217;t work. But if I paste my js script into template all works perfect.<br />
It&#8217;s strange because I don&#8217;t paste jQuery into template ind it works.</p>
<p>So do you know how to load own raw javascript files?</p>
]]></content:encoded>
				</item>
</channel>
</rss>
