Problem loading external pages with iPhone Beta and OS 3+

Forum for discussing building user interfaces for controlling MLServer using the iPhone or iPod Touch.
User avatar
jrfuda
Expert
Expert
Posts: 943
Joined: Mon Oct 06, 2003 5:59 pm
Location: San Antonio, TX, USA
Contact:

Problem loading external pages with iPhone Beta and OS 3+

Postby jrfuda » Mon Oct 05, 2009 1:11 pm

Ever since updating my iTouch OS to 3.0 I've been unable to load any custom pages from index.html. When I click them, the little "spinning wheel" apears for a moment and then the page never appears. If I hold the link, I can get it to open in a new window by selecting that from the pop up window. These external pages are from HomeSeer, on the same server as MLServer, but using a different port. I have no issue loading them using Safari in WinXP, only on the iTouch.

I updated my iTouch to 3.1x, hoping it would fix the problem, but it has not.

Is there some sort of time out in one of the associated scripts that is not giving the page enough time to load. Pages that are common to the MLServer webserver load fine. My customized index.html is below. All the pages that are linked to via

Code: Select all

<a href="http://###.###.#.#:####/...">
are the pages that will not load directly (of course, with all the #'s replaced by appropriate numbers representing the IP and Port.

Code: Select all

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Automation Controls</title>
<meta name="viewport" content="width=320; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"/>
<style type="text/css" media="screen">@import "styles/ui.css";</style>
<script type="application/x-javascript" src="scripts/ui.js"></script>
</head>

<body>
    <div class="toolbar">
        <h1 id="pageTitle"></h1>
        <a id="backButton" class="button" href="#"></a>
    </div>
   
    <ul id="home" title="Main" selected="true">
        <li><a href="#movies">Movies</a></li>
        <li><a href="#weather">Weather</a></li>
        <li><a href="#cameras">Cameras</a></li>
        <li><a href="http://###.###.#.#:####/mycontrol/mycontrol.ash?val=IP1">Devices</a></li>
        <li><a href="http://###.###.#.#:####/mycontrol/mycontrol.ash?val=IP11">Events</a></li>
        <li><a href="#remotes">Remote Controls</a></li>
        <li><a href="http://###.###.#.#:####/mycontrol/mycontrol.ash?val=IPFav">Favorite Channels</a></li>
        <li><a href="http://###.###.#.#:####/mycontrol/mycontrol.ash?val=IPCID">Caller ID</a></li>
        <li><a href="http://###.###.#.#:####/mycontrol/mycontrol.ash?val=IPStatus">Status</a></li>
    </ul>

    <ul id="weather" title="Weather">
        <li><a mlcmd="MLWeatherLobby|Active~1" href="weather.html">{{mlweatherlobby_location_description_01}}</a></li>
        <li><a mlcmd="MLWeatherLobby|Active~2" href="weather.html">{{mlweatherlobby_location_description_02}}</a></li>
        <li><a mlcmd="MLWeatherLobby|Active~3" href="weather.html">{{mlweatherlobby_location_description_03}}</a></li>
        <li><a mlcmd="MLWeatherLobby|Active~4" href="weather.html">{{mlweatherlobby_location_description_04}}</a></li>
    </ul>
      
    <ul id="movies" title="Movies">
        <li><a mvfilter="All Movies" href="movies.html">All Movies</a></li>
        <li><a mvfilter="Recently Added" href="movies.html">Recently Added</a></li>
        <li><a mvfilter="Recently Watched" href="movies.html">Recently Watched</a></li>
        <li><a mvfilter="Most Watched" href="movies.html">Most Watched</a></li>
        <li><a mvfilter="Never Watched" href="movies.html">Never Watched</a></li>
        <li><a href="#ratings">By Ratings</a></li>
        <li><a href="#genres">By Genres</a></li>
<!--    <li><a href="#alpha">Alphabetically</a></li> -->
    </ul>

    <ul id="genres" title="Genres">
        <li><a mvfilter="Action Adventure" href="movies.html">Action Adventure</a></li>
        <li><a mvfilter="Animation" href="movies.html">Animation</a></li>
        <li><a mvfilter="Classic" href="movies.html">Classic</a></li>
        <li><a mvfilter="Comedy" href="movies.html">Comedy</a></li>
        <li><a mvfilter="Concert" href="movies.html">Concert</a></li>
        <li><a mvfilter="Crime" href="movies.html">Crime</a></li>
        <li><a mvfilter="Documentary" href="movies.html">Documentary</a></li>
        <li><a mvfilter="Drama" href="movies.html">Drama</a></li>
        <li><a mvfilter="Family" href="movies.html">Family</a></li>
        <li><a mvfilter="Fantasy" href="movies.html">Fantasy</a></li>
        <li><a mvfilter="Games" href="movies.html">Games</a></li>
        <li><a mvfilter="Historical" href="movies.html">Historical</a></li>
        <li><a mvfilter="Holiday" href="movies.html">Holiday</a></li>
        <li><a mvfilter="Horror" href="movies.html">Horror</a></li>
        <li><a mvfilter="Martial Arts" href="movies.html">Martial Arts</a></li>
        <li><a mvfilter="Musical" href="movies.html">Musical</a></li>
        <li><a mvfilter="Romance" href="movies.html">Romance</a></li>
        <li><a mvfilter="Science Fiction" href="movies.html">Science Fiction</a></li>
        <li><a mvfilter="Suspense" href="movies.html">Suspense</a></li>
        <li><a mvfilter="Television" href="movies.html">Television</a></li>
        <li><a mvfilter="Thriller" href="movies.html">Thriller</a></li>
        <li><a mvfilter="War" href="movies.html">War</a></li>
        <li><a mvfilter="Western" href="movies.html">Western</a></li>
        <li><a mvfilter="Bootleg" href="movies.html">Bootleg</a></li>
    </ul>

    <ul id="ratings" title="Ratings">
        <li><a mvfilter="G" href="movies.html">G - General Audiences</a></li>
        <li><a mvfilter="PG" href="movies.html">PG - Parental Guidance</a></li>
        <li><a mvfilter="PG-13" href="movies.html">PG-13 - Children over 13</a></li>
        <li><a mvfilter="R" href="movies.html">R - No one under 16</a></li>
        <li><a mvfilter="NR" href="movies.html">NR - Not Rated</a></li>
        <li><a mvfilter="NC-17" href="movies.html">NC-17 - Adults</a></li>
    </ul>

<!--<ul id="alpha" title="Alphabetical">
        <li><a mvfilter="All Movies" mlcmd="Macro|SetVariable|dvdbrowse_alphapercent_{{clientname}}~4!SetVariable|dvdbrowse_alphachar_{{clientname}}~A!SetVariable|dvdbrowse_alphavalue_{{clientname}}~1" href="movies.html">A</a></li>
        <li><a mvfilter="All Movies" mlcmd="Macro|SetVariable|dvdbrowse_alphapercent_{{clientname}}~8!SetVariable|dvdbrowse_alphachar_{{clientname}}~B!SetVariable|dvdbrowse_alphavalue_{{clientname}}~2" href="movies.html">B</a></li>
        <li><a mvfilter="All Movies" mlcmd="Macro|SetVariable|dvdbrowse_alphapercent_{{clientname}}~12!SetVariable|dvdbrowse_alphachar_{{clientname}}~C!SetVariable|dvdbrowse_alphavalue_{{clientname}}~3" href="movies.html">C</a></li>
    </ul> -->

    <ul id="cameras" title="Cameras">
        <li><a href="http://###.###.#.#:####/mycontrol/mycontrol.ash?val=IPkcam">Kitchen</a></li>
        <li><a href="http://###.###.#.#:####/mycontrol/mycontrol.ash?val=IPpcam">Playroom</a></li>
    </ul>

    <ul id="remotes" title="Remote Controls">
        <li><a href="http://###.###.#.#:####/mycontrol/mycontrol.ash?val=IPDish">Dish Network</a></li>
        <li><a href="http://###.###.#.#:####/mycontrol/mycontrol.ash?val=IPDVD1">DVD Changer 1</a></li>
        <li><a href="http://###.###.#.#:####/mycontrol/mycontrol.ash?val=IPDVD2">DVD Changer 2</a></li>
        <li><a href="http://###.###.#.#:####/mycontrol/mycontrol.ash?val=IPRec">Receiver</a></li>
        <li><a href="http://###.###.#.#:####/mycontrol/mycontrol.ash?val=IPSqz">Squeezebox</a></li>
        <li><a href="http://###.###.#.#:####/mycontrol/mycontrol.ash?val=IPTV">TV</a></li>
    </ul>

<!-- <div id="about" title="About" class="panel">
        <h2>Mainlobby for the iPhone<br>Version 0.0.0.2</h2>
        <fieldset>
            <div class="row" align="left">
                Copyright &copy; 2008&nbsp;&nbsp;&nbsp;<br>Cinemar Solutions, Inc.&nbsp;&nbsp;&nbsp;
            </div>
        </fieldset>
    </div> -->

</body>
</html>

beerguy
Senior Member
Senior Member
Posts: 198
Joined: Mon Jan 16, 2006 10:44 pm
Contact:

Re: Problem loading external pages with iPhone Beta and OS 3+

Postby beerguy » Mon Oct 05, 2009 5:30 pm

I had the same problem several months ago and I'm pretty sure it had to do with JavaScript being turned off. Go into Settings then Safari and make sure that JavaScript is on. See if that works.

Pat

User avatar
jrfuda
Expert
Expert
Posts: 943
Joined: Mon Oct 06, 2003 5:59 pm
Location: San Antonio, TX, USA
Contact:

Re: Problem loading external pages with iPhone Beta and OS 3+

Postby jrfuda » Tue Oct 06, 2009 3:17 pm

beerguy wrote:I had the same problem several months ago and I'm pretty sure it had to do with JavaScript being turned off. Go into Settings then Safari and make sure that JavaScript is on. See if that works.

Pat
That was among the first things I tried.

Pages that are on the same server:port (MLServer-based pages) load fine, it's just external pages that are the issue. Once I'm on an external page (any website or any of my custom made pages from HomeSeer) everything loads fine. I'm thinking there's something in ui.js that worked with OS<3 but not OS>3...

User avatar
CinemarDave
Site Admin
Site Admin
Posts: 10535
Joined: Fri Feb 07, 2003 8:56 am
Location: Planet Earth
Contact:

Re: Problem loading external pages with iPhone Beta and OS 3+

Postby CinemarDave » Tue Oct 06, 2009 6:37 pm

If you open these pages from Safari on a Windows PC do they work? If they don't view the source in the browser to see if it differs from what you want. There is nothing in the JavaScript files that would make the links not work.

User avatar
jrfuda
Expert
Expert
Posts: 943
Joined: Mon Oct 06, 2003 5:59 pm
Location: San Antonio, TX, USA
Contact:

Re: Problem loading external pages with iPhone Beta and OS 3+

Postby jrfuda » Tue Oct 06, 2009 9:49 pm

They load fine in Safari in windows, the only issue is loading them from a page served by MLServer on my iTouch.

MLserver-hosted pages load fine from other MLServer hosted pages.
HomeSeer-hosted pages CAN load other HomeSeer-hosted pages or MLServer-hosted pages.
MLServer-hosted pages CANNOT load my HomeSeer hosted pages, the link just shows the spinning wheel for half a second, then nothing happens. The pages will load, however, if I hold the link down and select "open in a new window" from the pop-up in the iTouch.

This all worked fine prior to iPhone OS 3.

User avatar
jrfuda
Expert
Expert
Posts: 943
Joined: Mon Oct 06, 2003 5:59 pm
Location: San Antonio, TX, USA
Contact:

FIXED: Problem loading external pages with iPhone Beta and O

Postby jrfuda » Tue Oct 13, 2009 8:32 am

I started thinking about how safari was intepreting the code and added this to my html header:

Code: Select all

<base href="http://MYSERVERIP:PORT/iphone/" />
<base target="_top" />

and it worked. I think the browser was having trouble differentiating between relative and absolute URLs... the relative URLs were working, but not the absolute ones. I added the targer attribute too, but think it was the base href that did the trick


Return to “iPhone / iPod Touch Beta”

Who is online

Users browsing this forum: No registered users and 1 guest