ajex/javascript bug ??

Place for questions and answers for all newcomers and new coders. This is a free for all forum, no question is too stupid and to noob.
Post Reply
User avatar
ier
Posts: 67
Joined: Sun Jan 10, 2010 7:32 pm

ajex/javascript bug ??

Post 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
Last edited by ier on Tue Dec 28, 2010 1:22 pm, edited 1 time in total.
User avatar
hallsofvallhalla
Site Admin
Posts: 12023
Joined: Wed Apr 22, 2009 11:29 pm

Re: ajex/javascript bug ??

Post by hallsofvallhalla »

i am not seeing the javascript include file.
User avatar
ier
Posts: 67
Joined: Sun Jan 10, 2010 7:32 pm

Re: ajex/javascript bug ??

Post by ier »

?? but the game runs good on my localhost
end the netmap.js is included
User avatar
kaos78414
Posts: 507
Joined: Thu Jul 22, 2010 5:36 am

Re: ajex/javascript bug ??

Post 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>
w00t
User avatar
ier
Posts: 67
Joined: Sun Jan 10, 2010 7:32 pm

Re: ajex/javascript bug ??

Post by ier »

somting like this

Code: Select all

<script type="text/javascript" src="netmap.js"></script>
its alrady in the script
User avatar
kaos78414
Posts: 507
Joined: Thu Jul 22, 2010 5:36 am

Re: ajex/javascript bug ??

Post 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?
w00t
User avatar
hallsofvallhalla
Site Admin
Posts: 12023
Joined: Wed Apr 22, 2009 11:29 pm

Re: ajex/javascript bug ??

Post by hallsofvallhalla »

yep i don't see it either.
User avatar
ier
Posts: 67
Joined: Sun Jan 10, 2010 7:32 pm

Re: ajex/javascript bug ??

Post 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>
User avatar
hallsofvallhalla
Site Admin
Posts: 12023
Joined: Wed Apr 22, 2009 11:29 pm

Re: ajex/javascript bug ??

Post 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.
User avatar
ier
Posts: 67
Joined: Sun Jan 10, 2010 7:32 pm

Re: ajex/javascript bug ??

Post by ier »

okz i re uploaded the files but still god the problem
Post Reply

Return to “Beginner Help and Support”