I'm surprised this question doesn't come up more often. It's a tricky issue, and one that is highly open to interpretation.
Disclaimer: I am not a lawyer.
There is not a lot of specific guidance on this issue, but a well-researched overview of the topic was published by The International Free and Open Source Software Law Review, titled "Open source licensing notices in Web applications."
On that page, the author (Arnoud Engelfriet) discusses different means of satisfying license clauses for open source licenses, and some consequences if it's not done correctly. With respect to the MIT license and its requirement to be displayed, Engelfriet has this to say:
This requirement makes it hard to comply without actually including the verbatim text of the license in the Javascript file. We could follow the same approach as with the BSD license and interpret “shall be included” as “must not be removed” but the use of the active verb ‘shall’ makes this a harder interpretation.
The author draws this conclusion:
There is a very real desire to not include full open source license texts in Javascript files when those are downloaded by browsers. For distributions of Javascript projects in original form (with source code, documentation etcetera) this issue is less apparent, as the overhead of a single license file is small.
Virtually all projects that use open source and Javascript in practice simply refer to the license text as hosted on their own website. I found no project that actually copied an open source license text in a Javascript file.
Most open source licenses do not provide obstacles against this practice. As long as the license is identified and available by URL, one may consider this as adequate notice. I therefore conclude that authors of Javascript files can license by including a reference to the license and a URL where the license text can be found.
He ends the article by providing sample text for a possible short form and long form attribution notice, to be included in the file header.
Based on this article and on other Stack Exchange questions about the same subject, I would say (in my non-lawyerly opinion) that if you can reasonably accommodate it, the first option you listed in your question is the best one. However, if you went with option #2, you would probably be fine, as it seems others have taken that same route.