Magento removes the script tag

I have problems with Magento (Magento Version 1.5.1.0). Does Magento do some output / markup / js filtering?

I placed the script tags inside the * .phtml template (without the CMS block)

<script type="text/javascript">
// echo foo
function foo() {
}
</script>

When I look at the html source this tag is missing. All other surrounding marks are visible. I checked the path to the template and cleared the cache. Any hints or ideas?

Yours faithfully

+5
source share
3 answers

I had the same strange problem, making it clear that the cache is not involved and is not called by browser plugins. What it costs: javascript is executed, but variables must be declared as follows:

// Not working
var foo = 'baz';
// Working
window.foo = 'baz';

Do not ask me why.

+2
source

, Magento Layout/Block/ phtml HTML /ro.

, phtml - , ?

, /, , .

.

+1

The same question here today, was the HF_Defer extension causing it. When you encounter this problem, it will be a faster way to create the temremove folder inside app / etc / modules. Then simply move all the files from the custom module to this folder. Then return 5 to 5 of them to see when it starts / stops working normally.

0
source

All Articles