Trying to add JavaScript to <head>

Commercial shopping Joomla template to easy create webshop with various extensions supported like ViruteMart, K2 and K2Store.
Rate this topic: Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.1.00 out of 6 based on 1 vote(s)
GK User
Fri Nov 21, 2014 9:47 pm
Reply with quote
Report this post
I'm trying to add a javascript redirect to the <head> but It's not working for me. Here is the code:

Code: Select all
<script type="text/javascript">         
if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {
         window.location = 'http://m.onlineordersnow.com/partytimepizza/' ;
}
</script>


I get this error when I add the code:
Parse error: syntax error, unexpected '<' in /home/party/public_html/templates/gk_storebox/layouts/blocks/head.php on line 2

I am adding the code the file located at: /templates/gk_storebox/layouts/blocks/head.php

Could you tell me what I'm doing wrong? Your help is much appreciated.

Website: http://www.partytimepizza.com
User avatar
Fresh Boarder

GK User
Sat Nov 22, 2014 12:12 am
Reply with quote
Report this post
Hi,
if you're not php developer - do not touch template files. Good advice.
Read: https://www.gavick.com/documentation/jo ... ted-pages/

Those are suggestions. In J!ED you can find more similar plugins.
User avatar
Platinum Boarder

GK User
Mon Nov 24, 2014 10:14 pm
Reply with quote
Report this post
Thanks for the link. I'll look into which one is the best for me.
User avatar
Fresh Boarder

GK User
Tue Nov 25, 2014 9:14 am
Reply with quote
Report this post
check reviews on JED, if you're not sure.
User avatar
Platinum Boarder


cron