added iframe detection to createElement()
added iframe detection to write()