Shop OBEX P1 Docs P2 Docs Learn Events
Pink and my IPOD — Parallax Forums

Pink and my IPOD

Jay BedardJay Bedard Posts: 4
edited 2011-07-31 18:27 in General Discussion
I have a pink card serving a web site and relaying info to a basic stamp. The web stuff works fine on ie8 but will not work on the safari on my ipod. I am updating the varaibles useing the form post method. Here is a sample of the code for the pink web. Does anybody see something I am missing?

<html>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<body>
<script type="text/javascript">
function FormSubmit()
{
document.getElementById("firstry").submit()
}

var status="<Nb_varSV>";
var ipaddr = "<Nb_varSI>";
var testit1 = "<Nb_var01>";
var testit2 = "<Nb_var02>";
var testit3 = "<Nb_var03>";
var TimeOfDay = "<Nb_var10>";
var testit11 = "<Nb_var11>";
var WeekDay = "<Nb_var12>";
var TheDate = "<Nb_var13>";
var theday=["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday","Friday","Saturday"];

if (testit1==10)
{
//document.write("The Red Led Should be on <br>");
RedOnString='<input name="Nb_var01" type="radio" value="10" checked onclick="FormSubmit()"></input>'
RedOffString='<input name="Nb_var01" type="radio" value="11" onclick="FormSubmit()"></input>'
RedLedBlink ='<input name="Nb_var01" type="radio" value="12" onclick="FormSubmit()" ></input>'
}
else if (testit1==11)
{
//document.write("The Red Led Should be Off");
RedOnString='<input name="Nb_var01" type="radio" value="10" onclick="FormSubmit()"></input>'
RedOffString='<input name="Nb_var01" type="radio" value="11" checked onclick="FormSubmit()"></input>'
RedLedBlink ='<input name="Nb_var01" type="radio" value="12" onclick="FormSubmit()" ></input>'
}
else if (testit1==12)
{
//document.write("The Red Led Should Blink");
RedOnString='<input name="Nb_var01" type="radio" value="10" onclick="FormSubmit()"></input>'
RedOffString='<input name="Nb_var01" type="radio" value="11" onclick="FormSubmit()"></input>'
RedLedBlink ='<input name="Nb_var01" type="radio" value="12" checked onclick="FormSubmit()"></input>'
}
else
{
//document.write("No Red Led Selection");
RedOnString='<input name="Nb_var01" type="radio" value="10" onclick="FormSubmit()"></input>'
RedOffString='<input name="Nb_var01" type="radio" value="11" onclick="FormSubmit()"></input>'
RedLedBlink ='<input name="Nb_var01" type="radio" value="12" onclick="FormSubmit()"></input>'
}
if (testit2==10)
{
//document.write("The Red Led Should be on");
GreenLedOnString='<input name="Nb_var02" type="radio" value="10" checked onclick="FormSubmit()"></input>'
GreenLedOffString='<input name="Nb_var02" type="radio" value="11" onclick="FormSubmit()"></input>'
GreenLedBlink = '<input name="Nb_var02" type="radio" value="12" onclick="FormSubmit()"></input>'
}
else if (testit2==11)
{
//document.write("The Red Led Should be Off");
GreenLedOnString='<input name="Nb_var02" type="radio" value="10" onclick="FormSubmit()"></input>'
GreenLedOffString='<input name="Nb_var02" type="radio" value="11" checked onclick="FormSubmit()"></input>'
GreenLedBlink = '<input name="Nb_var02" type="radio" value="12" onclick="FormSubmit()"></input>'
}
else if (testit2==12)
{
//document.write("There are no leds lit");
GreenLedOnString='<input name="Nb_var02" type="radio" value="10" onclick="FormSubmit()"></input>'
GreenLedOffString='<input name="Nb_var02" type="radio" value="11" onclick="FormSubmit()"></input>'
GreenLedBlink = '<input name="Nb_var02" type="radio" value="12" checked onclick="FormSubmit()"></input>'
}
else
{
//document.write("There are no leds lit");
GreenLedOnString='<input name="Nb_var02" type="radio" value="10" onclick="FormSubmit()"></input>'
GreenLedOffString='<input name="Nb_var02" type="radio" value="11" onclick="FormSubmit()"></input>'
GreenLedBlink = '<input name="Nb_var02" type="radio" value="12" onclick="FormSubmit()"></input>'
}
if (testit3==10)
{
//document.write("The Red Led Should be on");
YellowLedOnString='<input name="Nb_var03" type="radio" value="10" checked onclick="FormSubmit()"></input>'
YellowLedOffString='<input name="Nb_var03" type="radio" value="11" onclick="FormSubmit()"></input>'
YellowLedBlink = '<input name="Nb_var03" type="radio" value="12" onclick="FormSubmit()"></input>'
}
else if (testit3==11)
{
//document.write("The Red Led Should be Off");
YellowLedOnString='<input name="Nb_var03" type="radio" value="10" onclick="FormSubmit()"></input>'
YellowLedOffString='<input name="Nb_var03" type="radio" value="11" checked onclick="FormSubmit()"></input>'
YellowLedBlink = '<input name="Nb_var03" type="radio" value="12" onclick="FormSubmit()"></input>'
}
else if (testit3==12)
{
//document.write("There are no leds lit");
YellowLedOnString='<input name="Nb_var03" type="radio" value="10" onclick="FormSubmit()"></input>'
YellowLedOffString='<input name="Nb_var03" type="radio" value="11" onclick="FormSubmit()"></input>'
YellowLedBlink = '<input name="Nb_var03" type="radio" value="12" checked onclick="FormSubmit()"></input>'
}
else
{
//document.write("There are no leds lit");
YellowLedOnString='<input name="Nb_var03" type="radio" value="10" onclick="FormSubmit()"></input>'
YellowLedOffString='<input name="Nb_var03" type="radio" value="11" onclick="FormSubmit()"></input>'
YellowLedBlink = '<input name="Nb_var03" type="radio" value="12" onclick="FormSubmit()"></input>'
}

