|
Post by chuckh on May 17, 2015 2:01:58 GMT
I updated one of the websites I am working on to have a mobile redirect following the example from Frank and his tutorial. I thought I did everything right but I ran into a problem. The pages are giving me javascript errors when I test view them in Antenna, but when I test them on the browser without Antenna it's fine, also my cell phone shows the site theme for my desktop not my mobile. The javascript error I get is this:
An error has occurred on the script on this page. Line 18 Char 1 Error 'RedirectMobile' is undefined Code 0 URL: file://C/Users?Chuck% 20H/~Antenna/Site874gkalt/cache/mobile/m.index0.htm
The redirect code for the Desktop is:
<meta name="viewport" content="width=1150"> <script type="text/javascript" src="js/redirect_enc.js"></script> <script type="text/javascript"> RedirectMobile('http://www.terilyongraphics.com/mobile/m.index0.htm',0); </script>
For the Mobile page is:
<meta name="viewport" content="width=320"> <script type="text/javascript" src="../js/redirect_enc.js"></script> <script type="text/javascript"> RedirectMobile('http://www.terilyongraphics.com/index.htm',0); </script>
Everything seems to be ok, where did I go wrong? Attachments:
|
|
|
Post by Graham on May 17, 2015 2:13:42 GMT
Is the site uploaded Looking at your error it's pointing to your local pc. Can you give me a link so I can test your site live
Graham
Sent from my SM-N9005 using proboards
|
|
|
Post by chuckh on May 17, 2015 2:42:26 GMT
|
|
|
Post by Graham on May 17, 2015 2:45:03 GMT
this actually looks like the original redirect script I wrote and the turotial is on Antenna tutorials site.
Its much easier now to use the latest Antenna with its built in mobile redirect.
To use it make all your mobile pages etc as you have normally done. then on each of the desktop pages add the mobile redirect by clicking o n the purple magnify glass on the Antenna toolbar and selecting mobile redirect. All you do then is link to the mobile page your redirecting to and that's all
Graham
|
|
|
Post by Graham on May 17, 2015 2:46:24 GMT
It redirected perfect for me
Graham
Sent from my SM-N9005 using proboards
|
|
|
Post by Frank on May 17, 2015 11:11:32 GMT
It's not redirecting for me, just showing the desktop. This is the mobile version: www.terilyongraphics.com/mobile/m.index0.htm the redirect on it isn't working either. - I see the redirect script included twice? (see below) - I also could not find the actual js/redirect_enc.js file being referenced? (according to the script it should be at: www.terilyongraphics.com/js/redirect_enc.js but it isn't) Desktop:... <script type="text/javascript" src="js/redirect_enc.js"></script> <script type="text/javascript"> RedirectMobile('http://www.terilyongraphics.com/mobile/m.index0.htm',0); </script> <meta name="viewport" content="width=1150"> <script type="text/javascript" src="js/redirect_enc.js"></script> <script type="text/javascript"> RedirectMobile('http://www.terilyongraphics.com/mobile/m.index0.htm',0); </script> I would recommend using the built in mobile redirect as per Grahams comments. Cheers, Frank
|
|
|
Post by Frank on May 17, 2015 11:48:35 GMT
I just noticed another thing... the mobile page though it says 320 px wide has large graphics (the lion being drawing gif, live music and avon image) way off the page on the bottom right... you need to scroll down So the mobile version does not show up correctly on the phone.
Frank
|
|
|
Post by chuckh on May 18, 2015 16:03:18 GMT
I reworked the site using the "mobile redirect" app in Antenna and I was not sure if I should have kept the "js" folder that you said to add to copy in the java script file from the old instructions so I deleted it and tried to view the site on my cell phone but it did not work. So I went back to Antenna and put the "js" folder and js file back in, but it is still not working. I get a (404 error) message when I try to view it on my cell with a URL www.terilyongraphics.com/js/m.index0.htm. I did notice that Antenna has two "m.theme" files in it. One is the original one that I created and put into the "mobile" folder and the other one is the "js" file that I was instructed to copy into the "js folder". Am I still missing something here?
|
|
|
Post by Frank on May 18, 2015 16:31:11 GMT
Try using the redirect in Antenna instead of the js code as per grahams comment.... you can avoid the js all together. (remove visual and the js) I also sent you an message showing the antenna redirect at work. very simple and it works. Frank
|
|
|
Post by chuckh on May 18, 2015 17:26:09 GMT
I took out the "visual html" files by way of the "Layers" dropdown in both of the desktop pages I had a redirect for and made sure they had the "redirect" app in them and published the site, but still no good. It flashes the site for maybe a fraction of a second and then gives me a "404 error" on my phone.
|
|
|
Post by Frank on May 18, 2015 18:06:59 GMT
Do you have the mobile in a JS folder? Its trying to redirect to a page called m.index0.htm in a folder called JS
You added the redirect I can see it: <div id="mobr467cllvh" class="nvo abs" style="left:30px; top:230px;"><script type="text/javascript"> mobileRedirect(7.9,'js/m.index0.htm');</script></div>
Make sure the m.index0.htm is in the JS folder. Frank
|
|
|
Post by chuckh on May 18, 2015 18:39:56 GMT
ok, I got it to pull up on the phone but everything is tiny and the background image fills the rest of the screen, which is good, but everything else is tiny and on the left side, also I can pan the view to the right and that shows nothing but the background image. I put the redirect app in the desktop pages and made the links for each one to the mobile pages so now they are showing up on the phone....., but they are tiny.
|
|
|
Post by chuckh on May 18, 2015 18:43:49 GMT
Should the "m.theme" page be in the "js" folder in Antenna, I have it in the "root".
|
|
|
Post by chuckh on May 18, 2015 19:39:47 GMT
Just checked it again and now I see that the other page (Products & Samples) is showing on the phone the way it should be but not the "Home Page". Both pages are set up in Antenna with a mobile redirect and each page has it's counter-part mobile page in the "js" folder.
|
|
|
Post by chuckh on May 18, 2015 20:13:56 GMT
Alright guys, all is well. Yeay! I went to the m.index0.htm in the "js" folder in Antenna and set the "Paper width" to 1200 and found those items that Frank mentioned which were on the bottom right side and deleted them, then I reset the paper width to 320 and republished the site and now it looks fine. I think what happened was when I built the mobile pages I made duplicates of the desktop pages and renamed them and sized everything down to fit into the 320px width but I must have overlooked those few items that were over to the right and bottom which were not changed for the mobile page.
|
|