Website not working on ipad

Hi

I created a website from my arduino and everything works fine from chrome and internet explorer.
but when i want to open the site with my ipad i receive the something like message safari cannot open page because server not responding anymore
i have a dutch message so i translated it myself.

on my arduino everything i receive or send looks the same.
when i open the site from my arduino with my laptop save the html on my inet webserver my ipad can open the page. so it's not a html issue.

i only use the ethernet library
the only command i use is server.print
example.

n=sprintf_P(LogBuffer,PSTR("sitename<style type="text/css">BODY { font-family: sans-serif; background: #000000 }"));
Server.print(LogBuffer);

and client.stop();
do i need to close something on a different way

Kind regards

Johan

You can try the below meta refresh code to see if it will work with your ipad.

// zoomkat meta refresh server test code
// arduino IDE 1.0
// for W5100 ethernet shield
// the IP address will be dependent on your local network/router
// port 80 is default for HTTP, but can be changed as needed
// use IP address like http://192.168.1.102:84 in your brouser
// or http://zoomkat.no-ip.com:84 with dynamic IP service
// use the \ slash to escape the " in the html
// meta refresh set for 2 seconds

#include <SPI.h>
#include <Ethernet.h>

int x=0; //set refresh counter to 0
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
IPAddress ip(192,168,1,102); // ip in lan
EthernetServer server(84); //server is using port 84

void setup()
{
  // start the server
  Ethernet.begin(mac, ip);
  server.begin();
}

void loop()
{
  // listen for incoming clients
  EthernetClient client = server.available();
  if (client) {
     while (client.connected()) {
      if (client.available()) {
        char c = client.read();
        // see if HTTP request has ended with blank line
        if (c == '\n') {
          // send a standard http response header
          client.println("HTTP/1.1 200 OK");
          client.println("Content-Type: text/html");
          client.println();
          
          //meta-refresh page every 2 seconds
          x=x+1; //page upload counter
          client.println("<HTML>");
          client.print("<HEAD>");
          client.print("<meta http-equiv=\"refresh\" content=\"2\">");
          client.print("<TITLE />Zoomkat's meta-refresh test</title>");
          client.print("</head>");
          client.println("<BODY>");
          client.print("Zoomkat's meta-refresh test IDE 1.0");
          client.println("
");
                    
          client.print("page refresh number ");
          client.println(x); //current refresh count
          client.println("
");
          client.println("
");
          
          client.print("Zoomkat's arduino analog input values:");
          client.println("
");
          client.println("
");
          
          // output the value of each analog input pin
          for (int analogChannel = 0; analogChannel < 6; analogChannel++) {
            client.print("analog input ");
            client.print(analogChannel);
            client.print(" is ");
            client.print(analogRead(analogChannel));
            client.println("
");
            }
           break;
          client.println("</BODY>");
          client.println("</HTML>");
         }
        }
    }
    // give the web browser time to receive the data
    delay(1);
    // close the connection:
    client.stop();
  }
}

is your ipad on the same network (ie wifi) or using another (like cellular)?

Place your Ipad in the oven for 15 mins at around 220c / 430f, reduce for fan-forced. If that doesn't work, try the microwave.

Nah, just kidding, you probably just have to give apple more money.

Just tried to cut out some of the code
and made it work without the rest of the program.
but also the metadata refresh isn't the solution

#include <SPI.h>
#include <Ethernet.h>

byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
EthernetServer Server(80); 

int n;
char LogBuffer[300];
char buffer[128];


void setup(){
  Ethernet.begin(mac);
  Server.begin();}

void loop(){
  EthernetClient client = Server.available();
  if (client)
  { WaitForRequest(client);
    WebMenu(0);
    delay(1);
    client.stop();
  }}


void WebMenu(int WelkMenu){
Server.print("<html><head><title>titel</title><style type=\"text/css\">BODY");
Server.print("</style></head><body>");
Server.print("<table ALIGN=center cellspacing=5>");
Server.print("<tr><td ><BUTTON TYPE = BUTTON style=background-color:#0000FF;><B><FONT COLOR=#00FF00>Return</FONT></B></BUTTON></td></tr>");  
Server.print("</table>");
Server.print("</body></html>");}

void WaitForRequest(EthernetClient client){
  int bufferSize = 0;
  while (client.connected()) {
    if (client.available()) {
      char c = client.read();
      if (c == '\n')
        break;
      else
        if (bufferSize <  128)
          buffer[bufferSize++] = c;
        else
          break;}}
}

Solved
thx for the sample.

after adding
client.println("HTTP/1.1 200 OK");
client.println("Content-Type: text/html");
client.println();

and in my case
Server.println

everything is working including line graphs etc