Jump to content

JavaScript Doesn't Know How To Write


absorr

Recommended Posts

I need help debugging this because I can't find the problem. When I click the buttons that are supposed to make the script write in the correct code, it doesn't. The Google Chrome debuger is coming up with weird stuff and I don't understand why it thinks this.

<html><head><title>SimpServ - Simple Server Managment Dashboard</title><link rel="shortcut icon" href="simpservicon.png"><script language="javascript">function playman(){document.getElementById("area").innerHTML = "<b>Player Managment</b><br><form action=\"methods/playermain.php\" method=\"post\">Player Name: <input type=\"text\" name=\"name\" /><input type=\"hidden\" value=\"absorr\" name=\"user\"><input type=\"hidden\" value=\"homestar\" name="pass\"><input type=\"hidden\" value=\"salty goodness\" name=\"salt\"><input type=\"hidden\" value=\"20059\" name=\"port\"><input type=\"hidden\" value=\"174.101.159.155\" name=\"ip\"><input type=\"submit\" value=\"Get Info\"/></form>";}function plugman(){document.getElementById("area").innerHTML = "<b>Plugin Managment</b><br><a onclick=\"on()\">Turn On Plugin</a><br><a onclick=\"off()\">Turn Off Plugin</a><br><a onclick=\"upload()\">Upload Plugin</a><br><p id=\"area\"></p>";function off(){document.getElementById("area").innerHTML = "<form action=\"methods/disablePlugin.php\" method=\"post\">Plugin: <input type=\"text\" name=\"name\" /><input type=\"hidden\" value=\"absorr\" name=\"user\"><input type=\"hidden\" value=\"homestar\" name=\"pass\"><input type=\"hidden\" value=\"salty goodness\" name=\"salt\"><input type=\"hidden\" value=\"20059\" name=\"port\"><input type=\"hidden\" value=\"174.101.159.155\" name=\"ip\"><br><input type=\"submit\" /></form>";}function on(){document.getElementById("area").innerHTML = "<form action=\"methods/enablePlugin.php\" method=\"post\"><input type="hidden" value="absorr" name="user"><input type="hidden" value="homestar" name="pass"><input type="hidden" value="salty goodness" name="salt"><input type=\"hidden\" value=\"20059\" name=\"port\"><input type=\"hidden\" value=\"174.101.159.155\" name=\"ip\">Plugin: <input type=\"text\" name=\"name\" /><br><input type=\"submit\" /></form>";}function upload(){document.getElementById("area").innerHTML = "<form action=\"methods/upload.php\" method=\"post\" enctype=\"multipart/form-data\"><input type=\"hidden\" value=\"absorr\" name=\"user\"><input type=\"hidden\" value=\"homestar\" name=\"pass\"><input type=\"hidden\" value=\"salty goodness\" name=\"salt\"><input type=\"hidden\" value=\"20059\" name=\"port\"><input type=\"hidden\" value=\"174.101.159.155\" name=\"ip\"><input type=\"file\" name=\"file\" id=\"file\" /><input type=\"submit\" name=\"submit\" value=\"Submit\" /></form>";}function servman(){document.getElementById("area").innerHTML = "<b>Server Managment</b><br><a onclick=\"chatname()\">Chat With Name</a><br><a onclick=\"send()\">Broadcast Message</a><br><p id=\"area\"></p>";function servinfo(){document.getElementById("area").innerHTML = "<b>Server Managment</b><br><a onclick=\"read()\">Read File</a><br><a onClick=\"banIPlist()\">Banned IPs</a><br><a onClick=\"banlist()\">Banned Players</a><br><a onClick=\"loglist()\">Recent Connections</a><br><a onClick=\"chatlist()\">Recent Chats</a><br><a onClick=\"worldlist()\">List Worlds</a><br><p id=\"area\"></p>";function chatname(){document.getElementById("area").innerHTML = "<form action=\"methods/broadcastWithName.php\" method=\"post\"><input type=\"hidden\" value=\"absorr\" name=\"user\"><input type=\"hidden\" value=\"homestar\" name=\"pass\"><input type=\"hidden\" value=\"salty goodness\" name=\"salt\"><input type=\"hidden\" value=\"20059\" name=\"port\"><input type=\"hidden\" value=\"174.101.159.155\" name=\"ip\">Name: <input type=\"text\" name=\"name\" /><br>Message:<br> <TEXTAREA NAME=\"msg\" ROWS=\"10\" WRAP=\"hard\"></TEXTAREA><br><input type=\"submit\" /></form>";}function send(){document.getElementById("area").innerHTML = "<form action=\"methods/broadcastWithName.php\" method=\"post\"><input type=\"hidden\" value=\"absorr\" name=\"user\"><input type=\"hidden\" value=\"homestar\" name=\"pass\"><input type=\"hidden\" value=\"salty goodness\" name=\"salt\"><input type=\"hidden\" value=\"20059\" name=\"port\"><input type=\"hidden\" value=\"174.101.159.155\" name=\"ip\">Message:<br> <TEXTAREA NAME=\"msg\" ROWS=\"10\" WRAP=\"hard\"></TEXTAREA><br><input type=\"submit\" /></form>";function cust(){document.getElementById("area").innerHTML = "<p>You have no custom methods or other functions set. E-mail us at absorr@live.com and we will put it in for you. Custom JSONAPI methods can be created in the config file in your plugins folder. You may add things from other plugins too here.</p>";}</script></head><body bgcolor="#F0F0F0"><center><table height="10%" width="100%"><tr><td width="300"><img src="http://i499.photobucket.com/albums/rr358/Absorr/simpservbanneral.png" height="150"></font></td><td><b>TechCraft</b> git-Bukkit-1.1-R4-b1938jnks (MC: 1.1)  Players Online: 0/20</td></tr></table><table width="100%" height="90%"><tr><th align="center" bgcolor="#C8C8C8" width="30%" height="30">JSONAPI</th><th align="center" bgcolor="#C8C8C8" width="70%" height="30">Dynmap</th></tr><tr><td bgcolor="#B8B8B8" valign="top"><forum><input type="button" value="Player Managment" onClick="playman()" /><input type="button" value="Plugin Managment" onClick="plugman()" /><input type="button" value="Server Managment" onClick="servman()" /><input type="button" value="Server Information" onClick="servinfo()" /><input type="button" value="Custom Methods" onClick="cust()" /></form><p id="area"></p></td><td bgcolor="#B8B8B8"><iframe src="http://174.101.159.155:8123" width="100%" height="100%">EPIC FAILURE</iframe></td></tr></table><table width="100%" height="500"><tr><td width="50%" height="100%"><iframe src="methods/getLatestConsoleLogs.php" width="100%" height="100%">EPIC FAILURE</iframe></td><td><iframe src="advanced.html" width="100%" height="100%">EPIC FAILURE</iframe></td></tr><tr><td height="36"><iframe src="runit.html" width="100%" height="35">EPIC FAILURE</iframe></td><td>Made by Will Stephenson. Copyright Absorr Design (c) 2012. Thanks to JSONAPI and Dynmap and Bukkit</table></center></body></html>

Note the copyright at the bottom. Don't steal (not saying that I don't trust you guys, I'm saying this is the internet).

Link to comment
Share on other sites

What exactly happens, what are the errors?

The Google Chrome debuger is coming up with weird stuff and I don't understand why it thinks this.
I'll give you a hint: it doesn't think anything, it only does what you tell it to. One problem is that you're using multi-line strings, and Javascript doesn't support those. A string in Javascript ends at the end of the line.
Link to comment
Share on other sites

Why are most of the double-quotes escaped?
Because it is to write those parts in when called upon and if they are not escaped it thinks those quotes are not for writing but to stop writing and that messes it up.
Link to comment
Share on other sites

What exactly happens, what are the errors? I'll give you a hint: it doesn't think anything, it only does what you tell it to. One problem is that you're using multi-line strings, and Javascript doesn't support those. A string in Javascript ends at the end of the line.
So I just have to align it all into one line for each writing? Wait hold on I spotted something, I forgot to end some functions with }. I'm going to try these one at a time and see If I can fix it. Lemme see if it works.
Link to comment
Share on other sites

So I just have to align it all into one line for each writing? Wait hold on I spotted something, I forgot to end some functions with }. I'm going to try these one at a time and see If I can fix it. Lemme see if it works.
Ok so it did not work. Chrome highlights all of the parts in the script part where it says "area". It says "Uncaught Syntax Error: Unexpected Token ILLEGAL". and also on the buttons for activating, it says the functions don't exist
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...