Order XXXIX Rule 3 requires the court ordinarily to direct notice to the opposite party before granting an injunction, and permits an ex parte order only where the object of the injunction would be defeated by delay. In that situation the court must record the reasons for proceeding ex parte, which allows the affected party to challenge the order and protects against arbitrary interim relief. An injunction granted without notice and without reasons is vulnerable in appeal, since it denies the affected party a hearing.