I am trying to create a simple TicTacToe game. It works fine in
Firefox and IE but I have a problem with running it on iPhone. In my
validation method (look below) I am checking if the table cells
contains three same elements in rows/columns or cross. I also added
the alert() to check what url is used in different browsers and I
believe that the problem lays in document.getELementById
().style.backgroundImage=url();.

In firefox the url is url(x.png) but the safari shows full path: url
(www.cs.uwf.edu/~jchudzyn/tic/x.png).
Do you have to use full path for each image in the safari and iPhone?
Or there is another way to solve it?
Thank you for all answers,
Florida Bee

function checkLogic(){
var A=document.getElementById('A').style.backgroundImage;
var B=document.getElementById('B').style.backgroundImage;
var C=document.getElementById('C').style.backgroundImage;
var D=document.getElementById('D').style.backgroundImage;
var E=document.getElementById('E').style.backgroundImage;
var F=document.getElementById('F').style.backgroundImage;
var G=document.getElementById('G').style.backgroundImage;
var H=document.getElementById('H').style.backgroundImage;
var I=document.getElementById('I').style.backgroundImage;
var O="url(o.png)";
var X="url(x.png)";

alert(document.getElementById('A').style.backgroundImage);
if(A==X&&B==X&&C==X||D==X&&E==X&&F==X||G==X&&H==X&&I==X)
        {
                check=1;
                winner='X';
        }




The game is under:
http://www.cs.uwf.edu/~jchudzyn/tic/tic.html

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"iPhoneWebDev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/iphonewebdev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to