Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

JS thorugh proxy issues
 
nostrzak
Jr. Member
 
Avatar
Total Posts:  22
Joined:  2007-09-18
Wroclaw, Poland
 

Hi,

I’m making new theme from scratch for Magento.

I’m adding some jscript in page.xml like this:

<action method="addJs"><script>jquery/jquery-1.2.6.min.js</script></action>
<
action method="addJs"><script>jquery/jquery.pngFix.pack.js</script></action>
<
action method="addJs"><script>jquery/jquery-ui-personalized-1.5.2.packed.js</script></action>

and later in my mainpage.phtml (created as CMS design pattern) I add:

<script type="text/javascript">
        $(
document).ready(function(){
            
$('#container').pngFix();
            $(
'#choose').pngFix();
            $(
'#need_help').click(function(){ alert('Customer service.');});
            $(
'#choose').accordion({header"div.picker"});
        
});
</script>

whitch is quite standard code for jQuery. The thing is the $ sign is not recognised. The JS is loading (checked in FireBug) but it’s loading to late? ... I don’t know what’s the deal.

 
Magento Community Magento Community
Magento Community
Magento Community
 
nostrzak
Jr. Member
 
Avatar
Total Posts:  22
Joined:  2007-09-18
Wroclaw, Poland
 

*SOLVED*

Well it’s proxy.php issue. This file is merging files appending one to another without new line between them. So code after // or after end of line of previous file may not work in some cases (like mine). To solve this change:

in line 76:
from:

$out .= file_get_contents($p);
to:
$out .= file_get_contents($p)."\n";

and all works perfect now.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top