Basic functionfor a blinking LED doesn't work, can you help me spot the error?

The code isn't a function yet, but later on it's supposed to take blinking on/off time as inputs and let several LEDs blink independently of one another.

Here's the code:

int on=250;  //the diode's on time
int off=250; //the diode's off time
int timer=1; //the timer counts milliseconds passed
int ifOn=1;  //1 if the diode's lit, 0 if it isn't


void setup() {
  pinMode(9,OUTPUT);
  digitalWrite(9,HIGH);
}

void loop() {
  delay(1);
  if(ifOn=1){
        if(timer>on){        //if the timer reached the on time, the diode turns off, and the timer resets
        ifOn=0;
        timer=1;
        digitalWrite(9,LOW);
        }
  }
  if(ifOn=0){                //and vice versa
       if(timer>off){
        ifOn=1;
        timer=1;
        digitalWrite(9,HIGH);
       }
  }
  timer++;
}

I know it's neither my PC nor my circuit at fault here, because a standard, 4-line code for a single blinking LED works fine.

Thanks in advance!

if(ifOn=1)Oops

Aw shiet, I keep doing that a lot
Thanks

SineInflammation:
I keep doing that a lot

Yup, twice in that one.

Can you do the same thing with millis() ?
Start here: https://www.arduino.cc/en/tutorial/BlinkWithoutDelay.
Every software timer with millis() requires its own 'previousMillis' variable.

And ....

Look at == instead of =