JavaScript - Create Table In Javascript And Populate Its Td To Reach Certain Height
I want to create a table in javascript with a predefined height and width and put html code in its td.
I wanna know when i should stop writing html code when my table have reached the predefined height. Is there any way to do that? I started by doing this : var srcTable = document.createElement("table"); srcTable.border = 1; srcTable.borderColor = "Black"; srcTable.height = 768; srcTable.width = 1024; var tmpRow = null; var tmpCell = null; for (i = 0; i < rowCount; i++) { tmpRow = AppendRow(srcTable) for (j = 0; j < colCount; j++) { tmpCell = AppendCell(tmpRow); tmpCell.innerHTML = document.getElementById("div").innerHTML; tmpCell = null; } tmpRow = null; } The html code in "div" element is way big then 768 px. I wanna know how to loop over and break it when table reaches 768 px height. Similar TutorialsHi, I'm new to Javascript and need to help with something, I'll try and explain this as best as I can but feel free to ask questions if it doesn't make sense. I'm basically building a javascript/html calculator but I need the calculation to appear gradually in a table, the table need to be 3 columns accross and add a row each time a calculation button is pressed, the first column can remain blank for now but will need to contain a text field eventually, second column needs to show the calculation symbol, third column shows the number. Here's an example: 4+2+7-5=8 |Blank| | 4 | |Blank| + | 2 | |Blank| + | 7 | |Blank| - | 5 | |Blank| = | 8 | Here's the code I have so far so you can get a feeling of what it looks like, this table need to go into the area div and will replace what is currently the Code: <!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>Sample Widget</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <link href="basic.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="basic.js"></script> <meta name="generator" content="Nokia WRT extension for Visual Studio 2.0" /> <script type="text/javascript" language="javascript"> function UpdateInput(a, b) { var MyElement = document.getElementById("Input"); MyElement.innerHTML = MyElement.innerHTML + a; var MyElement = document.getElementById("Area"); MyElement.innerHTML = MyElement.innerHTML + b; } function Calculate() { var result = eval(document.getElementById("Input").innerHTML); var total = document.getElementById("Total"); total.innerHTML = result; var MyElement = document.getElementById("Area"); MyElement.innerHTML = MyElement.innerHTML + '<br>=' + result; } </script> </head> <body onLoad="init()"> <div id="Main"> <table cellpadding="0" cellspacing="0" width="100%"> <div id="Area"> </div> </table> <table cellpadding="0" cellspacing="0" width="100%"> <tr> <td class="style1">Total:</td> <td> <div id="Total"></div> </td> </tr> <tr> <td colspan="2"> <div id="Input"></div> </td> </tr> </table> <table cellpadding="0" cellspacing="0"> <tr> <td><img src="Images/plus.png" onclick="UpdateInput('+','<br>+')" /></td> <td><img src="Images/minus.png" onclick="UpdateInput('-','<br>-')" /></td> <td><img src="Images/times.png" onclick="UpdateInput('*','<br>*')" /></td> <td><img src="Images/divide.png" onclick="UpdateInput('/','<br>/')" /></td> </tr> <tr> <td><img src="Images/7.png" onclick="UpdateInput(7,7)" /></td> <td><img src="Images/8.png" onclick="UpdateInput(8,8)" /></td> <td><img src="Images/9.png" onclick="UpdateInput(9,9)" /></td> <td><img src="Images/percent.png" onclick="UpdateInput('%','<br>%')" /></td> </tr> <tr> <td><img src="Images/4.png" onclick="UpdateInput(4,4)" /></td> <td><img src="Images/5.png" onclick="UpdateInput(5,5)" /></td> <td><img src="Images/6.png" onclick="UpdateInput(6,6)" /></td> <td><img src="Images/oneoverx.png" /></td> </tr> <tr> <td><img src="Images/1.png" onclick="UpdateInput(1,1)" /></td> <td><img src="Images/2.png" onclick="UpdateInput(2,2)" /></td> <td><img src="Images/3.png" onclick="UpdateInput(3,3)" /></td> <td><img src="Images/plusminus.png" /></td> </tr> <tr> <td><img src="Images/0.png" onclick="UpdateInput(0,0)" /></td> <td><img src="Images/dot.png" onclick="UpdateInput('.','.')" /></td> <td><img src="Images/equals.png" onclick="Calculate()" /></td> <td><img src="Images/sub.png" /></td> </tr> </table> </div> </body> </html> please help me~~Hi I have to create a table using javascript. Firefox displays the expected result but for IE, the column width is screwed >"< I have to use the col tag to set width because sometimes the first row maybe merged. All I need is to create a table that strictly displays according to the inputted column widths from my program. In below I have setup very short example that construct table in a similar way to my original javascript function. I also draw a ruler to help showing the proper width of 400px on the screen. column 1 should be 100px width and column 2 should be 300px. Please help me~~T_T Code: <?xml version='1.0' encoding='UTF-8'?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <body onload="init()"> Hard Coded: <DIV style="WIDTH: 400px; HEIGHT: 25px;overflow:hidden;"> <TABLE style="border:none; BORDER-SPACING: 0px; WIDTH: 400px; TABLE-LAYOUT: fixed" cellSpacing="0" cellpadding="0"> <col width="100px"> <col width="300px"> <TBODY> <TR> <TD style="background-color:blue"> a </TD> <TD style="background-color:green"> b </TD> </TR> </TBODY> </TABLE> </DIV> Ruler: <div id='ruler' style="background-color:yellow;width:400px;height:28px;"></div> Javascript inserted: <div id="hi"> </div> </body> <script language="javascript"> function init() { var w = [100, 300] // test table create var testDiv, testTBody, testTable, testTr, testTd, testCol; document.getElementById("hi").appendChild(testDiv = document.createElement("div")); with (testDiv.style) { width="400px"; height="25px"; } testDiv.appendChild(testTable = document.createElement("table")); with (testTable) { style.tableLayout="fixed"; style.borderSpacing="0px"; style.width = "400px"; appendChild(testCol = document.createElement("col")); testCol.style.width = 100 + 'px'; appendChild(testCol = document.createElement("col")); //testCol.style.width = 300 + 'px'; appendChild(testTBody = document.createElement("tbody")); cellSpacing= 0 } testTBody.appendChild(testTr = document.createElement("tr")); with (testTr){ } for (var i= 0; i < 2; i++) { testTr.appendChild(testTd = document.createElement("td")); testTd.innerHTML = "Testing"; with (testTd) { style.borderTop = "1px solid lightgray"; style.borderLeft="1px solid lightgray"; style.borderRight="1px solid black"; style.borderBottom="1px solid black"; } } } </script> </html> Here's part of the code, problem I have is I have it set up for 5 rows, I need it to be able to make more than this, but not sure how many more, this is dependent on user input, how should I go about this? Also how would I go about making the users orders correspond with the right item number? I'd need to sort the array somehow? document.write('<table border="1">'); document.write("<tr>"); document.write('<th colspan="5">ORDER</th>') document.write("</tr>"); document.write("<tr>"); document.write('<th align="left">Item #</th>'); document.write('<th align="center">Name</th>'); document.write('<th align="center">Price</th>'); document.write('<th align="center">Quantity</th>'); document.write('<th align="center">Total</th>'); document.write("</tr>"); document.write('<td align="center">0</td>'); document.write('<td>' + productName[0] + '</td>'); document.write('<td> $' + sausagePrice + '</td>'); document.write('<td> ' + orderItemQty[0] + '</td>'); document.write('<td> ' + sausageTotal + '</td Resolution if interested: Code: <head> <title>Lab8</title> <script src="arrays.js" type="text/javascript"></script> <link href="css.css" rel="stylesheet" type="text/css" /> <script type="text/javascript"> function amountTotal() { var totalDonations = 0; for (var i = 0; i < amount.length; i++) { totalDonations += amount[i]; } return totalDonations; } </script> </head> <body> <table id="donations" rules="rows"> <tr> <th> Date </th> <th> Name </th> <th> Amount </th> <th> Address </th> </tr> <script type="text/javascript"> for (var i = 0; i < amount.length; i++) { if (i % 2 == 0) document.write("<tr>") else document.write("<tr class='yellowrow'>"); document.write("<td>" + date[i] + "</td>"); document.write("<td>" + firstName[i] + lastName[i] + "</td>"); document.write("<td>" + amount[i] + "</td>"); document.write("<td>" + street[i] + "<br />" + city[i] + "," + " " + state[i] + " " + zip[i] + "</td>"); } document.write("</tr>") </script> </table> <table id="totalsTable"> <tr> <th colspan="2"> Summary </th> </tr> <tr> <td> Contributions </td> <td class="amt"> <script type="text/javascript"> document.write(amount.length); </script> </td> </tr> <tr> <td> Amount </td> <td class="amt">$ <script type="text/javascript"> var totalTotal = amountTotal(); document.write(totalTotal); </script> </td> </tr> </table> </body> </html> I have a seperate .js sheet with some arrays on them (firstName, lastName, date, amount, city, state, zip) and I am trying to populate a table with these indexes. The 'yellowrow' highlights everyother row which is called out in my css sheet. My header rows fill in but not the rest. Here is the link for the site actually posted on the web. Code: <body> <table id="donations" rules="rows"> <tr> <th>Date</th> <th>Name</th> <th>Amount</th> <th>Address</th> </tr> <script type="text/javascript"> for (var i = 0; i < amount.length; i++) { if (i % 2 == 0) document.write("<tr>") else document.write("<tr class='yellowrow'>"); document.write("<td>" + date(i) + "</td>"); document.write("<td>" + firstName(i) + lastName(i) + "</td>"); document.write("<td>" + amount(i) + "</td>"); document.write("<td>" + "<br />" + city(i) + "," + state(i) + zip(i) + "</td>"); } document.write("</tr>") </script> </table> </body> This form collects info of the customer who wishes to select add-ons that would be applied to their digital photos. Examples of add-ons: Photo makeover Add object or person Crop image Have a look at the form Once a customer selects one of the options (Photo Manipulation or Photo Restoration for example - radio buttons) and then one or more Add-ons (check boxes in the Html form), enter their details and upload a photo, they hit the submit button and it then takes them to the PayPal checkout page where the total amount is shown. (see image below) The Issue: In the PayPal page, it now shows the total amount whichever add-ons you select, however it keeps showing "Add object or person" as well as all the 5 main options (radio buttons on the form) no matter what I select. This will be an issue as I will not know exactly which add-ons the customer has selected. Can someone please help me complete the coding so that the add-ons show on the PayPal checkout page. I look forward to your reply/replies. Kind Regards Rafi p.s: Could this be a possible solution? Even if it is, can someone help by completing the code? In order to send the options/add-ons the customer selects I may need to use the onX and osX variables (Where X is a number starting with 0 and incrementing by 1 see below), These can be used to set options for the add-onsthey select. The onO is the "option name" and os0 is the "option choice". So for example: <input type="hidden" name="on0" value="Photo manipulation"> <input type="hidden" name="os0" value="Whatever add-ons the customer selects"> <input type="hidden" name="on1" value="Photo restoration"> <input type="hidden" name="os1" value="Whatever add-ons the customer selects"> Hello All, I have a form where the number of input fields (lets call them B through N) is determined by the length of a php array. Above those input fields is another field (lets call this field input A) that I would like to be auto populated based on what the user enters in fields B through N. Here is my code. The first table (with all of the "totals" fields) holds all of the input fields that I would like to auto update. These fields should auto update so that every input in EACH of the "fy" fields in the second table is added together. Example: every input in the id="fy_{$fy.fy}_high_impact_cost" field should be added together as the user enters them, and the id="totals_high_impact_cost" field should be auto updated with that total. Code: <form method="post" name="submit" action="new_item.php" accept-charset='UTF-8'> <table border="box" width="100%"> <tr> <td align="center">$<input id="totals_high_impact_cost" size="3" name="totals_high_impact_cost" maxlength="20" style="text-align: right" />M</td> <td align="center">$<input id="totals_most_likely_impact_cost" size="3" name="totals_most_likely_impact_cost" maxlength="20" style="text-align: right" />M</td> <td align="center">$<input id="totals_low_impact_cost" size="3" name="totals_low_impact_cost" maxlength="20" style="text-align: right" />M</td> <td align="center">$<input id="totals_actual_expense" size="3" name="totals_actual_expense" maxlength="20" style="text-align: right" />M</td> <td align="center">$<input id="totals_high_mitigation_cost" size="3" name="totals_high_mitigation_cost" maxlength="20" style="text-align: right" />M</td> <td align="center">$<input id="totals_most_likely_mitigation_cost" size="3" name="totals_most_likely_mitigation_cost" maxlength="20" style="text-align: right" />M</td> <td align="center">$<input id="totals_low_mitigation_cost" size="3" name="totals_low_mitigation_cost" maxlength="20" style="text-align: right" />M</td> <td align="center">$<input id="totals_cost_in_scope" size="3" name="totals_cost_in_scope" maxlength="20" style="text-align: right" />M</td> <td align="center">$<input id="totals_unfunded_threat" size="3" name="totals_unfunded_threat" maxlength="20" style="text-align: right" />M</td> </tr> </table> {foreach value=fy from=$php_array} <table> <tr> <td align="center">$<input id="fy_{$fy.fy}_high_impact_cost" size="3" name="fy_{$fy.fy}_high_impact_cost" maxlength="20" style="text-align: right" value="{$fy.high_impact_cost}" onchange="update_totals_high_impact_cost()" />M</td> <td align="center">$<input id="fy_{$fy.fy}_most_likely_impact_cost" size="3" name="fy_{$fy.fy}_most_likely_impact_cost" maxlength="20" style="text-align: right" value="{$fy.most_likely_impact_cost}" />M</td> <td align="center">$<input id="fy_{$fy.fy}_low_impact_cost" size="3" name="fy_{$fy.fy}_low_impact_cost" maxlength="20" style="text-align: right" value="{$fy.low_impact_cost}" />M</td> <td align="center">$<input id="fy_{$fy.fy}_actual_expense" size="3" name="fy_{$fy.fy}_actual_expense" maxlength="20" style="text-align: right" value="{$fy.actual_expense}" />M</td> <td align="center">$<input id="fy_{$fy.fy}_high_mitigation_cost" size="3" name="fy_{$fy.fy}_high_mitigation_cost" maxlength="20" style="text-align: right" value="{$fy.high_mitigation_cost}" />M</td> <td align="center">$<input id="fy_{$fy.fy}_most_likely_mitigation_cost" size="3" name="fy_{$fy.fy}_most_likely_mitigation_cost" maxlength="20" style="text-align: right" value="{$fy.most_likely_mitigation_cost}" />M</td> <td align="center">$<input id="fy_{$fy.fy}_low_mitigation_cost" size="3" name="fy_{$fy.fy}_low_mitigation_cost" maxlength="20" style="text-align: right" value="{$fy.low_mitigation_cost}" />M</td> <td align="center">$<input id="fy_{$fy.fy}_cost_in_scope" size="3" name="fy_{$fy.fy}_cost_in_scope" maxlength="20" style="text-align: right" value="{$fy.cost_in_scope}" />M</td> </tr> </table> {/foreach} </form> Please email me at alexhall12315@yahoo.com if you would like more explanation. Thanks in advance for any help!!! =) Ok so Im going to break down what Im trying to do and hopefully someone can point me to a possible solution without getting all technical. I have 2 div tags. the first is a content container more or less. the second is a container for a php built calender (using html tables). Basically when the page loads the php builds the calenders html table code. each td element has an onclick event handler. The goal is to have the javascript handler execute when any non empty cell is clicked (non empty being that it has a date associated with it and is not a blank space filler). This is the easy part. The hard part is that each calendar day potentially has certain information associated with it stored in a mysql database. Im wanting input fields within the first container div to autopopulate with the information from the database (if any) for whatever day is clicked. Ive search around and heard things like javascript cant do mysql queries directly, and heard mention of ajax. So im stumped as to how to accomplish this. whether i need an external php script for the queries (perhaps inside a php function that can return data to the javascript that calls it?), but if that is plausable would it cause page loads or the like to the user? i really dont want to have to learn ajax for this one page, just seems excessive, but i do need a way to make the content in the first div populate with the respective database data for the selected day on the calendar. any thoughts, comments, or solutions that dont involve yet another web language would be greatly appreciated. thanks
Hello all I am new here but this place looked great and like one of the only places where I could find the answer to my question. I have created a page which pulls search results from various sites using PHP. It displays each result in a row in a table upon running. I wanted to add a button saying "More information" at which point, a div would appear and load the associated link for that search result within an iframe within the newly appeared div. I've been able to get a div appear and disappear on button click but, I couldn't get it to dynamically load an iframe on click with the associated search results link. Any suggestions are greatly appreciated. Also let me know if you need more information before assisting. Thanks! Hey, I was wondering if it is possible to make an image change whenever an anchorpoint on my page reaches the center or the side of the screen... Thanks for your help! I am working on a page where the user will select a location from a dynamically generated dropdown list. I was able to create the php multidimensional array (tested and working) from a MySql database using the users information at login, but I'm having problems converting it to a javascript multidimensional array. I need to be able to access variables that I can pass to a number of text fields within an html form. For instance, if a user belongs to a company with multiple addresses, I need to be able to let them select the address they need to prepopulate specific text fields. php array creation: Code: if ($row_locations) { while ($row_locations = mysql_fetch_assoc($locations)) { $mail[$row_locations['comp_id']]=array('mailto'=>$row_locations['mailto'], 'madd'=>$row_locations['madd'], 'madd2'=>$row_locations['madd2'], 'mcity'=>$row_locations['mcity'], 'mstate'=>$row_locations['mstate'], 'mzip'=>$row_locations['mzip'], 'billto'=>$row_locations['billto'], 'badd'=>$row_locations['badd'], 'badd2'=>$row_locations['badd2'], 'bcity'=>$row_locations['bcity'], 'bstate'=>$row_locations['bstate'], 'bzip'=>$row_locations['bzip']); } } javascript function - this should create the array and send variables to text fields. Code: function updateAddress() { var mail = $.parseJSON(<?php print json_encode(json_encode($mail)); ?>); { if (comp_id in mail) { document.getElementById('mailto').value=mail.comp_id.mailto.value; document.getElementById('madd').value=mail.comp_id.madd.value; document.getElementById('madd2').value=mail.comp_id.madd2.value; document.getElementById('mcity').value=mail.comp_id.mcity.value; document.getElementById('mstate').value=mail.comp_id.mstate.value; document.getElementById('mzip').value=mail.comp_id.mzip.value; } else { document.getElementById('mailto').value=''; document.getElementById('madd').value=''; document.getElementById('madd2').value=''; document.getElementById('mcity').value=''; document.getElementById('mstate').value=''; document.getElementById('mzip').value=''; } } } Where is this breaking? Thanks in advance. Hi there, so i am working on a website, and on it there is a video with youtube api. I need to hide all Table-rows that are not during each 5 second time frame. So for example, when it is at 0:36, it will hide all TR's besides the TR that has to do with the video between 0:35 and 0:40. Each TR displays a start time, content, and end time. Here is what the tables currently look like. Code: <table width="600" class="table" > <tr class="item-titles"> <td width="75" class="none">Start</td> <td width="400">Caption</td> <td width="75">End</td> </tr> <tr> <td class="none"><a href="javascript:player.seekTo(0, false)">0</a></td> <td><a href="javascript:player.seekTo(0, false)"></a></td> <td><a href="javascript:player.seekTo(5, false)">5</td> </tr> <tr> <td class="none"><a href="javascript:player.seekTo(5, false)">5</a></td> <td><a href="javascript:player.seekTo(5, false)"></a></td> <td><a href="javascript:player.seekTo(10, false)">10</td> </tr> <tr> <td class="none"><a href="javascript:player.seekTo(10, false)">10</a></td> <td><a href="javascript:player.seekTo(10, false)"></a></td> <td><a href="javascript:player.seekTo(15, false)">15</td> </tr> <tr> <td class="none"><a href="javascript:player.seekTo(15, false)">15</a></td> <td><a href="javascript:player.seekTo(15, false)"></a></td> <td><a href="javascript:player.seekTo(20, false)">20</td> </tr> <tr> <td class="none"><a href="javascript:player.seekTo(20, false)">20</a></td> <td><a href="javascript:player.seekTo(20, false)"></a></td> <td><a href="javascript:player.seekTo(25, false)">25</td> </tr> <tr> <td class="none"><a href="javascript:player.seekTo(25, false)">25</a></td> <td><a href="javascript:player.seekTo(25, false)"></a></td> <td><a href="javascript:player.seekTo(30, false)">30</td> </tr> <tr> <td class="none"><a href="javascript:player.seekTo(30, false)">30</a></td> <td><a href="javascript:player.seekTo(30, false)"></a></td> <td><a href="javascript:player.seekTo(35, false)">35</td> </tr> <tr> <td class="none"><a href="javascript:player.seekTo(35, false)">35</a></td> <td><a href="javascript:player.seekTo(35, false)"></a></td> <td><a href="javascript:player.seekTo(40, false)">40</td> </tr> <tr> <td class="none"><a href="javascript:player.seekTo(40, false)">40</a></td> <td><a href="javascript:player.seekTo(40, false)"></a></td> <td><a href="javascript:player.seekTo(45, false)">45</td> </tr> <tr> <td class="none"><a href="javascript:player.seekTo(45, false)">45</a></td> <td><a href="javascript:player.seekTo(45, false)"></a></td> <td><a href="javascript:player.seekTo(50, false)">50</td> </tr> <tr> <td class="none"><a href="javascript:player.seekTo(50, false)">50</a></td> <td><a href="javascript:player.seekTo(50, false)"></a></td> <td><a href="javascript:player.seekTo(55, false)">55</td> </tr> <tr> <td class="none"><a href="javascript:player.seekTo(55, false)">55</a></td> <td><a href="javascript:player.seekTo(55, false)"></a></td> <td><a href="javascript:player.seekTo(60, false)">60</td> </tr> <tr> <td class="none"><a href="javascript:player.seekTo(60, false)">60</a></td> <td><a href="javascript:player.seekTo(60, false)"></a></td> <td><a href="javascript:player.seekTo(65, false)">65</td> </tr> <tr> <td class="none"><a href="javascript:player.seekTo(65, false)">65</a></td> <td><a href="javascript:player.seekTo(65, false)"></a></td> <td><a href="javascript:player.seekTo(70, false)">70</td> </tr> <tr> <td class="none"><a href="javascript:player.seekTo(70, false)">70</a></td> <td><a href="javascript:player.seekTo(70, false)"></a></td> <td><a href="javascript:player.seekTo(75, false)">75</td> </tr> <tr> <td class="none"><a href="javascript:player.seekTo(75, false)">75</a></td> <td><a href="javascript:player.seekTo(75, false)"></a></td> <td><a href="javascript:player.seekTo(80, false)">80</td> </tr> <tr> <td class="none"><a href="javascript:player.seekTo(80, false)">80</a></td> <td><a href="javascript:player.seekTo(80, false)"></a></td> <td><a href="javascript:player.seekTo(85, false)">85</td> </tr> <tr> <td class="none"><a href="javascript:player.seekTo(85, false)">85</a></td> <td><a href="javascript:player.seekTo(85, false)"></a></td> <td><a href="javascript:player.seekTo(90, false)">90</td> </tr> <tr> <td class="none"><a href="javascript:player.seekTo(90, false)">90</a></td> <td><a href="javascript:player.seekTo(90, false)"></a></td> <td><a href="javascript:player.seekTo(95, false)">95</td> </tr> <tr> <td class="none"><a href="javascript:player.seekTo(95, false)">95</a></td> <td><a href="javascript:player.seekTo(95, false)"></a></td> <td><a href="javascript:player.seekTo(100, false)">100</td> </tr> <tr> <td class="none"><a href="javascript:player.seekTo(100, false)">100</a></td> <td><a href="javascript:player.seekTo(100, false)"></a></td> <td><a href="javascript:player.seekTo(105, false)">105</td> </tr> <tr> <td class="none"><a href="javascript:player.seekTo(105, false)">105</a></td> <td><a href="javascript:player.seekTo(105, false)"></a></td> <td><a href="javascript:player.seekTo(110, false)">110</td> </tr> <tr> <td class="none"><a href="javascript:player.seekTo(110, false)">110</a></td> <td><a href="javascript:player.seekTo(110, false)"></a></td> <td><a href="javascript:player.seekTo(115, false)">115</td> </tr> <tr> <td class="none"><a href="javascript:player.seekTo(115, false)">115</a></td> <td><a href="javascript:player.seekTo(115, false)"></a></td> <td><a href="javascript:player.seekTo(120, false)">120</td> </tr> <tr> <td class="none"><a href="javascript:player.seekTo(120, false)">120</a></td> <td><a href="javascript:player.seekTo(120, false)"></a></td> <td><a href="javascript:player.seekTo(125, false)">125</td> </tr> <tr> <td class="none"><a href="javascript:player.seekTo(125, false)">125</a></td> <td><a href="javascript:player.seekTo(125, false)"></a></td> <td><a href="javascript:player.seekTo(130, false)">130</td> </tr> <tr> <td class="none"><a href="javascript:player.seekTo(130, false)">130</a></td> <td><a href="javascript:player.seekTo(130, false)"></a></td> <td><a href="javascript:player.seekTo(135, false)">135</td> </tr> <tr> <td class="none"><a href="javascript:player.seekTo(135, false)">135</a></td> <td><a href="javascript:player.seekTo(135, false)"></a></td> <td><a href="javascript:player.seekTo(140, false)">140</td> </tr> <tr> <td class="none"><a href="javascript:player.seekTo(140, false)">140</a></td> <td><a href="javascript:player.seekTo(140, false)"></a></td> <td><a href="javascript:player.seekTo(145, false)">145</td> </tr> <tr> <td class="none"><a href="javascript:player.seekTo(145, false)">145</a></td> <td><a href="javascript:player.seekTo(145, false)"></a></td> <td><a href="javascript:player.seekTo(150, false)">150</td> </tr> <tr> <td class="none"><a href="javascript:player.seekTo(150, false)">150</a></td> <td><a href="javascript:player.seekTo(150, false)"></a></td> <td><a href="javascript:player.seekTo(155, false)">155</td> </tr> <tr> <td class="none"><a href="javascript:player.seekTo(155, false)">155</a></td> <td><a href="javascript:player.seekTo(155, false)"></a></td> <td><a href="javascript:player.seekTo(160, false)">160</td> </tr> <tr> <td class="none"><a href="javascript:player.seekTo(160, false)">160</a></td> <td><a href="javascript:player.seekTo(160, false)"></a></td> <td><a href="javascript:player.seekTo(165, false)">165</td> </tr> <tr> <td class="none"><a href="javascript:player.seekTo(165, false)">165</a></td> <td><a href="javascript:player.seekTo(165, false)"></a></td> <td><a href="javascript:player.seekTo(170, false)">170</td> </tr> <tr> <td class="none"><a href="javascript:player.seekTo(170, false)">170</a></td> <td><a href="javascript:player.seekTo(170, false)"></a></td> <td><a href="javascript:player.seekTo(175, false)">175</td> </tr> <tr> <td class="none"><a href="javascript:player.seekTo(175, false)">175</a></td> <td><a href="javascript:player.seekTo(175, false)"></a></td> <td><a href="javascript:player.seekTo(180, false)">180</td> </tr> <tr> <td class="none"><a href="javascript:player.seekTo(180, false)">180</a></td> <td><a href="javascript:player.seekTo(180, false)"></a></td> <td><a href="javascript:player.seekTo(185, false)">185</td> </tr> <tr> <td class="none"><a href="javascript:player.seekTo(185, false)">185</a></td> <td><a href="javascript:player.seekTo(185, false)"></a></td> <td><a href="javascript:player.seekTo(190, false)">190</td> </tr> <tr> <td class="none"><a href="javascript:player.seekTo(190, false)">190</a></td> <td><a href="javascript:player.seekTo(190, false)"></a></td> <td><a href="javascript:player.seekTo(195, false)">195</td> </tr> <tr> <td class="none"><a href="javascript:player.seekTo(195, false)">195</a></td> <td><a href="javascript:player.seekTo(195, false)"></a></td> <td><a href="javascript:player.seekTo(200, false)">200</td> </tr> <tr> <td class="none"><a href="javascript:player.seekTo(200, false)">200</a></td> <td><a href="javascript:player.seekTo(200, false)"></a></td> <td><a href="javascript:player.seekTo(205, false)">205</td> </tr> <tr> <td class="none"><a href="javascript:player.seekTo(205, false)">205</a></td> <td><a href="javascript:player.seekTo(205, false)"></a></td> <td><a href="javascript:player.seekTo(210, false)">210</td> </tr> <tr> <td class="none"><a href="javascript:player.seekTo(210, false)">210</a></td> <td><a href="javascript:player.seekTo(210, false)"></a></td> <td><a href="javascript:player.seekTo(215, false)">215</td> </tr> <tr> <td class="none"><a href="javascript:player.seekTo(215, false)">215</a></td> <td><a href="javascript:player.seekTo(215, false)"></a></td> <td><a href="javascript:player.seekTo(220, false)">220</td> </tr> <tr> <td class="none"><a href="javascript:player.seekTo(220, false)">220</a></td> <td><a href="javascript:player.seekTo(220, false)"></a></td> <td><a href="javascript:player.seekTo(225, false)">225</td> </tr> <tr> <td class="none"><a href="javascript:player.seekTo(225, false)">225</a></td> <td><a href="javascript:player.seekTo(225, false)"></a></td> <td><a href="javascript:player.seekTo(230, false)">230</td> </tr> <tr> <td class="none"><a href="javascript:player.seekTo(230, false)">230</a></td> <td><a href="javascript:player.seekTo(230, false)"></a></td> <td><a href="javascript:player.seekTo(235, false)">235</td> </tr> <tr> <td class="none"><a href="javascript:player.seekTo(235, false)">235</a></td> <td><a href="javascript:player.seekTo(235, false)"></a></td> <td><a href="javascript:player.seekTo(240, false)">240</td> </tr> <tr> <td class="none"><a href="javascript:player.seekTo(240, false)">240</a></td> <td><a href="javascript:player.seekTo(240, false)"></a></td> <td><a href="javascript:player.seekTo(245, false)">245</td> </tr> <tr> <td class="none"><a href="javascript:player.seekTo(245, false)">245</a></td> <td><a href="javascript:player.seekTo(245, false)"></a></td> <td><a href="javascript:player.seekTo(250, false)">250</td> </tr> <tr> <td class="none"><a href="javascript:player.seekTo(250, false)">250</a></td> <td><a href="javascript:player.seekTo(250, false)"></a></td> <td><a href="javascript:player.seekTo(255, false)">255</td> </tr> <tr> <td class="none"><a href="javascript:player.seekTo(255, false)">255</a></td> <td><a href="javascript:player.seekTo(255, false)"></a></td> <td><a href="javascript:player.seekTo(260, false)">260</td> </tr> <tr> <td class="none"><a href="javascript:player.seekTo(260, false)">260</a></td> <td><a href="javascript:player.seekTo(260, false)"></a></td> <td><a href="javascript:player.seekTo(265, false)">265</td> </tr> <tr> <td class="none"><a href="javascript:player.seekTo(265, false)">265</a></td> <td><a href="javascript:player.seekTo(265, false)"></a></td> <td><a href="javascript:player.seekTo(270, false)">270</td> </tr> <tr> <td class="none"><a href="javascript:player.seekTo(270, false)">270</a></td> <td><a href="javascript:player.seekTo(270, false)"></a></td> <td><a href="javascript:player.seekTo(275, false)">275</td> </tr> <tr> <td class="none"><a href="javascript:player.seekTo(275, false)">275</a></td> <td><a href="javascript:player.seekTo(275, false)"></a></td> <td><a href="javascript:player.seekTo(280, false)">280</td> </tr> <tr> <td class="none"><a href="javascript:player.seekTo(280, false)">280</a></td> <td><a href="javascript:player.seekTo(280, false)"></a></td> <td><a href="javascript:player.seekTo(285, false)">285</td> </tr> </table> And you can see the page at http://134.117.226.43:8000/check_sub...ty/test101/91/ any help ? for(var i=0; i<orderItemIndex; i++){ document.writeln('<tr>'); } document.writeln('<td>' + orderItemIndex[0] + '</td>'); document.write('<td>' + productName[0] + '</td>'); document.write('<td> $' + sausagePrice + '</td>'); document.write('<td> ' + orderItemQty[0] + '</td>'); document.write('<td> ' + sausageTotal + '</td>'); document.writeln('</tr>'); } orderItemIndex is an array with user inputs in it, I'm trying to make a new row for each individual array, the table is creating correctly but the loop is not working, if several inputs are added it just outputs the last input to one row, instead of making a new one each time, what am I missing? (The code above has other problems I know but I'm working on this first) Reply With Quote 01-07-2015, 06:50 PM #2 sunfighter View Profile View Forum Posts Senior Coder Join Date Jan 2011 Location Missouri Posts 4,830 Thanks 25 Thanked 672 Times in 671 Posts document.write() is a horrible way to do anything. It certainly will not insert anything, what it does is over write anything on your page so if you have a table defined with HTML the document.write() will wipe it out. Look at HTML DOM Table insertRow() Method Hi, First the background information - I run a website for the FA, they have recently launched an Under 21's League. They want the Fixture & Results posted on the site, with a league table. There is the problem, I need to league table to automatically update according to the results I put in. I believe JavaScript is capable of this, I have spent the last few days learning a basic ~ intermediate level of JS. However, I am still stuck. If you think you could help me out then reply here, I know this is one hell of a lot of coding so if you can only point me in the right direction that would be great! A side note -- I was thinking about it and well the JS needs to pull information from another internal web page, which I believe it cannot do. However, I'm lead to believe it could read it from a file on the server? If so I guess I will need to create a form to submit the results? Hope someone can help me out Thanks, Ben Hey I was hoping someone could point me in the right direction here. I'm supposed to add a <script> in the mainContent div of puppies.htm to generate the opening table tags followed by a header row with cells for Picture, Description, and Date Taken. Obviously these are supposed to be taken from the arrays in puppies.js, but how do i organize those arrays into a table. Any input would be much appreciated. thanks. puppies.js Code: var puppyPics = new Array(); var pictureDesc = new Array(); var pictureDate = new Array(); puppyPics[0] = "AllTheKids.jpg"; puppyPics[1] = "susie.jpg"; puppyPics[2] = "princess.jpg"; puppyPics[3] = "wicketAndCarlos.jpg"; puppyPics[4] = "wicketAndGeorge.jpg"; pictureDesc[0] = "New puppies"; pictureDesc[1] = "Susie"; pictureDesc[2] = "This is Princess"; pictureDesc[3] = "Wicket is very social"; pictureDesc[4] = "Wicket and George"; pictureDate[0] = "January 10, 2011"; pictureDate[1] = "January 10, 2011"; pictureDate[2] = "January 10, 2011"; pictureDate[3] = "January 15, 2011"; pictureDate[4] = "January 15, 2011"; puppies.htm Code: <div id="mainContent"> <h1> My Puppies</h1> <p>I made this page to show off my wonderful puppies! I hope you enjoy their pictures.</p> <script <!-- end #mainContent --></div> I need to create an interactive map similar to the one on this site: http://viewers-guide.hbo.com/game-of-thrones/#!/map/ It is a map of a fictional area ( a real area but there are fictional buildings and characters on it) so I don't think google maps plugins are suitable. I don't want to reinvent the wheel, so if anybody has a good suggestion of a good jquery/javascript solution for interactive maps, please refer me to the relevant information. In other words, I need a map where by clicking the objects on the map, a popup window pops up with additional information about the 'scene' or a 'character'. In addition, the map will be dark from the beginning and more and more sites and characters will be revealed on it every week. Thanks for any tips! I'm writing a script in javascript(actually a chrome extension) and I need an object that I can write to it like this(sorry, don't know how to explain it better) and then I convert it to string with format of json. Code: id[129].weekDay[6].hour[23] = 0 Here, id is an array, that each element in it contain another array(weeksDay) and in that array each contain another array(hour). The id indices are unlimited, for weekDay 7 and hour 24. I searched in google but i couldn't find what I wanted. Actually don't know the best keyword to search.(objects in arrays?) I don't know what exactly it is called, I can write it's declaration in VB.NET if that helps you. Hello, I'm trying to create a textarea using Javascript, the function creates a textarea in IE, but it does not create that element in Firefox and chrome. JavaScript Code:- Code: function addRow() { alert("function start"); var table = document.getElementById('tableId'); var rowCount = table.rows.length; var row = table.insertRow(rowCount); var cell1 = row.insertCell(0); var textNode = document.createTextNode(rowCount + 1); cell1.appendChild(textNode); var cell2 = row.insertCell(1); var textArea = zxcFormField('TEXTAREA','option1'); textArea.setAttribute("cols","20"); textArea.style.height = "42px"; textArea.style.width = "496px"; cell2.appendChild(textArea); alert("function end"); } function zxcFormField(tag,nme,type){ alert("2 function start"); var el; try { alert("In Try"); el=document.createElement('<'+tag+(type?' type='+type:'')+' name='+nme+' >'); } catch (e){ alert("In Catch"); el=document.createElement(tag); if (type) el.type=type; el.name=nme; } return el; } When I call this function it goes in the catch block in Firefox and Chrome, the textarea is displayed and it disappears with a flash. I've banged my head against wall trying to figure this out. Thanks, Abhishek Hi i need to use an equivalent of the php function array_count_values() Any help with that please cheers ewire how to create a customizable event based calender i need to create a grid calender where user can edit the fields of the dates and he can block some dates ! is it possible please help to me i hope u will help to me thanking you reply soon hie everyone plz i want to know how to make tabs using javascript.... i want to make tabs like this website http://traveline.idea-sys.net/CSP/Default.aspx?A=2&P=50 --> (M/S Darakum - Description / GalleryDeck / Plan) can anyone help me plz? |