shervanf Posted July 23, 2016 Share Posted July 23, 2016 (edited) hello i have some problems i want to add some codes in header.tpl but presta changes my codes by adding cdata to that. how can i remove that code???? this is my original codes: <script type="text/javascript"> var script = document.createElement("script"); script.src = 'http://www.mitrarank.ir/search/5787b62485c53/' + encodeURIComponent(document.referrer); script.type="text/javascript"; document.getElementsByTagName("head")[0].appendChild(script); </script> but my site shows: <script type="text/javascript">/* <![CDATA[ */;var script=document.createElement("script");script.src='http://www.mitrarank.ir/search/5787b62485c53/'+encodeURIComponent(document.referrer);script.type="text/javascript";document.getElementsByTagName("head")[0].appendChild(script);/* ]]> */</script> Edited July 23, 2016 by shervanf (see edit history) Link to comment Share on other sites More sharing options...
shokinro Posted July 23, 2016 Share Posted July 23, 2016 (edited) do you edit the theme file directly? and even though the CDATA should not affect the script to work as long as your code is correct and working. Edited July 23, 2016 by shokinro (see edit history) Link to comment Share on other sites More sharing options...
shervanf Posted July 23, 2016 Author Share Posted July 23, 2016 i tried these solutions :1.by adding code directly in header.tpl in theme file 2. using theme widget in my theme i put those script below the <header> but it doesnt work. it affects my code because developer site says : they didnt find their code in my site. Link to comment Share on other sites More sharing options...
shervanf Posted July 24, 2016 Author Share Posted July 24, 2016 any idea???? Link to comment Share on other sites More sharing options...
shokinro Posted July 25, 2016 Share Posted July 25, 2016 I do not think /*<![CDATA[*/ and /* ]]> */ will affect because they are all commented out. it must be your code itself. Or you can change CCC setting to disable all minimisation or cache options to see if the cdata will disappear or not - back office - Advanced Parameters - Performances tab. if you disable all those options, then it should be output as is - what you entered in your theme file. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now