0

An external client of ours asked to do a few changes to a website build in Composite C1, we have no experience with this system, although we do have experience in a similar system (Umbraco).

So far so good, only I'm running into a little problem regarding character espacing on a page.

On a specific contentpage I need to add a bit of Javascript on the body.

<body onload="_googWcmGet('gnumber', '+33 0 00 000 00')">

I can place this normally on the page, but when viewing the source on the live site it results in the following, non-working code:

<body onload="_googWcmGet(&#39;gnumber&#39;, &#39;+33 0 00 000 00&#39;)">

I've tried to work around this (by loading in a extra javascript file on this page, but sadly the site can't use jQuery..), but so far no luck.

Is it possible to escape these, or print them Raw in Composite C1?

Rann
  • 111
  • 1

1 Answers1

0

In order to achieve what you 're trying to do , you have to put your script as mentioned in the documentation here

Using <, >, & etc. in inline JavaScript

You can freely use characters such as <, >, & etc in JavaScript if you:

put your JavaScript code in an external file, or use CDATA sections within your elements, like this:

<script>
<![CDATA[
    if (1 < 2 && 3 > 0) then alert(‘hello world’);
]]>
</script>
Alfred Severo
  • 496
  • 5
  • 15