javascript - Cannot get Geolocation script to work -


I have written the following code, but for some reason this does not work please thank you

 < Code> & lt; Script & gt; $ .getScript ('http://www.geoplugin.net/javascript.gp', function () {$ location = geoplugin_countryCode (); $ location2 = geoplugin_contentCode (); if ($ location == "ca" || $ Location == "US" || $ location2 == "EU" || $ location2 == "DE" || $ location2 == "FR" || $ location2 == "GB") {Alert ($ location); Var_gaq = _gaq || []; _gaq.push (['_ setAccount', 'UA-9240 923-27']); _gaq.push (['_ trackPageview']); (function () {var ga = Document.createElement ('script'); ga.type = 'text / javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol? 'Https: // ssl': 'Http: // www') + '.google-analytics.com / ga.js'; var s = document.getElementsByTagName ('script') [0]; s.parentNode.insertBefore (ga, s);}) ();} {Var _gaq = _gaq || []; _gaq.push (['_ setAccount', 'UA-9240 923-27']); _gaq.push (['_ trackPageview']); (function ) {Var ga = Document.createElement ('script'); ga.type = 'text / javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol? 'Https: // ssl' : 'Http: // www') + 'g oogle-analytics.com/ga.js'; Var s = document.getElementsByTagName ('script') [0]; S.parentNode.insertBefore (GA, S); }) (); }}); & Lt; / Script & gt;    

This is not an appropriate answer yet, as it is still not clear What is the real problem, but to explain OP, I will post it as a reply.

  $ .getScript ('http://www.geoplugin.net/javascript.gp', function () {$ Location = geoplugin_countryCode (); $ location2 = geoplugin_contentCode (); if ( $ Location == "ca" || $ location == "US" || $ location2 == "EU" || $ location2 == "DE" $$ Location2 == "FR" || $ place2 == " GB ") {Warning ($ location);}}); / * * I'm not sure that you want to successfully complete * loading Google Analytics inside the GetScript callback *, so I have not made it clear until it is carried to here. * / Var _gaq = _gaq || []; _gaq.push (['_ setAccount', 'UA-9240 923-27']); _gaq.push (['_ trackPageview']); (Function () {var ga = document.createElement ('script'); ga.type = 'text / javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol? 'Http: //ssl': 'http: // www') + '.google-analytics.com / ga.js'; var s = document.getElementsByTagName ('script') [0]; s.parentNode.insertBefore (GA, S);}) ();    

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -