iframe と javascript を配置する場所に文字列がありますが、htmlString
どういうわけか JavaScript が実行されていませんloadHTMLString
。
NSString *htmlString = [NSString stringWithFormat:
@"<html><head><meta name = \"viewport\"content = \"initial-scale = 1.0, user-scalable = no\"/><script type=\"text/javascript\">"
@"alert (\"hello1\")"
@"function ready() {"
// Keep a reference to Froogaloop for this player
@"var player = $f(player),"
@"$fplayer.api('play');}"
@"window.addEventListener('load', function() {"
@"alert (\"hello\")"
@" $f(player).addEvent('ready', ready);"
@" });"
@" </script></head><body><iframe id=\"player\" src=\"http://player.vimeo.com/video/8118831?api=1&player_id=player\" width=\"320\" height=\"480\" frameborder=\"0\" webkitallowfullscreen allowfullscreen></iframe>"
@"</body></html>",@"http://www.vimeo.com/8118831"
];