I am trying to use a ajax and javascript code that i have for a site. 0n the Divisions area you are suppose to be able to click on the different divisions and the images below it will change to the proper division. I cant seem to get the javascript to work. What am I missing? This is what I have in my header
<script src="js/bbcode.js" language="jscript" type="text/javascript"></script>
<script src="ajax.php" type="text/javascript"></script>
<script type="text/javascript">
function getsquad(squadid, img){
ajax_request(squadid);
if(img == "cod4") {
document.getElementById(img).src = "images/icons/rostericon/cod4selected.jpg";
document.getElementById("css").src = "images/icons/rostericon/css.jpg";
document.getElementById("cod5").src = "images/icons/rostericon/cod5.jpg";
}
else if(img == "css") {
document.getElementById(img).src = "images/icons/rostericon/cssselected.jpg";
document.getElementById("cod4").src = "images/icons/rostericon/cod4.jpg";
document.getElementById("cod5").src = "images/icons/rostericon/cod5.jpg";
}
else if(img == "cod5") {
document.getElementById(img).src = "images/icons/rostericon/cod5selected.jpg";
document.getElementById("cod4").src = "images/icons/rostericon/cod4.jpg";
document.getElementById("css").src = "images/icons/rostericon/css.jpg";
}
}
function shownick(userid,nickname,firstname,lastname){
document.getElementById("overnick").innerHTML = ' <a href="index.php?site=profile&id='+userid+'" class="overnick">'+firstname+' \''+nickname+'\' '+lastname+'</a>';
}
</script>
<script type="text/javascript" src="tabcontent.js">
/***********************************************
* Tab Content script v2.0- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/
</script>
This is what php it points too
<?php
if(!ereg('index.php',$_SERVER['PHP_SELF'])){
include("_mysql.php");
include("_settings.php");
include("_functions.php");
}
if(isset($_GET['s'])) $squad = $_GET['s'];
else $squad = 1;
$squad--;
$get = safe_query("SELECT * FROM ".PREFIX."squads LIMIT $squad,7");
$data = mysql_fetch_assoc($get);
$get_member = safe_query("SELECT * FROM ".PREFIX."squads_members WHERE squadID = '".$data['squadID']."' LIMIT 0,4");
while($ds = mysql_fetch_array($get_member)){
$pics .="<td align='center'><img src='images/avatars/".getavatar($ds['userID'])."' onmouseover='javascript:shownick(\"".$ds['userID']."\",\"".getnickname($ds['userID'])."\",\"".getfirstname($ds['userID'])."\",\"".getlastname($ds['userID'])."\");' alt='".getnickname($ds['userID'])."' height='55'/></td>";
"</b></td>";
}
echo " <table cellpadding = '0' cellspacing = '5' style='margin:0px; padding:0px;'>
<tr>".$nicks."</tr>
<tr>".$pics."</tr>
</table>";
?>
Also one last thing. On the roster images part of it how do I add more lines to it. Right now its
image image image image
I would like it
image image image image
image image image image
image image image image
I am really a novise at code. just would like a little help. I have tried everything i could think of through trial and error. No luck.
Bookmarks