Advanced javascript game in php -


my goal javascript code wordpress php , have no clue how go doing without getting error message. end goal have javascript game embeded on wordpress page. i've checked dozens of other articles none specific enough code this. code i'm looking include php below dummy website links. can me! in advance.

<script src="http://www.java.com/js/deployjava.js"></script> <script>    var attributes = {      codebase: 'my_website',      code: 'vnes.class',      archive: 'my_website',      width: 512,      height: 480   };   var parameters = {      sound: "on",      timeemulation: "on",      fps: "off",      stereo: "off",      rom: "my_website/game.zig",      showsoundbuffer: "off",      scale: "on",      scanlines: "off",      nicesound: "on",      romsize: 40976   };   deployjava.setinstallertype('online');   // deployjava.setinstallertype('kernel');   if (deployjava.versioncheck('1.5+')) {      deployjava.runapplet(attributes, parameters, '1.5');   } else {      document.write("<br />");      document.write("<b style='color: red;'>your browser not appear have java installed.</b>");      document.write("<b><a href='#' onclick='javascript:deployjava.installlatestjre();'>click here install java run-time.</a></b><br /><br />");      if (navigator.useragent.indexof("chrome") != -1 && navigator.useragent.indexof("mac os x") != -1) {        document.write("<b style='color: red;'>");        document.write("please note google chrome under macos x not support java applets, consider temporarily switching firefox or safari if macos x user.<br /><br />");        document.write("</b>");      }      document.write("this page has been tested , works latest versions of following windows browsers: firefox, google chrome, internet explorer, opera , safari.<br /><br />");     document.write("this page has been tested , works latest versions of following macos x browsers: firefox, opera , safari.<br /><br />");   } </script> 

can post error message getting? experience wordpress should pretty straight forward. in wordpress want show up? on index page?

if case can either echo each line or escape script closing , opening php tags. idea same above document.write("...");

only need escape " marks

echo"<script src=\"http://www.java.com/js/deployjava.js\"></script>"; 

also... can add code below

<?php  (php code...) ?>  <script type="text/javascript"> window.location = "http://www.google.com/" </script>  <?php  (php code continues...) ?> 

hope helps. in wordpress go files , edit index file, depends on want place in wordpress. either way have edit files working correctly.

also can add new page wordpress...

duplicate post.php in theme folder (under /wp-content/themes/themename/).

rename file somenameyouwant.php

at top add:

<?php /* template name: templatename */ ?> 

you can modify file (using php) include other files or whatever need.

then create new page in wordpress blog , in page editing screen you'll see 'template' dropdown in 'attributes' widget right. select new template , publish page.

your new page use php code defined in templatename.php


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -