Link to home
Create AccountLog in
Avatar of Tom Powers
Tom Powers

asked on

if statements are ignored in reading them from a xml file.

This Football gamecast doesnot catch a if statement which will write text on top of the field Text using HTML Canvas. I watch this App blow past the part in which I USE THIS

if( $(Play).attr('PlayType') == "PERIODEND" ) {
            if( $(Play).attr('Status') == "HT") {
		   
	

	}  

Open in new window


This doesn't work I attached 86.xml which is the xml file with PlayType'== "PERIODEND
'Status' == "HT" This project is huge I can't get out of the starting gate figures.
GridIron2.html
AB-3171-86.xml
Avatar of Tom Powers
Tom Powers

ASKER

 canvas = document.getElementById('myCanvas');
   context = canvas.getContext('2d');
    
	if( $(Play).attr('PlayType') == "PERIODEND" ) {
            if( $(Play).attr('Status') == "HT") {
		   
	
var grd=context.createLinearGradient(0,0,200,0);
grd.addColorStop(0,"Yellow");
grd.addColorStop(1,"Orange");

// Fill with gradient
ctx.fillStyle=grd;
ctx.font="30px Arial";
ctx.fillText("Hafetime",10,50);
			}
	}  

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Robert Schutt
Robert Schutt
Flag of Netherlands image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
tHE if( $(Play).attr('PlayType') == "PERIODEND" ) {
          //  if( $(Play).attr('Status') == "HT") { IS causing all my problems any suggestions on what i'm missing like a && and AND Statement to join to statements