How dose the morning after pill work ?

I've never taken the morning after pill so I don't know anythink about it.. but I had sex on 13th 14th an early hours on the 15th an early hours this morning around 2 am an I had it again this morning about 11.30am I did take a ovulation test yesterday that was positive so would it even be to late for me to take morning after pill now ?