Search

I want to use: http://hivelogic.com/enkoder/index.php to encode an email address in the footer of a client. However, the Javascript that should be added to the footer will result in XSLT parse errors. How can I output this without errors?

Example Javascript that should be somewhere in my HTML: <script type="text/javascript"> //<![CDATA[ //]]> </script>

Forum doesn't like it. Well, have a look here at an example of the Javascript: http://pastebin.com/aqkWsDXU

I've made an Enkoder friendly utility here: https://gist.github.com/1618229.

There are a bunch of hex characters (for new line feeds) that I put in to pretty up the output, but they are not required. If you don't care about the output's formatting, the code can be shrunk down a fair bit.

Also not that there is one line of code in the JS that I had to change. I changed i-- to i=i-1 since -- is technically an illegal set of characters within a comment element (tsk, tsk, Dan Benjamin).

Note that as good practice for Symphony development, you should look at moving all inline JS into an external JS file.

Thanks for your reply. I didn't know a document.write in an external file would be inserted at the place of the <script> tag. I externalized this, making it a lot easier. Thanks!

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details