</script>

<form id="firstry" method="post" action="index.htm">
<table border="6" bgcolor=#D4D9DE cellpadding="10">
<tr>
<th colspan = "4" ><h2>Home Device Controller<br></h2>
<script>document.write("Time: " + TimeOfDay)</script><br>
<script>document.write("Date: " + theday[WeekDay]+" "+ TheDate)</script><br>
<script>document.write("Local IP addr: "+ipaddr)</script>
</tr>
<tr>
<th>Outputs
<td>On</td>
<td>Off</td>
<td>Schedule</td>
</tr>
<tr>
<th>Unit #1 - Green Led</th>
<td>
<script>document.write(GreenLedOnString)</script>
</td>
<td>
<script>document.write(GreenLedOffString)</script>
</td>
<td>
<script>document.write(GreenLedBlink)</script>
</td>
</tr>
<tr>
<th>Unit #2 - Family Room Light #1</th>
<td>
<script>document.write(RedOnString)</script>
</td>
<td>
<script>document.write(RedOffString)</script>
</td>
<td>
<script>document.write(RedLedBlink)</script>
</td>
</tr>
<tr>
<th>Unit #3 - Family Room Light #2</th>
<td>
<script>document.write(YellowLedOnString)</script>
</td>
<td>
<script>document.write(YellowLedOffString)</script>
</td>
<td>
<script>document.write(YellowLedBlink)</script>
</td>
</tr>
</table>
</form>
</body>
</html>

Comments

  • FranklinFranklin Posts: 4,747
    edited 2011-07-31 13:04
    Have you tried it in Safari on your PC?
  • GadgetmanGadgetman Posts: 2,436
    edited 2011-07-31 14:13
    The only thing I see immediately is that you don't have a 'Head' in your code, but that really shouldn't cause any problems?

    What do you mean with 'do not work'?
  • Jay BedardJay Bedard Posts: 4
    edited 2011-07-31 14:50
    Yes the pc version of safari does the same thing. When I put the ip address into the browser initially it loads the page fine, when I select a different radio button I get the "Safari cannot open the page because it could not connect to the server." message. When I refresh the page I get the original page before the changes.
  • GadgetmanGadgetman Posts: 2,436
    edited 2011-07-31 15:01
    What happens if you try to serve the pages from another type of server?

    www.uniformserver.com is good for experimenting as it doesn't require installation on your PC.
    (I think you should be able to get the access logs from it. That way you can see if there's any differences in file requests from the different browsers, and what those differences might be)
  • FranklinFranklin Posts: 4,747
    edited 2011-07-31 16:09
    Might be a problem with DNS not finding the correct IP for the page.
  • Kevin WoodKevin Wood Posts: 1,266
    edited 2011-07-31 18:27
    Are you sure about this line...
    <form id="firstry" method="post" action="index.htm">
    

    Make sure that the file name is correct (.htm vs. .html), and make sure that you don't need a realtive path indicator.
Sign In or Register to comment.