I want to embed a java applet (stored in a git repository) in the accompanying github-pages page. Is this possible?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Yes.
Although GitHub pages can be generated through a simple markdown interface, any files in your branch will be served as part of your gh-pages-site.
This means you can host client side scripts like Java-Applets or JS on your GitHub Pages site.
To host a java applet:
- Create a jar file for your Applet.
- Place the .jar file into the root of your gh-pages branch.
Embed the applet in one of your html pages using your prefered method like this, or maybe this:
*Assuming foo.jar and Bar.class are your file and applet-class* <embed id="SomeName" type="application/x-java-applet;version=1.6" width="999" height="999" archive="foo.jar" code="Bar.class" pluginspage="http://java.com/download/" myParam="YourParams" />
Commit/Push the changes and wait (sometimes gh-pages are not updated immediately).