5

How do I create a new Image in ClojureScript?

I want the equivalent of new Image(); in JavaScript

I have tried (new Image) (Image. )

What am I missing?

1 Answer 1

15

You need to qualify Image with the js "magic namespace":

(js/Image.)
Sign up to request clarification or add additional context in comments.

1 Comment

You can also use (def img (js/document.createElement "img"))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.