Page 1 of 1

ajex/javascript bug ??

Posted: Mon Dec 27, 2010 9:57 pm
by ier
Hi today i put the souce code from ajex/javascript game but i god i problem i cant see the images from the people or from the tree
this is the link to the game
http://brandonc.comule.com/game/
you can login with halls as username and for password also halls i dint mod the came intel now

Re: ajex/javascript bug ??

Posted: Mon Dec 27, 2010 11:46 pm
by hallsofvallhalla
i am not seeing the javascript include file.

Re: ajex/javascript bug ??

Posted: Tue Dec 28, 2010 12:29 pm
by ier
?? but the game runs good on my localhost
end the netmap.js is included

Re: ajex/javascript bug ??

Posted: Tue Dec 28, 2010 12:37 pm
by kaos78414
No it's not. You need to include the script using a script tag like so:

Code: Select all

<script type="text/javascript" src="path/to/file.js"></script>

Re: ajex/javascript bug ??

Posted: Tue Dec 28, 2010 1:21 pm
by ier
somting like this

Code: Select all

<script type="text/javascript" src="netmap.js"></script>
its alrady in the script

Re: ajex/javascript bug ??

Posted: Wed Dec 29, 2010 10:56 am
by kaos78414
Well it's not showing up in the HTML, so it's not making the request to load that file...

This is the only script tag in the source:

Code: Select all

<script type="text/javascript" src="http://analytics.hosting24.com/count.php"></script>
Can you post your PHP here so I can better pinpoint the problem?

Re: ajex/javascript bug ??

Posted: Wed Dec 29, 2010 1:08 pm
by hallsofvallhalla
yep i don't see it either.

Re: ajex/javascript bug ??

Posted: Wed Dec 29, 2010 3:20 pm
by ier
this is the code

Code: Select all

<?php
include 'connect.php';
session_start();

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo $title ?></title>
</head>


  <link href="style.css" rel="stylesheet" type="text/css" />

<?php if (isset($_SESSION['player'])) 
  {
    $player=$_SESSION['player'];
    $playerinfo="SELECT * from players where name='$player'";
    $playerinfo2=mysql_query($playerinfo) or die("Could not get user stats");
    $playerinfo3=mysql_fetch_array($playerinfo2);
    
	$netinfo="SELECT tag from a1 where name = '$playerinfo3[name]'";
    $netinfo2=mysql_query($netinfo) or die("Could not get user stats");
	 $netinfo3=mysql_fetch_array($netinfo2);
	
	 }
	else
	{
	print "Sorry, not logged in  please <A href='index.php'>Login</a><br>";
 exit;}

 ?>
 <script language="javascript">
 function init()
 {
 setInterval("travel();", 2000);
 }
 </script>

<script type="text/javascript" src="netmap.js"></script>
 <div id="wrapper" align="center">
<table border="1">
<tr>
<td><div id="logo"><a href="http://brandonc.comule.com/game/main.php"><img src="images/logo.png" border="0"/></a></div></td>
<td><div id="buttons"><a href="http://brandonc.comule.com/game/logout.php"><img src="images/logout.png" border="0"/></a><img src="images/button.png" /><img src="images/button.png" /><br /><img src="images/button.png" /><img src="images/button.png" /><img src="images/button.png" /></div></td>
</tr>
</table>
<body onload="init()">




 <style type="text/css">

    .dynamicDiv {
	
	
    width:22px;
    height:22px;
    font-size:11px;
    font-family:verdana;
    color:#000;
	float:left;
	
     }
</style>
<table border="1">
<tr>

<td><div id="panelarea" align="center">
<?php include 'leftpanel.php'; ?>



</td>
</div>
<td >
<div id="maparea" >
 
  
 
 <script language="javascript">
 function init()
 {
 setInterval("travel();", 4000);
 }
 
 
var map = "<?php echo $playerinfo3['map'];?>";
var pid = "<?php echo $playerinfo3['name'];?>";
var playertag = "<?php echo $netinfo3['tag'];?>";
var wood = "<?php echo $playerinfo3['wood'];?>";
var lumbering = "<?php echo $playerinfo3['lumbering'];?>";
var actionwindow = new Array();
var awindowcount = 0;

 for (i=0;i<=659;i++)
{


var divTag = document.createElement("div");
       
        divTag.id = "div" + i;
       
        //divTag.style.margin = "0px auto";
		
       
        divTag.className ="dynamicDiv";
       
        //divTag.innerHTML = "HE";
       
        document.getElementById("maparea").appendChild(divTag);

}
  document.getElementById("maparea").style.backgroundImage = "url(images/grassback1.png)";
travel(map);




 </script>

</div>
  </div>
</td>






<td><div id="rpanelarea" align="center"><?php include 'rightpanel.php'; 
echo "<br><br>";
echo "<u><b>-Action Window-</u></b><br>";
echo "<div id='actiontextbox'></div>";



?>


</tr>
</table>
</div>


</body>
</html>
  
   

</div>
  
this is from 000webhost

Code: Select all

<script type="text/javascript" src="http://analytics.hosting24.com/count.php"></script>

Re: ajex/javascript bug ??

Posted: Wed Dec 29, 2010 4:48 pm
by hallsofvallhalla
make sure you uploaded the right file. It looks different than what you posted. At least browser the source does. Try to reupload.

Re: ajex/javascript bug ??

Posted: Thu Dec 30, 2010 1:19 pm
by ier
okz i re uploaded the files but still god the problem