Home » Forum
NoNumber!

Joomla!® Websites & Extensions
development  -  support  -  consultancy

I try to respond within 48 hours (excluding weekends).
If I haven't responded by then, feel free to post a reminder or bug me via email.

My last reply was: 2 Hours, 26 Minutes ago.

Welcome, Guest
Please Login or Register.    Lost Password?

[SOLVED] Some Google Javascript oddness
(1 viewing) (1) Guest
Go to bottomPage: 1
TOPIC: [SOLVED] Some Google Javascript oddness
#57
[SOLVED] Some Google Javascript oddness 3 Years, 7 Months ago  
I have a bit of code from google I am trying to insert:

<script>
function utmx_section(){}function utmx(){}
(function(){var k='0404766662',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>

Whether I use noeditor or sourcerer, I get this as the output:

<script>
function utmx_section(){}function utmx(){}
(function(){var k='0404766662',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>

There is a / getting added after a '

Expected to find: te('<sc'+'ript src="'+'
Found on line 85: te('<sc'+'ript src="/'+

I can't for the life of me figure out why Joomla is insisting on putting this in.

Try it yourself with the first code snippet.....
compass
Posts: 8
User OfflineClick here to see the profile of this user
The administrator has disabled public write access.
 
#58
[SOLVED] Some Google Javascript oddness 3 Years, 7 Months ago  
For some odd reason Joomla (or the database) doesn't like the " folowed by a '.
Try this, i think it should work:
...'<sc'+'ript src='+'"http...

instead of:
...'<sc'+'ript src="'+'http...

Peter van Westen
Admin
Posts: 9169
User Online NowClick here to see the profile of this user
The administrator has disabled public write access.
Need to contact me directly? Go to my contact page.
If you use any NoNumber! extensions, please post a rating and a review at the Joomla! Extensions Directory.
Are you happy with the support? Please consider buying a License Code to help me to continue development and support.
 
#64
[SOLVED] Some Google Javascript oddness 3 Years, 7 Months ago  
Thanks, I'll give that a shot....
compass
Posts: 8
User OfflineClick here to see the profile of this user
The administrator has disabled public write access.
 
#93
[SOLVED] Some Google Javascript oddness 3 Years, 7 Months ago  
So, did that do the trick?
Peter van Westen
Admin
Posts: 9169
User Online NowClick here to see the profile of this user
The administrator has disabled public write access.
Need to contact me directly? Go to my contact page.
If you use any NoNumber! extensions, please post a rating and a review at the Joomla! Extensions Directory.
Are you happy with the support? Please consider buying a License Code to help me to continue development and support.
 
#117
[SOLVED] Some Google Javascript oddness 3 Years, 7 Months ago  
Nope

If you switch that the google code will not work...

Fancy helping with some paid consulting to get this to work?

compass
Posts: 8
User OfflineClick here to see the profile of this user
The administrator has disabled public write access.
 
#120
[SOLVED] Some Google Javascript oddness 3 Years, 7 Months ago  
What is the code actually supposed to do?
Peter van Westen
Admin
Posts: 9169
User Online NowClick here to see the profile of this user
The administrator has disabled public write access.
Need to contact me directly? Go to my contact page.
If you use any NoNumber! extensions, please post a rating and a review at the Joomla! Extensions Directory.
Are you happy with the support? Please consider buying a License Code to help me to continue development and support.
 
#122
[SOLVED] Some Google Javascript oddness 3 Years, 7 Months ago  
Its from google web optimizer....

It does some tricksy google thing I have no idea of
compass
Posts: 8
User OfflineClick here to see the profile of this user
The administrator has disabled public write access.
 
#123
[SOLVED] Some Google Javascript oddness 3 Years, 7 Months ago  
The change in the code I suggested, should not change the functioning of the javascript. What is the final output in your browser if you do this?
<script>
function utmx_section(){}function utmx(){}
(function(){var k='0404766662',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>

Peter van Westen
Admin
Posts: 9169
User Online NowClick here to see the profile of this user
The administrator has disabled public write access.
Need to contact me directly? Go to my contact page.
If you use any NoNumber! extensions, please post a rating and a review at the Joomla! Extensions Directory.
Are you happy with the support? Please consider buying a License Code to help me to continue development and support.
 
#125
[SOLVED] Some Google Javascript oddness 3 Years, 7 Months ago  
Isn't that the original one?

Anyhoo, if I use:

...'<sc'+'ript src='+'"http...

the Google web optimizer does not work....
compass
Posts: 8
User OfflineClick here to see the profile of this user
The administrator has disabled public write access.
 
#128
[SOLVED] Some Google Javascript oddness 3 Years, 7 Months ago  
Oh, sorry... doh. You're right, I mean this:
The change in the code I suggested, should not change the functioning of the javascript. What is the final output in your browser if you do this?

<script>
function utmx_section(){}function utmx(){}
(function(){var k='0404766662',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>

But again, my question: What is the final output in your browser if you do this? So what is the code in your final html source?
Peter van Westen
Admin
Posts: 9169
User Online NowClick here to see the profile of this user
The administrator has disabled public write access.
Need to contact me directly? Go to my contact page.
If you use any NoNumber! extensions, please post a rating and a review at the Joomla! Extensions Directory.
Are you happy with the support? Please consider buying a License Code to help me to continue development and support.
 
#163
[SOLVED] Some Google Javascript oddness 3 Years, 7 Months ago  
It outputs it with the change, but then the google widget farts with an error (it doesnt like it)
compass
Posts: 8
User OfflineClick here to see the profile of this user
The administrator has disabled public write access.
 
#215
[SOLVED] Some Google Javascript oddness 3 Years, 6 Months ago  
Sorry for the late reply,
It's hard to know what is going wrong without seeing it. Can you give me an online example where it goes wrong?
Peter van Westen
Admin
Posts: 9169
User Online NowClick here to see the profile of this user
The administrator has disabled public write access.
Need to contact me directly? Go to my contact page.
If you use any NoNumber! extensions, please post a rating and a review at the Joomla! Extensions Directory.
Are you happy with the support? Please consider buying a License Code to help me to continue development and support.
 
#218
[SOLVED] Some Google Javascript oddness 3 Years, 6 Months ago  
It looks like we fixed it, it was an issue with sef.php that was sticking a path in when it shouldnt have!
compass
Posts: 8
User OfflineClick here to see the profile of this user
The administrator has disabled public write access.
 
#219
[SOLVED] Some Google Javascript oddness 3 Years, 6 Months ago  
Ok, good to hear it works now!
Peter van Westen
Admin
Posts: 9169
User Online NowClick here to see the profile of this user
The administrator has disabled public write access.
Need to contact me directly? Go to my contact page.
If you use any NoNumber! extensions, please post a rating and a review at the Joomla! Extensions Directory.
Are you happy with the support? Please consider buying a License Code to help me to continue development and support.
 
#220
[SOLVED] Some Google Javascript oddness 3 Years, 6 Months ago  
Thanks for your help, appreciated!
compass
Posts: 8
User OfflineClick here to see the profile of this user
The administrator has disabled public write access.
 
Go to topPage: 1
Moderators: Peter van Westen
MaxCDN | Content Delivery Network | Accelerate your site to the max
Open Source Training | Online Joomla! Training and Support
hosting joomla