JavaScript - Issue In Displaying Nan Values
Hi..
I created a function and I encountered problem because I got a NaN values. And I want to resolve it..I don't want to display NaN values. instead of NaN I just want it blank. here is my code: Code: function doz(oText){ var P27_max = document.getElementById("P27_max").value; var P27_max_convert = parseFloat(P27_max) + parseFloat(1); var P27_maxdoz = document.getElementById("P27_maxdoz").value = P27_max_convert; var P28_max = document.getElementById("P28_max").value; var P28_max_convert = parseFloat(P28_max) + parseFloat(2); var P28_maxdoz = document.getElementById("P28_maxdoz").value = P28_max_convert; } when I entered data in P27_max so the P27_maxdoz was computed but the problem is the P28_max has also value 'NaN'. How can I eliminate or did not display NaN Thank you Similar TutorialsHi all, Decided to start learning JavaScript, started 2 days ago. Anyway, I'm trying to create a simple script spits out a styled result based on a user input. Here is my JS: Code: function dispTable (form) { var userCost2 = form.venCost2.value * 1; marArray = new Array ("0.05", "0.1", ".15", "0.2", "0.25", "0.3", "0.35", "0.4", "0.45", "0.5", "0.55", "0.6", "0.65", "0.7", "0.75", "0.8"); for (var i=0; i<marArray.length; i++) { document.tableDiv.innerHTML = "<div>" document.tableDiv.innerHTML = userCost2; document.tableDiv.innerHTML = marArray[i]; document.tableDiv.innerHTML = + userCost2 * marArray[i]; document.tableDiv.innerHTML = "<\/div>"; } } Here is my HTML: Code: <div class="container"> <form name="lasoCalcTable"> <span>Enter Vendor Cost</span> <input class="textForm" name="venCost2" id="venCost2" type="text" size="8" /> <hr /> <input class="butForm" name="calcTblBut" type="button" value="Calculate" onclick="dispTable()" /><br /> </form> <div title="tableDiv" id="tableDiv"> </div> </div> The problem is that nothing is happening when I press the calculation button. What I would like to happen is to display a div element for each value in the array which displays the entered value from VenCost2, the current Margin %, and the result of VenCost2 * margin%. I want this to display on the same page and underneath the calculation button, preferably not having to reload the page. I thought this was going to be relatively easy but doesn't seem so! Thanks for your help My code is working pretty well, except I have an issue validating. I think it may be to do with when there is an empty string. I know that NaN is Not a Number, but the only issue I can find with my code is when I input a non-digit such as "k" for example. And because I have put some code in to reload the page when it does not validate, when it refreshes it has 2 popup boxes. Thanks for taking the time to read my post Code: <html> <head> <title>Sound Travel Calculator</title> <script type="text/javascript"> // Setting our variables based on user input var hours = 0; var mins = 0; var m_per_secs = 340; alert("Speed of Sound \n\nAt Sea Level Sound Travels At 340 Metres Per Second \n\nIf You Would Like To Know How Far Sound Will Travel In A Given Time, Click OK"); hours = prompt("Please Enter Hours (If less than 1 hour, just type 0)"); mins = prompt("Please Enter Minutes"); // Validating input for a number less than zero or an not a number if ((isNaN(hours)) || (hours < 0) || (isNaN(mins)) || (mins < 0)) { alert("Please enter a numeric value, zero or greater"); window.location.reload(true); } // if there is no input, the value is set to zero if (hours =="") { hours = 0; } if (mins =="") { mins = 0; } // Calculations dist = (((parseFloat(hours)) * 60 * 60) + (parseFloat(mins * 60)) * parseFloat(m_per_secs) / 1000) // Output our calculation alert("The Distance of Sound Travelled is " + (dist) + " Kilometres"); </script> </head> <body> </body> </html> Box 1 - Box 2 / Box 3 and i put a round off number so the decimals dont give a million numbers the problem is...the math is wrong now.... someone please help me fix this.. <!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> <title>Calc</title> <script type="text/javascript"> function calculate() { var one = document.getElementById("one").value*1; var two = document.getElementById("two").value*1; var three = document.getElementById("three").value*1; document.getElementById("answer").value=((one-two)/three); ; } </script> </head> <body> Enter Number 1 <br> <br><input type="text" id="one" /><hr>Enter Number 2<br><br><input type="text" id="two" /><br><br><hr>Enter Average number<br><br><input type="text" id="three" /><br><br><button onclick="calculate();">Calculate</button> <br id="result"></center></br> Total <input type="text" readonly="readonly" id="answer" /><br><br></center> </body> </html> </td> </tr> </table> </center> </body> </html> Ahoy, Lemme try to explain this as best as I can. Bullet points might help: When someone clicks on an image here (http://gta.kwivia.co.uk/gta-iv/), the rest of the images collapse and become invisible Below the image, some links appear Also, there will be a "show other images" button which will then show the rest of the images http://gta.kwivia.co.uk/gta-iv/ I will appreciate all solutions to this problem. If you need to know anything, simply ask me. Hi gud mng, I have one problem... How to process textbox values/ call textbox values in JS through a Java program. My text box values are dates. I have to process these dates. Like in online banking we select day to know our transactions. After submitting we get results. remember my files are in my directory only. No need of database. My files are look like 20100929, 20100930, 20101001 For epoch_classes.js, epoch_styles.css u can download coding from this link : http://www.javascriptkit.com/script/...ch/index.shtml Code: Code: <html> <table width="900" border="0" cellpadding="10" cellspacing="10" style="padding:0"> <tr><td id="leftcolumn" width="170" align="left" valign="top"> <div style="margin-left:0px;margin-top:0px"><h3 class="left"><span class="left_h2">Select Option</span></h3> <a rel="nofollow" target="_top" href="day_wise.htm" >Day-wise</a><br /> <br /> <a rel="nofollow" target="_top" href="between.htm" >Between Days</a> <link rel="stylesheet" type="text/css" href="epoch_styles.css" /> <script type="text/javascript" src="epoch_classes.js"></script> <script type="text/javascript"> var cal1, cal2; window.onload = function () { cal1= new Epoch('epoch_popup','popup',document.getElementById('popup_container1')); cal2= new Epoch('epoch_popup','popup',document.getElementById('popup_container2')); }; /*............*/ function confirmation(f) { var startdate = f.fromdate.value var enddate = f.todate.value var myday=new Date() var yr=myday.getFullYear() var mn=myday.getMonth()+1 var dt=myday.getDate() var today="" var present, ys, ms, ds, ye,me,de, start, end if(mn < 10) { mn = "0" + mn } if(dt <10) { dt = "0" + dt } today= yr + "/" + mn + "/" + dt present=yr + "/" + mn + "/" +dt if (today < startdate ) { alert (" Start date should not be exceed to-day's date " + present ) startdate.focus() return false } if (today < enddate ) { alert (" End date should not be exceed to-day's date " + present ) enddate.focus() return false } if (today == startdate ) { alert(" You are selected to-days date as Starting day" ); } var answer = confirm("Do you want to continue ?") if (answer) { if( startdate < enddate) alert("Dates between " + startdate + " to " + enddate + " are confirmed" ) else alert("Dates between " + enddate + " to " + startdate + " are confirmed" ) } else { alert("Date not confirmed") window.location="to_date.htm"; } ys= startdate.substring(0,4); ms= startdate.substring(5,7); ds= startdate.substring(8,10); start=ys + "" + ms + "" +ds ye= enddate.substring(0,4); me= enddate.substring(5,7); de= enddate.substring(8,10); end=ye + "" + me + "" +de } /*.......................................................*/ </script> <div style="margin-left:100px;"> <body> <style type="text/css"> #conf { margin-left:115px; } </style> <td align="left" valign="top"> <table width="100" border="0" cellpadding="0" cellspacing="0"> <td style="padding-top:0px"> </table> <h4>From Date</h4> <form name= "formbet" id="placeholder" method="post" action="#" > <input id="popup_container1" type="text" name= "fromdate" maxlength="10" size="20"/> <td align="left" valign="top"> <table width="300" border="0" cellpadding="0" cellspacing="0"> <td style="padding-top:20px"> <h4>To Date</h4> <input id="popup_container2" type="text" name= "todate" maxlength="10" size="20"/> <br /> <br /> <input id="conf" type="button" onclick="confirmation(this.form)" value="Submit"> </form> </body> </html> In my coding, ys, ms, ds represents year starting, month starting, starting day... ye, me, de represents end... start,end gives file names in the format of yyyymmdd now i want to process files from 20100101 to 20100930 means from date is 2010/01/01 and to date is 2010/09/30 if i press submit button the files from 20100101 to 20100930 are processes here ys=2010 ms=01 ds =01 and ye=2010 me=09 de= 30 For this how do i call these textbox values (from date text box and todate) to another program (java) Thanks in advance. I have a bunch of checkboxes like below that the user can check some or all and click the button and see the values of all the selected checkboxes. How can I do that? Code: <script> function alertValues(){ } </script> <input type="checkbox" class ="normal2" value="131971" name="list[]" > <input type="checkbox" class ="normal2" value="131973" name="list[]" > <input type="checkbox" class ="normal2" value="131975" name="list[]" > <input type="checkbox" class ="normal2" value="131977" name="list[]" > <input type="button" onClick="alertValues()" Hi, What's a good way/ideal data structure to achieve this? The objective of the code/function is to map user-inputted strings into a pair of specific, hard-coded strings. For example, say the user types "firefox" or "ff", or "fx". The output would be the pair ["browser", "mozilla"], for example. I'm currently using a multidimensional array, but it feels inefficient and I'm having trouble mapping an arbitrary number of inputs into 2 outputs. Code: var strings = [ ["input1", "output1a"], ["input2", "output1a"], ["input3", "output1a"], ["input1", "output1b"], ["input2", "output1b"], ["input3", "output1b"] ]; How should I map the elements ["input1", "input2", "input3"] => ["output1a", "output1b"] ? Another method I used previously was a massive switch statement. This fulfills my needs, but I'm not sure about the efficiency (though if I remember correctly, switch statements become more efficient as size grows, since it uses a hash table?). Code: switch (input) { case "ff": case "firefox": case "fx" : case "ffox": return ["browser", "mozilla"]; case "ie": case "internet explorer": return ["browser", "microsoft"]; ... } Hello, for some reason this code isnt showing anything: Code: <span id = "message" style="color:black; font-size:12pt; font-family:arial,verdana,sans-serif"></span> <script type = "text/javascript"> var targetURL="#"; var countdownfrom = 10; var currentsecond = countdownfrom +1; function countredirect() { if (currentsecond !=1 ){ currentsecond -=1; var mess = "You will be redirected to Points2shop in " + currentsecond + " seconds."; document.getElementById("message").innerHTML = mess; } else{ window.location=targetURL; } setTimeout("countredirect()",1000); } countredirect(); </script> ive tried: Code: <form name="message"> <span id = "message" style="color:black; font-size:12pt; font-family:arial,verdana,sans-serif"></span> </form> <script type = "text/javascript"> var targetURL="#"; var countdownfrom = 10; var currentsecond = countdownfrom +1; function countredirect() { if (currentsecond !=1 ){ currentsecond -=1; var mess = "You will be redirected to Points2shop in " + currentsecond + " seconds."; document.getElementById("message").innerHTML = mess; } else{ window.location=targetURL; } setTimeout("countredirect()",1000); } countredirect(); </script> Anyone know why? Thanks Hi, I am trying to display some xml elements that are formatted like this: Code: <line> <route> <dirs>1. Head west on Calzada Roosevelt</dirs> <time>4.6 km - about 15 mins</time> <dirs>2. Continue on Carretera Interamericana/Pan American Hwy</dirs> <time>15 km - about 12 mins</time> <dirs>3. Look for turnoff at San Lucas and follow signs from there</dirs> <time>13.5 km - about 15 mins</time> </route> </line> using this js: Code: for (var a = 0; a < lines.length; a++) { routeInfo = lines[a].getElementsByTagName("route"); for (var p = 0; p < routeInfo.length; p++) { var time = GXml.value(routeInfo[p].getElementsByTagName("time")[0]); var dirs = GXml.value(routeInfo[p].getElementsByTagName("dirs")[0]); way+='<b>'+dirs+'</b>'+'<br>'+time+'<br>'; ("way" eventually gets passed as the text to display) Which works OK (as you can see here if you select from Guatemala City to Antigua), but the problem is that it only shows the first set of directions, ie Code: <dirs>1. Head west on Calzada Roosevelt</dirs> <time>4.6 km - about 15 mins</time> I can see that this is because of the [0] in the getElementsByTagName - if I change it to 1 or 2 it shows the 2nd or 3rd set of directions. But I want it to show all of them... and I thought that being in a loop it would, but I'm obviously missing something. Any ideas? Thanks in advance. I'm not sure if java is the best way to go with this, I'm pretty inexperienced with java, but I have a workable knowledge of html, and couldn't see a way to do it that way... so here goes: For my job I work with a ton of different deadlines all the time. What I want to do is to make a webpage that displays the date N days ago, and N days into the future. So something like 7 days ago, 30 days ago, 60 days ago 75 days ago, 30 days from now, 60 days from now, 75 days from now. etc. I've found brief snippets for how to display today's date, but i'm having trouble with the calculations. Then I also need one that displays 18 years ago, I'm not sure if the change from days to years makes any kind of difference, but I suppose it's easy enough to convert years to days anyway.... How would I go about doing that? Thank you!!! I am having a problem with my homework displaying an iframe using JavaScript. My homework states: Insert a script element that does the following: part a. Insert the following multiline comment: Display the daily schedule in an inline frame. Daily schedules are stored in the files sunday.html through saturday.htm. part b. Insert a command to write the HTML code <iframe src="weekday.htm'></iframe> to the Web page, where weekday is the text string returned by the weekDay() function. What I have so far: <script type= "text/javascript"> /* Display part a */ document.write("<iframe src='weekday.htm'></iframe">; </script> My Question: How do I display weekday.htm within my script on a specific day using the function weekDay() function. below is my weekDay() function: function weekDay(){ thisDate = new Date(); var thisWDay=thisDate.getDay(); var wdName = new Array("sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday"); return wdName[thisWDay]; } I wrote a function (shown below) that is to take numbers from <div> tags add them up and display the value in a different <div> tag. It also prints the total in a hidden input tag to be sent when submitted. All was working fine until today I noticed that the total was no longer showing up in either the <div> tag or the hidden input tag. on change of any of the select menus correctly displays the expected value in its corresponding <div> tag I have no Idea what might be causing this, so I need fresh eyes. (My JavaScript skills are way below my php skills, I can't see anything wrong with what I have) PHP Code: // I am using a php function that spits out these // (one for each item listed in the JS function: <select name="body" onchange="document.getElementById('total_body').innerHTML = this.options[this.selectedIndex].getAttribute('cost_body');calcTotal();" id="frm"> <option value="2" cost_body="0">2</option> <option value="3" cost_body="10">3</option> <option value="4" cost_body="20">4</option> <option value="5" cost_body="30">5</option> <option value="6" cost_body="40">6</option> <option value="7" cost_body="65">7</option> </select> //Which displays in: <div id="total_body">0</div> //AND Calls this JavaScript Function: <script type="text/javascript"> function calcTotal(){ var numVal1=parseInt(document.getElementById("total_body").innerHTML); var numVal2=parseInt(document.getElementById("total_agility").innerHTML); var numVal3=parseInt(document.getElementById("total_reaction").innerHTML); var numVal4=parseInt(document.getElementById("total_strength").innerHTML); var numVal5=parseInt(document.getElementById("total_charisma").innerHTML); var numVal6=parseInt(document.getElementById("total_intuition").innerHTML); var numVal7=parseInt(document.getElementById("total_logic").innerHTML); var numVal8=parseInt(document.getElementById("total_willpower").innerHTML); var numVal9=parseInt(document.getElementById("total_edge").innerHTML); var numVal10=parseInt(document.getElementById("total_magic").innerHTML); var totalValue = numVal1 + numVal2 + numVal3 + numVal4 + numVal5 + numVal6 + numVal7 + numVal8 + numVal9 + numVal10; document.getElementById("grand_total").innerHTML = totalValue; document.getElementById("point_total").value = totalValue; } </script> //Which until today had been displaying in: <div align="center" id="grand_total">0</div> //AND <input type="hidden" name="point_total" value="" id="point_total"> Here is a page that shows what it is (not) doing. http://rpg.5150press.com/test.php I can't seem to get my innerHTML to display my content. This works fine, if I was to put it all in one line. Code: document.getElementById('addedText').innerHTML = '<table><tr><td>'+"My text goes here"+'</tr></td></table>'; If I was to break it up, which I wanted then nothing seem to show up. Code: document.getElementById('addedText').innerHTML = '<table><tr><td>'; document.getElementById('addedText').innerHTML = "My text goes here"; document.getElementById('addedText').innerHTML = '</tr></td></table>'; Here's my code Code: <html> <head> <script type="text/javascript"> function display() { document.getElementById('addedText').innerHTML = '<table border=1><tr><td>'; document.getElementById('addedText').innerHTML = "My text goes here"; document.getElementById('addedText').innerHTML = '</tr></td></table>'; } </script> </head> <body onload="display()"> <div id="addedText"></div> </body> </html> thanks Hello all, I'm trying to create a sub menu that displays based on what the user clicks on the main nav. Here's an image of what I'm trying to accomplish. The main nav is at the top right corner, when the click on one of the links, I want the sub nav to display in the gray area....how would I do this. Would it be through an if/else statement using document.getElementById with inner HTML? Or would there be a better way. I'm really trying to do this by myself, so please don't do it for me...just give me a couple of suggestions if you don't mind. THanks Hello all, I need your help. I know what I'm trying to do, just having a difficult time getting started. I want to display the user-name of an individual when they login. I know how this can be doing using php, but what about javascript? Ex: username: __________ password: __________ After Login: Welcome ['username'] I hope that makes sense. Thanks in advance I thought I knew how, but I'm unclear how to get this function to display: "document.getElementById("txtHint").innerHTML=xmlhttp.responseText;" inside the div. Will you show me please? Code: xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { var div = document.createElement('div'); div.setAttribute('id', 'txtHint'); div.setAttribute("style","background-color:red;"); div.style.width = '300px'; div.style.height = '100px'; document.getElementById("txtHint").innerHTML=xmlhttp.responseText; //var txt='hello world!'; document.getElementsByTagName('body')[0].appendChild(div); document.getElementById('textHint').innerHTML=txt; } } Hi, I've got this bit if JavaScript that loads a Flash applet. It also has a noscript tag in case the user has JavaScript turned off. Works great in all browsers I've tried, but it doesn't work at all in IE8 (nor IE7 emulated). Even the noscript content isn't showing up. W3C validator shows no issues. No little exclamation point warning in IE's bottom-left corner. I've even tried lowering the browser security with no change -- but that wouldn't have been a good solution if it had worked anyway; I can't tell my visitors to lower their browser security. Any ideas of suggestions? Thanks for any help! You can see the page he http://www.girlscoutsmoheartland.org/test/vcattest.html If you look at the source, that's all there is to it. No undisplayed server-side scripting. And here's the code if you don't want to visit the page: Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Untitled Document</title> <script type="text/javascript" src="http://www.myvirtualpaper.com/js/miniflipper.js"></script> </head> <body> Below this line should be either a Flash applet, or a link if JavaScript is unavailable:<br> <noscript><a href="http://www.myvirtualpaper.com/doc/gs_missouri_heartland/girlscout2010catalog/">Click here to view all pages.</a></noscript> <script type="text/javascript"> var miniFlipperOptions = {'uid' : 'bfbe7aa59d'}; MVP_printMiniflipper(miniFlipperOptions); </script> <br> Above this line should be the mentioned item option. </body> </html> I am creating a script to display some variable but it won't work. Did I do something wrong? Code: <script type="text/javascript"> /* <![CDATA[ */ var yotta = le24; var zetta = le21; document.write("<table border='1' width='100%'><tr><th>Prefix</th><th>Decimal Equivalent</th></tr>"); document.write("<tr><td>Yotta</td><td>" + yotta + "</td></tr>"); document.write("<tr><td>Zetta</td><td>" + zetta + "</td></tr>"); document.write("</table>"); /* ]]> */ </script> Everything looks right, I think. Anyone see something wrong? Thank you, I am a firefighter of 25 years. Problem/Error: JavaScript/AJAX not returning values correctly... The JavaScript/AJAX is printing "null" into the chat_div where the tag name is "user". But in those tags there is actually data, this data is a link. I am thinking that it may be returning the first childNode which would be the <a>? I don't fully understand nodes, but I have had a quick read about them. PHP: PHP Code: <?php //Headers header("Expires: Mon, 01 Dec 1990 05:00:00 GMT" ); header("Last-Modified: " . gmdate( "D, d M Y H:i:s" ) . "GMT" ); header("Cache-Control: no-cache, must-revalidate" ); header("Pragma: no-cache" ); header("Content-Type: text/xml; charset=utf-8"); require("connect.php"); mysql_select_db($dbname, $con); //Variables $ses = explode(".", $_SESSION['user']); //User ID of user currently logged in $sid = $ses[2]; //Number of last message which was displayed, if does not exist or has no value then //last message will be 0. $last_mess = (isset($_GET['m']) && $_GET['m'] != "") ? $_GET['m'] : 0; $last_mess = mysql_real_escape_string($last_mess); $chat = mysql_real_escape_string($_GET['chat']); //Counter for counter number of errors $i = 1; //Send message if (isset($_POST['message']) && $_POST['message'] != "") { //Variables $chat = mysql_real_escape_string($_GET['chat']); $message = mysql_real_escape_string($_GET['message']); $query = "INSERT INTO message (chat_id, user_uid, recipient_uid, message, post_time) VALUES (". $chat.", ".$sid.", ".$rid.", ".$message.", NOW())"; mysql_query($query); } //Get current chat if (isset($_GET['chat'])) { $xml = '<?xml version="1.0" ?><root>'; $query = "SELECT * FROM message WHERE chat_id = ".$chat." AND msg_id > ".$last_mess; $result = mysql_query($query); while ($row=mysql_fetch_array($result)) { //Get name of sender $get_name_query = "SELECT * FROM users WHERE uid = '".$row['user_uid']."' OR uid = '".$row['recipient_uid']."'"; $get_name = mysql_query($get_name_query); if (!$get_name) { //If there is no result display error echo "Error $i: Error getting usernames! <br /> Query: $get_name_query <br />MySQL Error: ".mysql_error(). "<br /><br />"; $i++; } //While result is being got get first name and upper case first letter. while ($row2=mysql_fetch_array($get_name)) { $name = explode(".",$row2['full_name']); $first_name = $name[0]; $userid = $row2['uid']; $sent_by = "<a href=\"../profile.php?user=".$userid."\">".ucfirst($first_name)."</a>"; } //Write message contents $xml .= '<message id="' . $row['msg_id'] . '">'; $xml .= '<user>' . $sent_by . '</user>'; $xml .= '<text>' . $row['message'] . '</text>'; $xml .= '<time>' . $row['post_time'] . '</time>'; $xml .= '</message>'; } $xml .= '</root>'; echo $xml; } ?> JavaScript/AJAX: Code: function getMessage() { if (receiveReq.readyState == 4 || receiveReq.readyState == 0) { var url = "scripts/get_data.php?uid=<?=$uid?>&m=" + lastMess + "&chat=1"; receiveReq.open("GET", url, true); receiveReq.onreadystatechange = manageMessage; receiveReq.send( null ); lastMess++; } } function manageMessage() { if( receiveReq.readyState == 4 ) { // request complete var chat_div = document.getElementById( 'chat' ); var xmldoc = receiveReq.responseXML; var msg_nodes = xmldoc.getElementsByTagName( 'message' ); var n_msg = msg_nodes.length; for( i = 0; i < n_msg; i++ ) { var user_node = msg_nodes[ i ].getElementsByTagName( 'user' ); var time_node = msg_nodes[ i ].getElementsByTagName( 'time' ); var text_node = msg_nodes[ i ].getElementsByTagName( 'text' ); //Display message chat_div.innerHTML += user_node[ 0 ].firstChild.nodeValue + "<br />"; chat_div.innerHTML += time_node[ 0 ].firstChild.nodeValue + "<br />"; chat_div.innerHTML += text_node[ 0 ].firstChild.nodeValue + "<br /><br />"; } } } More info: The PHP is displaying the data properly, like so: XML: Code: <root> <message id="1"> <user> <a href="../profile.php?user=4">Nicholas</a> </user> <text>testing stupid chat thing</text> <time>0000-00-00 00:00:00</time> </message> <message id="2"> <user> <a href="../profile.php?user=4">Nicholas</a> </user> <text>dsadasfsdfsggsdgrgsdgfd</text> <time>2010-04-22 19:17:16</time> </message> <message id="3"> <user> <a href="../profile.php?user=4">Nicholas</a> </user> <text>gfgdgsegegsgfawdfwdfasfa</text> <time>2010-04-14 17:28:07</time> </message> </root> What is being displayed on the page: Code: null 0000-00-00 00:00:00 testing stupid chat thing null 2010-04-22 19:17:16 dsadasfsdfsggsdgrgsdgfd null 2010-04-14 17:28:07 gfgdgsegegsgfawdfwdfasfa I would like this image gallery to sit behind everything else. right now white shows through on either side. Any help would be greatly appreciated. Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta name="Generator" content="Get Hosting With Joe (13.0.1.020)"> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"> <title>Home</title> <script type="text/javascript" src="wpscripts/jquery.js"></script> <script type="text/javascript" src="wpscripts/jquery.timers.js"></script> <script type="text/javascript" src="wpscripts/jquery.wpgallery.js"></script> <script type="text/javascript"> var nImgNum_pg_2 = 0; wp_imgArray_pg_2 = new Array(); wp_imgArray_pg_2[nImgNum_pg_2++] = new wp_galleryimage("wpimages/6ec6f779d991.jpg", 844, 369, "wpimages/6ec6f779d991t.jpg", ""); wp_imgArray_pg_2[nImgNum_pg_2++] = new wp_galleryimage("wpimages/8dcdb90c2d41.jpg", 844, 370, "wpimages/8dcdb90c2d41t.jpg", ""); </script> <style type="text/css"> body {margin: 0px; padding: 0px;} </style> <script type="text/javascript" src="wpscripts/jspngfix.js"></script> <script type="text/javascript"> var blankSrc = "wpscripts/blank.gif"; </script> <script type="text/javascript"> $(document).ready(function() { $('#wp_gallery_pg_2').wpgallery({ imageArray: wp_imgArray_pg_2, nTotalImages: nImgNum_pg_2, nGalleryLeft: 77, nGalleryTop: -183, nGalleryWidth: 844, nGalleryHeight: 842, nImageDivLeft: 0, nImageDivTop: 0, nImageDivWidth: 844, nImageDivHeight: 842, nControlBarStyle: 0, nControlBarExternalTop: 10, bNavBarOnTop: false, bShowNavBar: false, nNavBarAlignment: 0, strNavBarColour: 'none', nNavBarOpacity: 1.0, nNavBarIconWidth: 24, nNavBarIconHeight: 24, bShowCaption: false, bCaptionCount: true, strCaptionColour: '#ffffff', nCaptionOpacity: 0.6, strCaptionTextColour: '#000000', nCaptionFontSize: 12, strCaptionFontType: 'Courier New,Arial,_sans', strCaptionAlign: 'center', strCaptionFontWeight: 'normal', bShowThumbnails: false, nThumbStyle: 1, nThumbPosition: 0, nThumbLeft: 30, nThumbTop: 732, nThumbOpacity: 0.5, nTotalThumbs: 2, nThumbSize: 40, nThumbSpacing: 10, bThumbBorder: false, strThumbBorderColour: '#000000', strThumbBorderHoverColour: '#ffffff', strThumbBorderActiveColour: '#ffffff', bShowThumbnailArrows: false, nThumbButtonSize: 24, nThumbButtonIndent: 50, nColBorderWidth: 2, nTransitionStyle: 1, nStaticTime: 3044, nTransitTime: 1015, bAutoplay: true, loadingButtonSize: 38, bPageCentred: true, nPageWidth: 1000, nZIndex: 100, loadingButtonSrc: 'wpimages/wpgallery_loading_1.gif', blankSrc: 'wpscripts/blank.gif', rewindButtonSrc: 'wpimages/wpgallery_rewind_0.png', prevButtonSrc: 'wpimages/wpgallery_previous_0.png', playButtonSrc: 'wpimages/wpgallery_play_0.png', pauseButtonSrc: 'wpimages/wpgallery_pause_0.png', nextButtonSrc: 'wpimages/wpgallery_next_0.png', forwardButtonSrc: 'wpimages/wpgallery_forward_0.png', thumbRewindButtonSrc: 'wpimages/wpgallery_rewind_0.png', thumbForwardButtonSrc: 'wpimages/wpgallery_forward_0.png', rewindoverButtonSrc: 'wpimages/wpgallery_rewind_over_0.png', prevoverButtonSrc: 'wpimages/wpgallery_previous_over_0.png', playoverButtonSrc: 'wpimages/wpgallery_play_over_0.png', pauseoverButtonSrc: 'wpimages/wpgallery_pause_over_0.png', nextoverButtonSrc: 'wpimages/wpgallery_next_over_0.png', forwardoverButtonSrc: 'wpimages/wpgallery_forward_over_0.png', thumboverRewindButtonSrc: 'wpimages/wpgallery_rewind_over_0.png', thumboverForwardButtonSrc: 'wpimages/wpgallery_forward_over_0.png', strRewindToolTip: 'Reverse', strPreviousToolTip: 'Previous', strPlayToolTip: 'Play', strPauseToolTip: 'Pause', strNextToolTip: 'Next', strForwardToolTip: 'Forward', strThumbRewindToolTip: 'Reverse', strThumbForwardToolTip: 'Forward' }); }) </script> </head> <body text="#000000" style="background-color:#ffffff; text-align:center; height:1200px;"> <div style="background-color:transparent;text-align:left;margin-left:auto;margin-right:auto;position:relative;width:1000px;height:1200px;"> <div id="wp_gallery_pg_2" style="position:absolute; left:77px; top:-183px; width:844px; height:842px; overflow:hidden;"></div> <img src="wpimages/wp7d3e6c5d_06.png" width="997" height="1197" border="0" alt="" onload="OnLoadPngFix()" style="position:absolute;left:0px;top:3px;"> </div> </body> </html> |