JavaScript - Get Content Inside A Td-tag
Hi,
I wish to get the content inside a td-tag and use with JS operators. This is my source. Code: <style> #a { display : none; } </style> <table> <tr id="field_id-6"> <td valign="top" width="50%" style="text-align:right;"> <span style="color:#333333;">Number</span>: </td> <td valign="top" width="50%" style="text-align:left; overflow:hidden;"> <div class="field_uneditable">120</div> </td> </tr> </table> <img src="../image.png" id="a"> <script> var x= ; if(x>49) { document.getElementById("a").style.display = "block"; } </script> So I need to indicate x as the number 120. But I can't just write 120 beside x, because 120 will change to a new number. Similar TutorialsHello: I have a bit of an interesting delima: I have a form with select box which is dynamically db populated and based on the first selection, additional data populates two other linked boxes (a input and a textarea). This process happens in a table row. here is the source code of the selection process: PHP Code: <tr><td><select name='select_1' style='width:200px; color:#003399; text-align:center; font-size:1em' onChange="switch_select(); switch_text();"> <option>-- Select an Item --</option><option>5 A Series Blades</option><option>Balls</option><option>TT Tables-Mini</option><option>Bottle Water</option><option>TT Tables -- Reg</option><option>Gatorate</option><option>Blade combo</option><option>Membership Renewal</option><option>1 hr Private Lesson (Adlt)</option><option>1 hr Private Lesson (Chld)</option><option>Group Lesson (Adlt)</option><option>Group Lesson (Chlidren)</option><option>Membership (Couples-2)</option><option>Membership (Family -Up 4)</option><option>Robot Play</option><option>Gift Certificate</option><option>Gift Card Add Value</option><option>Club T-Shirts</option><option>Member Credit</option><option>Other</option><option>Rubber - 1615 PIPS </option><option>Rubber -Volant 3</option><option>6 A Series Blades</option><option>Blades Only -China QI</option><option>Blades Only -CQ 1</option><option>Ross-Action Blade</option><option>Ross-Classic Blade</option></select> </td> <select name='select_2' onChange="switch_text();" style='display:none' disabled='true'> <option>You need to select a category</option> <option></option> <option></option> </select><td><textarea name='mytextarea' rows='2' cols='40' class='expand10-1000' style='color:#003399; text-align:left; font-size:1.1em; border-left: none; border-right: none; border-bottom: none'></textarea><td> <td valign='top' width='17%'><input type='text' name='qty' class="qty" size='3' maxlength='3' value='' class='combo3' rel='code_id' title='' style='color:#003399; text-align:left; font-size:1.1em; border-left: none; border-right: none; border-bottom: none'></td> <td valign='top' width='17%'><input type='text' name='cost' class="cost" size='6' maxlength='6' value='0.00' class='combo3' rel='code_id' title='' style='color:#003399; text-align:left; font-size:1.1em; border-left: none; border-right: none; border-bottom: none'></td> </tr> The user has the option of adding an additional row which is similarily structured to give the user the option of selecting a different item (with its description an price) for each row. Now here is the problem; the adding row mechanism is done with ajax using the following code: PHP Code: $('#addrow').click(function(){ $('.item-row:last').after('[COLOR="Red"]//INSERT THE CONTENT OF THE PHP HERE//[/COLOR]'); if ($('.delete').length > 0) { $('.delete').show(); } bind(); }); I want to insert the content of an external php file containing the dynamic linked field into the ajax above in the section outlined in red. Sorry for the long post... here is the external php file: PHP Code: <?php echo" <script type='text/javascript' src='js/jquery-1.3.2.min.js'></script> <script language='JavaScript'> ";?> var num_of_cats = 17; // This is the number of categories, including the first, blank, category. var open_in_newwindow=1; //Set 1 to open links in new window, 0 for no. <?php include '../datalogin.php';// make sure this is available to make connection to db $result = mysql_query("SELECT * FROM products"); echo "var option_array = new Array(num_of_cats);"; $count=1; echo"option_array[0] = new Array(\"Please Select a Merchandise\");"; while($row = mysql_fetch_array($result)) { echo"option_array[".$count."] = new Array(\"--select One--\",\"\",\"\");"; $count++; } $result2 = mysql_query("SELECT * FROM products"); echo"var text_array = new Array(num_of_cats);"; $count=1; echo "text_array[0] = new Array(\"Please Select a Merchandise\");"; while($row_1 = mysql_fetch_array($result2)) { echo "text_array[".$count."] = new Array(\"".$row_1['product_desc']."\");"; $count++; } $result3 = mysql_query("SELECT * FROM products"); echo "var text_array2 = new Array(num_of_cats);"; $count=1; echo "text_array2[0] = new Array(\"Please Select a Merchandise\");"; while($row_2 = mysql_fetch_array($result3)) { echo "text_array2[".$count."] = new Array(\"".$row_2['unit_cost']."\");"; $count++; } ?> <?php echo" var options = 0; function switch_select() { for (loop = window.document.PaymentForm.select_2.options.length-1; loop > 0; loop--) { window.document.PaymentForm.select_2.options[loop] = null; } for (loop = 0; loop < option_array[window.document.PaymentForm.select_1.selectedIndex].length; loop++) { window.document.PaymentForm.select_2.options[loop] = new Option(option_array[window.document.PaymentForm.select_1.selectedIndex][loop]); } window.document.PaymentForm.select_2.selectedIndex = 0; } function switch_text() { window.document.PaymentForm.mytextarea.value = text_array[window.document.PaymentForm.select_1.selectedIndex][window.document.PaymentForm.select_2.selectedIndex]; window.document.PaymentForm.cost.value = text_array2[window.document.PaymentForm.select_1.selectedIndex][window.document.PaymentForm.select_2.selectedIndex]; //window.document.PaymentForm.gift_card.value = text_array3[window.document.PaymentForm.select_1.selectedIndex][window.document.PaymentForm.select_2.selectedIndex]; //window.document.PaymentForm.qty.value = text_array4[window.document.PaymentForm.select_1.selectedIndex][window.document.PaymentForm.select_2.selectedIndex]; } function box() { if (window.document.PaymentForm.select_2.selectedIndex == 0) { alert(\"Sorry, you have to select an item\"); } else { if (open_in_newwindow==1) window.open(url_array[window.document.PaymentForm.select_1.selectedIndex][window.document.PaymentForm.select_2.selectedIndex],\"_blank\"); else window.location=url_array[window.document.PaymentForm.select_1.selectedIndex][window.document.PaymentForm.select_2.selectedIndex] } } function set_orig() { window.document.PaymentForm.select_1.selectedIndex = 0; window.document.PaymentForm.select_2.selectedIndex = 0; } window.onload=set_orig </script> "; include '../datalogin.php'; $get_products = "select id as id_num, items as display_name2 from products order by id_num"; $get_products_res = mysql_query($get_products) or die (mysql_error()); if (mysql_num_rows($get_products_res) < 1) { // no records $display_block .="<p><em>Sorry, no records to select</em></p>"; } else { echo" <form name='PaymentForm' onSubmit='return false;'> <tr><td><select name='select_1' style='width:200px; color:#003399; text-align:center; font-size:1em' onChange=\"switch_select(); switch_text();\"> <option>-- Select an Item --</option>"; while ($recs2 = mysql_fetch_array($get_products_res)) { $id_num = $recs2['id_num']; $display_name2 = stripslashes($recs2['display_name2']); //$display_block .= "<option value=\"$id_num\">$display_name2</option>"; echo "<option>$display_name2</option>"; } } echo "</select> </td>"; echo " <select name='select_2' onChange=\"switch_text();\" style='display:none' disabled='true'> <option>You need to select a category</option> <option></option> <option></option> </select>"; echo"<td><textarea name='mytextarea' rows='2' cols='40' class='expand10-1000' style='color:#003399; text-align:left; font-size:1.1em; border-left: none; border-right: none; border-bottom: none'></textarea><td> <td valign='top' width='17%'><input type='text' name='qty' class=\"qty\" size='3' maxlength='3' value='' class='combo3' rel='code_id' title='' style='color:#003399; text-align:left; font-size:1.1em; border-left: none; border-right: none; border-bottom: none'></td> <td valign='top' width='17%'><input type='text' name='cost' class=\"cost\" size='6' maxlength='6' value='0.00' class='combo3' rel='code_id' title='' style='color:#003399; text-align:left; font-size:1.1em; border-left: none; border-right: none; border-bottom: none'></td> </tr> </form>"; ?> I hope this is doable and that I have describe my intention properly. Any thoughts would be appreciated! Mossa Hi, I've create a jquery accordian using the code provided in the main accordian page. It all works brilliantly, except when I try to show an image that will link to another page, the image does not show. For example, In one of the accordion content areas, the code shows: Code: <div> <h3><a href="#">How can I get a price quote?</a></h3> <div>Simply click on the button below to open up Power Image's all-inclusive Quick Quote tool, then follow the prompts to enter your style, color, ink colors, and quantity. <img src="images/quote.png" width="100" height="30">When you're done, click "Total" to see your all-inclusive price! Additionally, once you get a quote in the Design Center, your price quote updates live under your design as you create.</div> </div> When clicking on the header to open the content however, the image does not show. I have checked the location of the image multiple times, and it is right. There isn't even a broken image that shows where the image should be. What code do I need to add to allow images to be inside the content area of accordions? Hi all, I am using xmlhttp.open();xmlhttp.send(); to send a php content to a div. This php content is again using the same method to get php content from a further page. The content of the div, does not seem to be using the css and javascript files defined in the calling pages <head> section. Does anyone know why this is? Is there a workaround or solution to this problem? It might be easier to understand looking at the code, so Background info: Javascript file: scripts.js client.php ----> loads data from: display_client.php display_client.php ----> loads data from: display_brand.php Code: client.php http://pastebin.com/4EFn9YRf display_client.php http://pastebin.com/BGZAKre2 display_brand.php http://pastebin.com/0a4Pg3gg scripts.js http://pastebin.com/er4dkmPc Thanks! Ok, I would post my entire data here but then yall would be reading insane amounts of script. I've got a div content jquery slider on my site I am making and it works beautifully in all browsers(took me a while). Then, I decided why not have it where when people click on a "read more" link that it pops up a box, instead of directing to the new page, and displays the contents of a div. It would not work at all. My question is there a possible way to do this?
Hi, I have the following scrolling table where I do not want the table headers to scroll. I want only the data inside <td></td> to scroll. For some reason that is not happening. Can someone help ? Really appreciate that. Regards, sbguy [CODE] <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Untitled Page</title> <script type="text/javascript"> var div, scrollTop, scrollID, direction, imgDirection, scrollID1; window.onload = function() { div1 = document.getElementById("div1"); scrollTop = div1.scrollTop; }; function scrollOnImage() { if (imgDirection ==1 ) { if (scrollTop != 0) scrollTop--; } else if (imgDirection == 2) { if (scrollTop != (div1.scrollHeight - 300)) scrollTop++; } div1.scrollTop = scrollTop; scrollID1 = setTimeout("scrollOnImage()", 10); } </script> </head> <body> <br /> <div style="border: solid 1px red; float: left; height:300px; max-height:300px; width:200px; overflow: hidden;" > <table> <tr> <th style="height:20px;"><input type="image" src="images/LGbtn_off.png" alt="img1" onMouseOut="clearTimeout(scrollID1)" onMouseOver="imgDirection=1; scrollOnImage()" /></th> <th>1A</th> <th ><input type="image" src="images/RRbtn_off.png" alt="img2" onMouseOut="clearTimeout(scrollID1)" onMouseOver="imgDirection=2; scrollOnImage()" /></th> </tr> <tr> <td colspan="3" style="height:280px; max-height:280px;"> <div id="div1"> <ul id="ulR_1A" class="ulli"> <li><span class="li_head">PCode:</span> 1234</li> <li><span class="li_head">Product:</span> GX12x24 Medium Large 80</li> <li><span class="li_head">Qty:</span> 256</li> <li><span class="li_head">Batch No:</span> 01AC950</li> <li><span class="li_head">Manf Date:</span> 11/08/2012</li> <li><span class="li_head">SS Date:</span>11/07/2013</li> <li><span class="li_head">Total Pals:</span> 60</li> <li><span class="li_head">Pals Occupied:</span> 59</li> <li><span class="li_head">Bin Occupancy:</span> 89%</li> <li><span class="li_head">Trn No:</span> 1234567890</li> <li><span class="li_head">Bin Status:</span> Part Full</li> </ul> <ul id="ulR_1A" class="ulli"> <li><span class="li_head">PCode:</span> 1235</li> <li><span class="li_head">Product:</span> GX12x24 Medium Large 80</li> <li><span class="li_head">Qty:</span> 256</li> <li><span class="li_head">Batch No:</span> 01AC950</li> <li><span class="li_head">Manf Date:</span> 11/08/2012</li> <li><span class="li_head">SS Date:</span>11/07/2013</li> <li><span class="li_head">Total Pals:</span> 60</li> <li><span class="li_head">Pals Occupied:</span> 59</li> <li><span class="li_head">Bin Occupancy:</span> 89%</li> <li><span class="li_head">Trn No:</span> 1234567890</li> <li><span class="li_head">Bin Status:</span> Part Full</li> </ul> <ul id="ulR_1A" class="ulli"> <li><span class="li_head">PCode:</span> 1236</li> <li><span class="li_head">Product:</span> GX12x24 Medium Large 80</li> <li><span class="li_head">Qty:</span> 256</li> <li><span class="li_head">Batch No:</span> 01AC950</li> <li><span class="li_head">Manf Date:</span> 11/08/2012</li> <li><span class="li_head">SS Date:</span>11/07/2013</li> <li><span class="li_head">Total Pals:</span> 60</li> <li><span class="li_head">Pals Occupied:</span> 59</li> <li><span class="li_head">Bin Occupancy:</span> 89%</li> <li><span class="li_head">Trn No:</span> 1234567890</li> <li><span class="li_head">Bin Status:</span> Part Full</li> </ul> </div> </td> </tr> </table> </div> <div style="border: solid 1px red; float: left"> <img src="http://www.easyvoyage.co.uk/base/imgs/default/esv/meh/upDownArrow.png" onMouseOut="clearTimeout(scrollID1)" onMouseOver="imgDirection=1; scrollOnImage()" /><br /><br /> <img src="http://www.easyvoyage.co.uk/base/imgs/default/esv/meh/downUpArrow.png" onMouseOut="clearTimeout(scrollID1)" onMouseOver="imgDirection=2; scrollOnImage()" /> </div> </body> </html> [CODE] I am currently creating a page to allow a user to change their password. I have a field which the user will enter their current password into and I am then using javascript to check whether this is the correct password. My passwords are encrypted using md5 and so I need to incorporate this into the javascript function. I have tried but unfortunately cannot get the correct value for the encrypted password. My javascript code is as follows... Code: function verifyCurrentPassword(){ //Gain the hashed password that is in the database var password; <?php print "password='" .$password. "';\n"; ?> //Find the password that the user has entered as the current password var hashedpassword; var currentpassword = document.getElementById("currentpassword").value; <?php print "hashedpassword='" .md5("currentpassword"). "';\n"; ?> if(password == hashedpassword){ alert("passwords are the same"); } } hey ppl. i am new here. looks like i will do some Js for years i have a div called "farmacias" inside the content div i want to write something in the div but this is not working document.getElementById("farmacias").innerHTML='ola' anyone knows why? im trying to incorporate a tweetme button....inside of my joomla myblog component i entered into the core html with php tags of the blog....went to the bottom and added in the javascript for the twitter button....it worked but i want the url of the twitter button to point to the specific url's of each blog post so i simply grabbed the php tag from the top of the post that determines the link for the title of the blog Code: <?php echo $e['permalink']; ?> this is the code i ended up with Code: <script type="text/javascript"> tweetmeme_url = '<?php echo $e['permalink']; ?>'; </script> <script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js"></script> it gave me a syntax error..... is there anyway to make this situation possible? in a javascript file that contains the following code, is there a way to hyperlink the word ELEPHANT ? $j('#message').html("white ELEPHANT"); Hello everyone! I'm new to javascript (started just yesterday) and I've run to some problems... Code: <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="hr" lang="hr"> <head> <title> Tomislav Paj - studentska web stranica </title> <link rel="stylesheet" type="text/css" href="moj1.css" /> <script type="text/javascript"> function zbroji(){ var MA1 = document.getElementById("MA1"); var LA1 = document.getElementById("LA1"); var EM1 = document.getElementById("EM1"); var PR1 = document.getElementById("PR1"); var MA2 = document.getElementById("MA2"); var LA2 = document.getElementById("LA2"); var EM2 = document.getElementById("EM2"); var PR2 = document.getElementById("PR2"); zbroj = ( 8*MA1.value + 8*LA1.value + 8*EM1.value + 8*MA2.value + 8*LA2.value + 8*EM2.value ) + 0.5 * ( 6*PR1.value + 6*PR1.value ); UKUPNO.value = zbroj; } </script> </head> ................. <div class="dd" > <h2> DiplCalc </h2> <form> <pre> PRVI SEMESTAR Mat. Analiza 1 <input type="number" class="upis" id="MA1" maxLength=1 size=1 /> Lin. Algebra 1 <input type="number" class="upis" id="LA1" maxLength=1 size=1 /> Elem. Mat 1 <input type="number" class="upis" id="EM1" maxLength=1 size=1 /> Programiranje 1 <input type="number" class="upis" id="PR1" maxLength=1 size=1 /> <br/> DRUGI SEMESTAR Mat. Analiza 2 <input type="number" class="upis" id="MA2" maxLength=1 size=1 /> Lin. Algebra 2 <input type="number" class="upis" id="LA2" maxLength=1 size=1 /> Elem. Mat 2 <input type="number" class="upis" id="EM2" maxLength=1 size=1 /> Programiranje 2 <input type="number" class="upis" id="PR2" maxLength=1 size=1 /> <br/> <input type="button" id="suma" value="UKUPNO" onclick="zbroji()" /> <input type="text" class="ispis" id="UKUPNO" size=5/> </pre> </form> </div> this should be some kind of tool that helps calculate grad points... nevermind... it was working fine, until I've put it inside <div> block... please hepl!! thank you *edit this is working just fine on Safari and Crome, but fails on Firefox and IE... I have multiple <?php require("../section.php"); ?> on my pages and I would like to insert some Javascript (for Facebook's social bookmarks plugins) in one of these so that it comes right before the </body> tag. Currently my "footer.php" require is in that position so I open the footer.php and place the Javascript at the end. Code: <?php echo ' Footer Content Here's my Javascript '; ?> It gives a syntax error in Dreamweaver halfway through the JS and the footer.php doesn't show at all when uploaded. Can you not insert JS this way? How would I do this? I don't know anything about Javascript so be easy. hi, in my code below I am using inlinecontent from thickbox which works but inside the <div id="myOnPageContent"> only shows the first Category Name and doesn't loop through but it is looping outside as it shows a different Category Name at teh top of my inline content please help! Code: <td class="smallcelltext"><input alt="#TB_inline?height=150&width=400&inlineId=myOnPageContent" title="Edit <%= rs1("CategoryName") %> Category" class="thickbox" type="button" value="edit" /> <div id="myOnPageContent"> <p> <form> edit <%= rs1("CategoryName") %>: <input type="text" name="CategoryName" value="<%= rs1("CategoryName") %>" /> </form> </p> </div> </td> Hey guys, so i have a table, and it displays 6 rows, and the content inside of those rows. But i need to make it so that the middle row, has a border so it appears it is highlighted. Here is what i have Code: function timer() { time=parseInt(player.getCurrentTime()) if (time%5==0&&oldtime!=time){ rows[1].innerHTML=rows[(time/5)+ -1].innerHTML rows[2].innerHTML=rows[(time/5)+ 0].innerHTML rows[3].innerHTML=rows[(time/5)+ 1].innerHTML rows[4].innerHTML=rows[(time/5)+ 2].innerHTML rows[5].innerHTML=rows[(time/5)+ 3].innerHTML oldtime=time } } Hi guys, I have a <div> tag that is getting updated by calling a php script. Inside of the div's innerHTML, there is a <select> tag. I need to be able to change the div whenever a user changes the select tag. How can I do this? I've been trying to get the select tag, but it doesn't seem to evaluate right. Ex: (note, the select's name is "courseselect") Code: var thediv = document.getElementById("mydiv"); var selectMenu = thediv.getElementsByTagName("select"); var selector; for (var i = 0; i < selectMenu.length; i++) { var currAtt = selectMenu[i].getAttribute("name"); if (currAtt == "selectcourse") { selector = selectMenu[i]; } } selector.onChange = function() { alert("something has changed!"); } Any help is appreciated. Thanks! ok, so I have a code where it takes documents and uploads them as soon as selected. I want to know how I can put in my genRandomString() in so that not only will the doc upload, but this random string will submit to database, but I need this string to be the same for all documents that are uploaded on a single page load.....when page refreshes, new string, else it stays the same. I am going to link this number as an id in the database so that it can be identified. does this make any sense at all?????? Code: <?php function genRandomString($length = 20) { $characters = '0123456789'; $string =''; for ($p = 0; $p < $length; $p++) { $string .= $characters[mt_rand(0, strlen($characters))]; } return $string; } ?> <!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>Multiple File Upload With Progress Bar - Web Developer Plus Demos</title> <script type="text/javascript" src="js/jquery-1.3.2.js"></script> <script type="text/javascript" src="js/swfupload/swfupload.js"></script> <script type="text/javascript" src="js/jquery.swfupload.js"></script> <script type="text/javascript"> $(function(){ $('#swfupload-control').swfupload({ upload_url: "upload-file.php", file_post_name: 'uploadfile', file_size_limit : "9999999999999999999999999999999999", file_types : "*", file_types_description : "Image files", file_upload_limit : 1000, flash_url : "js/swfupload/swfupload.swf", button_image_url : 'js/swfupload/wdp_buttons_upload_114x29.png', button_width : 114, button_height : 29, button_placeholder : $('#button')[0], debug: false }) .bind('fileQueued', function(event, file){ var listitem='<li id="'+file.id+'" >'+ 'File: <em>'+file.name+'</em> ('+Math.round(file.size/1024)+' KB) <span class="progressvalue" ></span>'+ '<div class="progressbar" ><div class="progress" ></div></div>'+ '<p class="status" >Pending</p>'+ '<span class="cancel" > </span>'+ '</li>'; $('#log').append(listitem); $('li#'+file.id+' .cancel').bind('click', function(){ //Remove from queue on cancel click var swfu = $.swfupload.getInstance('#swfupload-control'); swfu.cancelUpload(file.id); $('li#'+file.id).slideUp('fast'); }); // start the upload since it's queued $(this).swfupload('startUpload'); }) .bind('fileQueueError', function(event, file, errorCode, message){ alert('Size of the file '+file.name+' is greater than limit'); }) .bind('fileDialogComplete', function(event, numFilesSelected, numFilesQueued){ $('#queuestatus').text('Files Selected: '+numFilesSelected+' / Queued Files: '+numFilesQueued); }) .bind('uploadStart', function(event, file){ $('#log li#'+file.id).find('p.status').text('Uploading...'); $('#log li#'+file.id).find('span.progressvalue').text('0%'); $('#log li#'+file.id).find('span.cancel').hide(); }) .bind('uploadProgress', function(event, file, bytesLoaded){ //Show Progress var percentage=Math.round((bytesLoaded/file.size)*100); $('#log li#'+file.id).find('div.progress').css('width', percentage+'%'); $('#log li#'+file.id).find('span.progressvalue').text(percentage+'%'); }) .bind('uploadSuccess', function(event, file, serverData){ var item=$('#log li#'+file.id); item.find('div.progress').css('width', '100%'); item.find('span.progressvalue').text('100%'); var pathtofile='<a href="uploads/'+file.name+'" rel="nofollow" target="_blank" >view »</a>'; item.addClass('success').find('p.status').html('Done!!! | '+pathtofile); }) .bind('uploadComplete', function(event, file){ // upload has completed, try the next one in the queue $(this).swfupload('startUpload'); }) }); </script> <style type="text/css" > #swfupload-control p{ margin:10px 5px; font-size:0.9em; } #log{ margin:0; padding:0; width:500px;} #log li{ list-style-position:inside; margin:2px; border:1px solid #ccc; padding:10px; font-size:12px; font-family:Arial, Helvetica, sans-serif; color:#333; background:#fff; position:relative;} #log li .progressbar{ border:1px solid #333; height:5px; background:#fff; } #log li .progress{ background:#999; width:0%; height:5px; } #log li p{ margin:0; line-height:18px; } #log li.success{ border:1px solid #339933; background:#ccf9b9; } #log li span.cancel{ position:absolute; top:5px; right:5px; width:20px; height:20px; background:url('js/swfupload/cancel.png') no-repeat; cursor:pointer; } </style> </head> <body> <div id="swfupload-control"> <p>Upload upto 5 image files(jpg, png, gif), each having maximum size of 1MB(Use Ctrl/Shift to select multiple files)</p> <input type="button" id="button" /> <p id="queuestatus" ></p> <ol id="log"></ol> </div> </body> </html> I would like to know (maybe I know the answer already), but can a function be paused, like halfway the function pause the function for lets say for 5 seconds, then continue. Thanks Hello, I'm developing very simple web site for my gym. It has a main page, index.php and several secondary pages e.g. home.php, services.php, location.php. Secondary pages are reachable via php script called through navigation bar located in index.php. Once it's called the pages are loaded inside a main frame, which is located in index.php as well. Everything works fine, except when I add javascript code (which presents map of the gym) inside location.php site. Body of location.php looks like this: <body> <h2>Lokacije fitness centara<br></h2> <p>"Fitness centar Adam"</p> <script type="text/javascript" src="http://www.karte.hr/api.js?v=1.0"> </script> <div id="karte_hr_karta" style="border:1px solid #C5C5C5;width:450px; height:400px;"> <a href="http://www.karte.hr/karta/g-l-fitness-adam-i-eva">Interaktivna karta Hrvatske | Interactive map of Croatia</a> <script type="text/javascript"> new karteHR({container:"karte_hr_karta", slider:true, onload:function() { this.viewer.setViewBound(2452469, 5064256, 2471292, 5073038); this.kartehr.loadMyMap({mid:43425, nosetbound:true}); }}); </script>" </div> </body> When I call location.php through navigation bar from index.php, the whole page reloads (instead of main frame only). It really gets on my nerves - just can see 2-3 milliseconds an empty page until the whole page appears... I'm not really familiar with Javascript neither with PhP, but I assume it's because of onload:function(). I got this code from map service from my country (http://www.karte.hr/). I've tried to change it but it didn't work and now I have absolutely no idea what to do. If it's permitted I can post a link to this web site so you can easily understand my issue. Thank you very much. Aleksandra Hi, I have an embarrassingly similar problem to the last time I was here. I have a google map that generates links and checkboxes from an xml file and puts them in a sidebar. The links open infowindows and the checkboxes show or hide lines on the map. Which all works ok. But (like last time) I have another function that puts arrowheads along those lines to indicate directionality. The code which turns the lines off and on looks like this: Code: function togglePoly(poly_num) { if (document.getElementById('poly'+poly_num)) { if (document.getElementById('poly'+poly_num).checked) { gpolys[poly_num].show(); } else { gpolys[poly_num].hide(); } } } and the sidebar creation code is like this: Code: sidebar_html += '<input type="checkbox" id="poly'+poly_num+'" checked="checked" onclick="togglePoly('+poly_num+');">' + label + '<br />'; so I was thinking that I could just call the functions that put the arrows on the lines like this, to show/hide them along with their respective lines: Code: function togglePoly(poly_num,category) { if (document.getElementById('poly'+poly_num)) { if (document.getElementById('poly'+poly_num+category).checked) { gpolys[poly_num].show(); show(category); } else { gpolys[poly_num].hide(); hide(category); } } } and change the sidebar code to this: Code: sidebar_html += '<input type="checkbox" id="poly'+poly_num+'" checked="checked" onclick="togglePoly('+poly_num+','+category+');">' + label + '<br />'; and all would be well. But all is not well - I get an error saying that my category is not defined in the sidebar_html line. If you want to see it in action, here's without trying to toggle the arrows on and off: http://xelawho.com/map/busroutes2.htm and here's the version with the category undefined error: http://xelawho.com/map/busroutes3.htm can anybody help me out here? thanks in advance. Hello everyone, I have session_start() at the begining of my home page. In my home page I'm calling a fileName.js inside my <head></head> tags. My guestion is... How do I get the session id inside fileName.js? Or is there a way to pass it to fileName.js from the home page(index.html)? Thank You in advance. Hello I have a div I want to delete any word start by /art and finish by les/ inside the div content. Here an example below : Before : PHP Code: <div id="article" class="article"> Du texte, du texte /articles sur les boucles/ du texte ... du texte. </div> After : PHP Code: <div id="article" class="article"> Du texte, du texte du texte ... du texte. </div> Thank You |