Can an embedded Java Applet be hosted on Git-Pages?

旧时模样 提交于 2019-12-11 11:34:35

问题


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:

  1. Create a jar file for your Applet.
  2. Place the .jar file into the root of your gh-pages branch.
  3. 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" />
    
  4. Commit/Push the changes and wait (sometimes gh-pages are not updated immediately).



来源:https://stackoverflow.com/questions/24719538/can-an-embedded-java-applet-be-hosted-on-git-pages

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!