| | |
Problems with Ampersands and Google Website Optimizer in Joomla CMS
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Jun 2009
Posts: 1
Reputation:
Solved Threads: 0
I am using Joomla and trying to incorporate Google Website Optimizer code within content to test site images and text content. Below is the Control Script (note the Bolded Section):
When I view source on the page with this script included, I get the following:
In HTML, the content of <script> elements is supposed to be CDATA, but in this case it is not being rendered as such. One potential solution would be to include the script in a separate php file and include it from the content page <script src="…">.... Im going to try that now. ...
Followup: I tried to include the following in my content: <script type="text/javascript" src="/js/googlecontrolscript.js"></script> BUT that was all that was rendered in the output so this didn't work.
Any other ideas on how to present the '&' directly and not have it translate into &?
Thanks,
Nick
<script>
function utmx_section(){}function utmx(){}
(function(){var k='0241650748',d=document,l=d.location,c=d.cookie;function f(n){
if(c){var i=c.indexOf(n+'=');if(i>-1){var j=c.indexOf(';',i);return c.substring(i+n.
length+1,j<0?c.length:j)}}}var x=f('__utmx'),xx=f('__utmxx'),h=l.hash;
d.write('<sc'+'ript src="'+
'http'+(l.protocol=='https:'?'s://ssl':'://www')+'.google-analytics.com'
+'/siteopt.js?v=1&utmxkey='+k+'&utmx='+(x?x:'')+'&utmxx='+(xx?xx:'')+'&utmxtime='
+new Date().valueOf()+(h?'&utmxhash='+escape(h.substr(1)):'')+
'" type="text/javascript" charset="utf-8"></sc'+'ript>')})();
</script><script>
function utmx_section(){}function utmx(){}
(function(){var k='0241650748',d=document,l=d.location,c=d.cookie;function f(n){
if(c){var i=c.indexOf(n+'=');if(i>-1){var j=c.indexOf(';',i);return c.substring(i+n.
length+1,j<0?c.length:j)}}}var x=f('__utmx'),xx=f('__utmxx'),h=l.hash;
d.write('<sc'+'ript src="'+
'http'+(l.protocol=='https:'?'s://ssl':'://www')+'.google-analytics.com'
+'/siteopt.js?v=1&utmxkey='+k+'&utmx='+(x?x:'')+'&utmxx='+(xx?xx:'')+'&utmxtime='
+new Date().valueOf()+(h?'&utmxhash='+escape(h.substr(1)):'')+
'" type="text/javascript" charset="utf-8"></sc'+'ript>')})();
</script>Followup: I tried to include the following in my content: <script type="text/javascript" src="/js/googlecontrolscript.js"></script> BUT that was all that was rendered in the output so this didn't work.
Any other ideas on how to present the '&' directly and not have it translate into &?
Thanks,
Nick
Last edited by Tekmaven; Jun 11th, 2009 at 11:04 pm. Reason: Code Tags
try changing the outermost script tags to
PHP Syntax (Toggle Plain Text)
<script type='text/javascript'> <!-- <![CDATA[
PHP Syntax (Toggle Plain Text)
]]> --> </script>
Last edited by almostbob; Jun 11th, 2009 at 9:37 pm.
Failure is not an option It's included free, you don't have to do anything to get it
If at first you dont succeed, join the club
Of course its always in the last place you look, you dont keep looking after you find it
Please mark solved problems, solved
If at first you dont succeed, join the club
Of course its always in the last place you look, you dont keep looking after you find it
Please mark solved problems, solved
![]() |
Similar Threads
- Website Account Creation to SQL game database (Game Development)
- About language translotor?? (PHP)
- Making of Hindi WebSite (PHP)
- Google Crawling Problem (IT Professionals' Lounge)
- Web Design/development: combining speed and quality (Post your Resume)
- Google maps php/js help needed. (PHP)
- Converting website templates to Joomla (IT Professionals' Lounge)
- any help on CMS?? (IT Professionals' Lounge)
- Problems with Google.com (Viruses, Spyware and other Nasties)
- help with setting up a forum site (PHP)
Other Threads in the PHP Forum
- Previous Thread: Display a dynamic page in textfield
- Next Thread: HTML link contains '&' as part of a string, not a separator
| Thread Tools | Search this Thread |
.htaccess action ajax apache api array auto beginner binary bounce broken cakephp checkbox class cms code cron curl database date display dynamic echo email error errorlog file files folder form format forms function functions google href htaccess html image include insert integration interactive ip java javascript joomla limit link login loop mail malfunctioning masterthesis menu mlm mod_rewrite multiple mysql nodes oop paypal pdf php popup problem query radio ram random recursion reference regex remote return script search server sessions sms soap source space sql syntax system table tutorial unset update upload url validation validator variable video web websitecontactform xml youtube






