I’d like to do something like this:
dojo.place(this.message.subject, this.apSubject);
But it throw exception in Dojo 1.7 (I’m completely new to Dojo so I don’t know if the same problem is under older versions)
To get it work I did:
dojo.place('<span>' + this.message.subject + '</span>', this.apSubject);
It looks like Dojo parse the first parameter of dojo.place and if there is no HTML it throw exception.
How to use it without spans?
Check the docs, In particular, the description of what the first argument receives:
Therefore, one things you can do is create a text node with the text you want
And another thing you could try would be setting the innerHTML instead of using dojo.place:
BTW, In my humble opinion, dojo.place is normaly kind of annoying to use. However, since I am not often doing this kind of DOM manipulation, I don’t really know what are the alternatives people prefer to use.