Hello,
I'm not sure wether this should be in here but i got i probleme with my loadscreen. I am writing it in php/css and javascript. I am good in php and css but I dont have any skills in Javascript. I wanted to make the mapname on the loadingscreen. It's all fine until the map is going to be added. Then the script just ignores my Styles and its written in the upper left corner. Everything becomes deleted and its just grey. Here is my script, I jope you can help me:
PHP [CODE]<!DOCTYPE html>
<html>
<head>
<title>Loading...</title>
<link rel="stylesheet" type="text/css" href="stylesheet.php">
<script type="text/JavaScript" language="JavaScript" src="loading.js"></script>
</head>
<body>
<div id="Status">
<script type ="text/JavaScript">
GameDetails();
</script>
</div>
</body>
</html> [/CODE]
CSS as PHP file [CODE]body{
width:100%;
height:100%;
margin:0;
}
#Status{
margin-top:25%;
margin-left:50%;
width:200px;
height:50px;
}[/CODE]
Javascript [CODE]function GameDetails( servername, serverurl, mapname, maxplayers, steamid, gamemode ){
document.write(mapname);
}
[/CODE]
But this is [b]HTML[/b], not PHP. Why would you even rename [b].css[/b] into [b].php[/b]?
Maybe I'm wrong but you problem is because of how you print your text.
I'd replace document.write(mapname); with some echo stuff (I'm not good at JS).
The problem here is, quoting Mozilla's[URL="https://developer.mozilla.org/en-US/docs/Web/API/document.write"] documents on document.write()[/URL],
[QUOTE]as document.write writes to the document stream, calling document.write on a closed (loaded) document automatically[B][I] calls document.open which will clear the document.[/I][/B][/QUOTE]
which is your problem.
If you want it to output the mapname to a specific div, you must[URL="https://developer.mozilla.org/en-US/docs/Web/API/document.getElementById"] 'grab it'[/URL] and then change[URL="https://developer.mozilla.org/en-US/docs/Web/API/Element.innerHTML"] its html[/URL], or whatever you want to do with it.
OK i will try^^
[editline]10th January 2015[/editline]
I did it. But there is still the same problem. Thats the direct link in the browser to this page:
[URL="http://www.fastdl365.gshost.de/Loading/index.php"]http://www.fastdl365.gshost.de/Loading/index.php[/URL]
and here is the GMOD TTT ip so u can se how it looks like in loading screen:
5.231.196.102:27015
if u dont know how to connect, just type "connect 5.231.196.102:27015" in the console
Sorry, you need to Log In to post a reply to this thread.