javascript - How to load a script only for certain country in blogger? -


i have script want load country in blogger, how can that?

i tried doing like

<script> if (url contains .com) {     <script src=""></script> } </script> 

but it's not working because nesting of script failing, first </script> tag closes outer <script> well.

like this,

<script> if (url.indexof(".com") > -1) {     var script = document.createelement('script');     script.src = "you/script/url";     document.getelementsbytagname('head')[0].appendchild(script); } </script> 

Comments

Popular posts from this blog

php - Invalid Cofiguration - yii\base\InvalidConfigException - Yii2 -

How to show in django cms breadcrumbs full path? -

ruby on rails - npm error: tunneling socket could not be established, cause=connect ETIMEDOUT -