SharkTheDark
SharkTheDark

Reputation: 3119

Javascript in CakePHP

I had one page in Views in CakePHP, it have normal javascript block, Just inserted:

<script language="JavaScript" type="text/javascript">
---code---
</script>

Inside page, and it was all working okay... But now... It doesn't show... How can I change configuration or something to enable showing javascript blocks without CakePHP commands. Javascript needs data from that page so I can't use outer file, and it's too long to use $javascript->codeBlock

Is there any way to reconfigure stupid CakePHP to start showing those blocks? Some files are showing javascript, and it's working all okay, but some of them won't show...

Please help...

Upvotes: 0

Views: 848

Answers (1)

Leo
Leo

Reputation: 6571

If you mean that you want to view the code when the page is displayed, try surrounding it with <pre>...</pre>

If you mean you want the browser to process the code, then provided you are

  1. actually going to that view file and
  2. the code isn't commented out (<!-- ... --> or <?php /* ?> ... <?php */ ?> etc.) and
  3. the code isn't being obliviated by a php conditional (if ... then ... else... endif)

then it will be there. Try Firefox ctrl-u to view the source.

Also try posting the view code here so that we can give you some sort of informed solution.

Upvotes: 3

Related Questions