Compare the HTML of the page that works with the generated HTML of the JSP page that does not. See what the differences are that may cause different behavior.
Impossible. If two identical HTML pages are sent to a browser they will act the same. The fact that one was generated by a JSP is moot. There is a difference that you;re not detecting.
Aside: why on earth are you using strings with HTML inside them in a JSP? The whole purpose of a JSP is so that you can place HTML markup as template text!
Oh, OK. Whew! I thought you were writing your code that way! (Some do!)
In any case -- take the .html file, rename it to .jsp. That way you know that the exact same HTML will be sent to the browser. Do they act the same, or differently?
OK, that's rather inexplicable. The only explanation could be (and this seems highly unlikely) that the Yahoo! library is looking at the URL (which is the only thing that is different) and doing something different based upon that.
At this point, you'll need to post an SSCE so that we can recreate the issue ourselves.