There is evidence that the word Allah existed much further back than the existence of Islam, such as having roots in pre-Christian Hebrew.
Also, there is plenty of evidence in the show that she had several masters before Tony, though we don't know how many. Most fans feel it's safe to assume she had at least a few (like 3 or 4) before her bottle was lost at sea. That's just a guess, but based on how she says some things about previous masters. So, she could also have in the service of a master at the time Islam came into being.
The writing on the point of her being trapped in her bottle was lazy. We just have to assume Jeannie means she's lived in her bottle for 2,000 years as an indicator of how long she's been alive, not that she hasn't been out of her bottle before Tony released her.
Remember that Jeannie also has the power to travel through time. Some speculate that she does just that while stuck at home with Tony at work. That would explain how she could know King Tutankhamen, considering he would not have been alive in her time.
This brings up something about time-travel that I feel the show assumed wrong in their use of it in the show. That the exact same amount of time spent in the past also passes in the present. Thus, if Jeannie and Tony spend twelve hours in the past, the same amount of time passes in the present before they return to it.
There's no reason it has to work that way. Jeannie could visit and befriend all of the historic figures she's mentioned in the past, stay with them for days or weeks, and still blink back to Tony's present as if no time had passed. She could have also done that back when she was serving her previous masters. Remember that if she can travel into the past, she has to then travel into the future to get back to her present time. She could easily have traveled into the future from her present time and learned about Islam that way, too
reply
share