JavaScript - Getting Safari Javascript Database To Work.
Hello,
I am trying to get the HTML 5 database that is supposed to work with safari up and running... I am following the instructions here, http://developer.apple.com/safari/li...tDatabase.html. I copied and pasted the first three code examples (to build the db, add a table to the db, and request from the db's table.) It is creating a database in my database folder (on my mac, and my iphone) but it does not create a table, and when I try to retrieve from the table, I get the message that the table doesn't exist.... Any ideas? I am lost. Similar Tutorialsok this is all hyperthetical and ground work (phishing) for me so any and advice will be warmly welcomed. I would like to start and e-commerce site BUT: I'm sure i should use javascript on client side to validate an order form BUT 1) server side, how is the order revalidated --- ie is javascript used again on server or use of another language? 2) could someone explain how information from order form is connected to an (SQL) database ---- and how is that database then updated? What language is used? (I am talking about the general process here) At the momment i'm researching SQL http://dev.mysql.com/doc/refman/5.5/...ving-data.html and e-commerce database design http://www.princeton.edu/~rcurtis/ul...mdatabase.html but I have no idea how all this is connected and where Javascript finishes and where I need to research further in oreder to put things together. Any help would be fantastic sorry for the novice questions. low tech Hi everyone, I have a javascript which used to delete object(s) when the "delete' button is clicked. The script is working fine on IE, but on Safari it do not wwork at all (when I click delete button the webpage stays the same). I think the reason is Safari is using a different javascript interpreter which cannot parse javascript developed in IE properly, such as "fireEvent". Please help me to fix the script for it to work on Safari. Here is the script: Code: function DeleteClick() { var frmSWO = document.getElementById("form"); var answer = confirm("Do you really want to delete?") if (answer != 0) { frmSWO.action = "/domsWeb/mtd/doms/web/operation/controller/manageWorkOrder/DeleteJobOrImage.do"; frmSWO.method = "post"; this.form.fireEvent('onsubmit'); frmSWO.submit(); } } I do appreciate any help. So I have made a website that you need a password to get into. The following javascript code works in Internet Explorer but, I need it to work in Safari also. Can anyone please rewrite this code, as simple as possible, to work in both Safari and Internet Explorer ? [CODE ]<!--// function mainpass() { if (pass.value=="password") {location="correct.HTML"}; else{location="wrong.HTML"}; } //--> [/CODE] Thanks in advance... I manage a private website that has a normal desktop version and also an iPhone version. Both versions use jQuery. I'm wondering if I could get some help with the iPhone version. Right now, I have one of the navigation items set up so that when it's tapped on, a submenu with more navigation items appear. This is much like the "more" menu at the iPhone version of http://www.google.com/. The problem I'm having is that once that submenu is shown, the only way to make it disappear again is to tap on one of its items. I'd like to be able to tap anywhere outside of the submenu to make it disappear. This is how the iPhone version of http://www.google.com/ behaves, so I know it's possible. The only way I can think of accomplishing this is to add a click event to the body that calls a function that removes the submenu. However, I can't get it to work. At the bottom of this post you will find code that illustrates this problem. I would really appreciate any help. Thanks! Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html lang="en"> <head> <title>Safari Mobile Test</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta name="viewport" content="width=320; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"> <style type="text/css"> body { border: 1px solid red; } </style> </head> <body> <h1>Safari Mobile Test</h1> <p><a href="#">This link doesn't go anywhere. If you click it, you will get an alert indicating that the link was clicked and a separate alert indicating that the body was clicked.</a></p> <p>In a normal web browser, clicking anywhere within the body of this page (which is surrounded by a red border) will trigger an alert indicating that the body was clicked. However, the only way to see the alert using Safari Mobile is to click on the above link.</p> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function() { $('body').click(function() { alert('The body was clicked!'); }); $('a').click(function() { alert('The link was clicked!'); }); }); </script> </body> </html> the page in question is http://martysimpson.com In firefox search the source code for Code: <script language="javascript" type="text/javascript"> <!-- function submitacajoommod1(formname) { var form = eval('document.'+formname);var place = form.email.value.indexOf("@",1);var point = form.email.value.indexOf(".",place+1); if (form.name.value == "" || form.name.value == "Name") { alert( "Please enter your name." );return false; } else if (form.email.value == "" || form.email.value == "E-mail") {alert( "Please enter a valid e-mail address." );return false; } else {if ((place > -1)&&(form.email.value.length >2)&&(point > 1)){form.submit();return true; } else {alert( "Please enter a valid e-mail address." );return false;}}} //--> </script><form action="http://martysimpson.com/component/acajoom/" method="post" name="modacajoomForm1"> I am on a mac using osx.4.11 firefox version 3.5 renders the above just fine. Safari version 3.04 just does not show the javascript at all which then makes the input fields on the sign-up for newsletter simply not show up. Any ideas? Code: function toggle(div_id) { var el = document.getElementById(div_id); if ( el.style.display == 'none' ) { el.style.display = 'block';} else {el.style.display = 'none';} } function blanket_size(popUpDivVar) { if (typeof window.innerWidth != 'undefined') { viewportheight = window.innerHeight; } else { viewportheight = document.documentElement.clientHeight; } if ((viewportheight > document.body.parentNode.scrollHeight) && (viewportheight > document.body.parentNode.clientHeight)) { blanket_height = viewportheight; } else { if (document.body.parentNode.clientHeight > document.body.parentNode.scrollHeight) { blanket_height = document.body.parentNode.clientHeight; } else { blanket_height = document.body.parentNode.scrollHeight; } } var blanket = document.getElementById('blanket'); blanket.style.height = blanket_height + 'px'; var popUpDiv = document.getElementById(popUpDivVar); popUpDiv_height=200 popUpDiv.style.top = popUpDiv_height + 'px'; } function window_pos(popUpDivVar) { if (typeof window.innerWidth != 'undefined') { viewportwidth = window.innerHeight; } else { viewportwidth = document.documentElement.clientHeight; } if ((viewportwidth > document.body.parentNode.scrollWidth) && (viewportwidth > document.body.parentNode.clientWidth)) { window_width = viewportwidth; } else { if (document.body.parentNode.clientWidth > document.body.parentNode.scrollWidth) { window_width = document.body.parentNode.clientWidth; } else { window_width = document.body.parentNode.scrollWidth; } } var popUpDiv = document.getElementById(popUpDivVar); window_width=window_width/2-150;//150 is half popup's width popUpDiv.style.left = window_width + 'px'; } function popup(windowname) { blanket_size(windowname); window_pos(windowname); toggle('blanket'); toggle(windowname); } I have know much about javascript, but the code above works fine in safari and firefox but not IE. it's for a popup, when you click a link it blankets the page and theres a popup window. here's other parts of supporting css/php Code: <?php if(!$_POST['submit'] == 'login'){ echo "<div id=\"blanket\" style=\"display:none;\"></div>\n"; echo "<div id=\"popUpDiv\" style=\"display:none;\">\n"; echo "<div id=\"loginform\">\n"; echo '<div id="close">'; echo "<a href=\"#\" onclick=\"popup('popUpDiv')\">\n"; echo '<img src="images/login/close.png" border="0">'; echo "</a>\n"; echo '</div>'; echo '<div class="clear"></div>'; echo "<form name=\"login\" method=\"post\" action=\"#\">\n"; echo "<div id=\"usernametext\">Username</div>\n"; echo "<input name=\"username\" type=\"text\" id=\"usernameinput\">\n"; echo '<div class="clear"></div>'; echo "<div id=\"passwordtext\">Password</div>\n"; echo "<input name=\"password\" type=\"password\" id=\"passwordinput\">\n"; echo '<div class="clear"></div>'; echo '<div id="loginsubmit"><input type="submit" name="submit" value="Submit"></div>'; echo "</form>\n"; echo "</div>\n"; echo "</div>\n"; echo "<span class=\"login_text\"><a href=\"#\" onclick=\"popup('popUpDiv')\">LOG IN</a></span>\n"; ?> Code: #blanket { background-color:#000000; opacity: 0.40; filter:alpha(opacity=40); position:absolute; z-index: 10; padding:0; top:0; right:0; left:0; bottom:0; width:100%; height:100%; margin:0 0 0 0; } #popUpDiv { position:absolute; background-color:#FFFFFF; width:280px; height:135px; z-index: 10; } any help would be VERY much appreciated. thanks I have an "animated slideshow" of 29 jpeg images on a page created using Javascript. It works fine in Internet Explorer and Firefox but not Safari or Chrome. The jpeg files names are 01.jpg through to 29.jpg. Here below is the code in the header and the body. There is an error in there somewhe <html> <head> <title>My webpage</title> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"> <SCRIPT language="JavaScript" type="text/JavaScript"> <!-- var speed=1333; var counter = 1; function rollPics() { document.display.src=counter+".jpg"; //Display image "counter".jpg counter ++; // Add 1 to counter if (counter>29) { // If counter is greater than 29 images then reset it counter=1 } } <!-- END --> </SCRIPT> </head> <body> <center> <table> <tr><td> <IMG NAME="display" SRC="1.jpg" onLoad="setTimeout('rollPics()',1333)"> </td></tr> </table> </center> </body> </html> I am using javascript to change the buttons on my website so that they load up a different image when hot spots on the buttons are hovered over. Everything has been working great, but this morning I tried checking out my site and for some reason the javascript wasn't working in Chrome, or on my iphone using Safari. I tried it in IE and everything still works. Any ideas on why it would stop working for those two browsers? Here is the javascript: Code: function init(){ document.getElementsByTagName('area')[0].onmouseover=function(){ document.getElementById('crocodileImg').src='Images/crocodileHover.png'; this.onmouseout=function() { document.getElementById('crocodileImg').src='Images/crocodile.png'; } } document.getElementsByTagName('area')[1].onmouseover=function(){ document.getElementById('historyImg').src='Images/historyHover.jpg'; this.onmouseout=function() { document.getElementById('historyImg').src='Images/history.jpg'; } } document.getElementsByTagName('area')[2].onmouseover=function(){ document.getElementById('applyImg').src='Images/applyHover.jpg'; this.onmouseout=function() { document.getElementById('applyImg').src='Images/apply.jpg'; } } document.getElementsByTagName('area')[3].onmouseover=function(){ document.getElementById('applyImg').src='Images/membersHover.jpg'; this.onmouseout=function() { document.getElementById('applyImg').src='Images/apply.jpg'; } } document.getElementsByTagName('area')[4].onmouseover=function(){ document.getElementById('mediaImg').src='Images/mediaHover.jpg'; this.onmouseout=function() { document.getElementById('mediaImg').src='Images/media.jpg'; } } } if(window.addEventListener){ window.addEventListener('load',init,false); } else { if(window.attachEvent){ window.attachEvent('onload',init); } } I'm not sure if seeing the html the js is referencing will help at all, but here it is just in case: Code: <div id="crocodile"> <img id="crocodileImg" src="Images/crocodile.png" usemap="#crocodileImg" border="0" width="436" height="147" alt="Home" /> <map id="crocodileImg" name="crocodileImg"> <area id="crocArea" shape="poly" coords="41,9,23,21,20,58,40,78,72,78,82,86,88,112,117,129,140,126,257,126,274,107,274,79,401,78,420,66,419,26,404,6,369,7,366,0,294,0,291,7," href="index.html" alt="Home" title="Home" /> </map> </div> <div id="history"> <img id="historyImg" src="Images/history.jpg" usemap="#historyImg" border="0" width="350" height="256" alt="Home" /> <map id="historyImg" name="historyImg"> <area id="historyArea" shape="poly" coords="18,77,18,167,48,170,79,208,124,233,174,238,228,218,257,188,266,176,280,184,306,182,338,102,331,93,271,92,254,54,226,27,196,11,169,4,137,7,109,17,82,33,65,51,52,74," href="history2.html" alt="History" title="History" /> </map> </div> <div id="apply"> <img id="applyImg" src="Images/apply.jpg" usemap="#applyImg" border="0" width="280" height="223" alt="Apply" /> <map id="applyImg" name="applyImg"> <area id="applyArea" shape="poly" coords="17,43,17,57,15,72,20,84,39,83,43,79,56,76,62,62,65,49,77,42,76,36,70,22,65,14,52,14,45,21,38,24,31,32," href="apply.html" alt="Apply" title="Apply" /> <area id="membersImg" shape="poly" coords="112,49,97,55,77,71,64,89,61,99,47,104,44,123,44,149,46,164,57,168,70,172,82,186,102,197,125,206,146,208,168,201,188,189,201,177,208,166,231,165,254,165,260,150,262,133,262,113,254,97,238,95,221,97,213,97,205,85,197,74,183,63,172,55,159,51,145,48,134,47,"href="members.html" alt="Members" title="Members" /> </map> </div> <div id="media"> <img id="mediaImg" src="Images/media.jpg" usemap="#mediaImg" border="0" width="182" height="149" alt="Media" /> <map id="mediaImg" name="mediaImg"> <area id="mediaArea" shape="poly" coords="0,102,16,103,26,117,44,129,67,133,92,128,108,115,118,102,165,102,170,88,173,65,172,52,161,49,141,49,132,42,121,42,110,30,96,22,76,16,60,14,44,18,30,29,19,36,13,48,0,51," href="media.html" alt="Media" title="Media" /> </map> </div> Thank you for any replies. Does anyone know how to make URL links that use Javascript still work when users have Javascript disabled on their browser? The only reason I'm using JS on a URL is because my link opens a PDF file, and I'm forcing it not to cache so users have the latest version. I tried the <script><noscript> tags, but I'm not sure if I'm using it correctly, as my URL completely disappears. Below is my HTML/Javascript code: <p class="download"> <script type="text/javascript">document.write("<span style=\"text-decoration: underline;\"><a href=\"javascript:void(0);\" onclick=\"window.open( 'http://www.webchild.com.au/mediakit/Direct_Media_Kit_Web.pdf?nocache='+ Math.floor( Math.random()*11 ) );\" >The Child Magazines Media Kit</a></span> (PDF 1 MB) ");</script> <noscript><span style="text-decoration: underline;"><a href="http://www.webchild.com.au/mediakit/Direct_Media_Kit_Web.pdf" >The Child Magazines Media Kit</a></span> (PDF 1 MB)</noscript> </p> Thanks for any help, Michael Hey all, 1) When clicking on a list in an accordion, it should change the quicktime movie playing in a main window area. It works in firefox but not in safari. The variable imgTitle holds the expected output (e.g. '../images/Intro-1.mov'). It changes the src attribute of the embed tag. This change works in Firefox where the new movie plays on click. However, when clicking the list item in safari, nothing happens. 2) There is a problem in firefox as well in that the movie overlays everything else on page, even though it should be behind the text. Positioning would be tedious given that there's many nested elements and I would have to set relative positioning to the entire page. Any reason for this behavior of embed tags? Code: $(".image_thumb ul li ul li").click(function(){ var imgTitle = $(this).find('a').attr("href"); var imgDesc = $(this).find('.block').html(); var imgDescHeight = $(".main_image").find('.block').height(); if ($(this).is(".active")) { return false; } else { console.log(imgTitle); $(".main_image .block").animate({ opacity: 0, marginBottom: -imgDescHeight }, 250 , function() { $(".main_image .block").html(imgDesc).animate({ opacity: 0.85, marginBottom: "0" }, 250 ); $(".main_image embed").attr({ src: imgTitle}); }); } $(".image_thumb ul li ul li").removeClass('active'); $(this).addClass('active'); return false; }) .hover(function(){ $(this).addClass('hover'); }, function() { $(this).removeClass('hover'); }); Thanks for response. hi everyone, this is my 1st post here in this community forum, just would like to say "HI" to everyone. i would like to share with you my experience in developing multiple dependency selection form developed in java script, how this script works is that when 1st selection is selected, based on the value the user select, a second level selection will appear and so on. below is the Java-script code along with my form code too Javascript: <script type="text/javascript"> function nextSelect(o) { if (o.value == '0') { var next = o.nextSibling; while (next && next.nodeName != 'SELECT') { next = next.nextSibling; } next.length = 0; return; } var d = document; var useSelect = d.getElementById(o.name + '_' + o.value); if (!useSelect) { alert('Unknown id: ' + o.name + '_' + o.value); return; } var copy = useSelect.cloneNode(true); copy.style.display = 'inline'; var next = o.nextSibling; while (next && next.nodeName != 'SELECT') { next = next.nextSibling; } next.parentNode.insertBefore(copy, next); next.parentNode.removeChild(next); } </script> my form: <div style="display: none;"> <!-- ##### First Selection ####### --> <select name="second" id="first_dp" onchange="nextSelect(this);"> <option value="0">Choose</option> <option value="dp_2_38">2 3/8'</option> <option value="dp_4">4'</option> </select> <select name="second" id="first_hw" onchange="nextSelect(this);"> <option value="0">Choose</option> <option value="hw_3_12">3 1/2'</option> <option value="hw_4">4'</option> </select> <!-- ####### 2nd Selection ####### --> <select name="third" id="second_dp_2_38" onchange="nextSelect(this);"> <option value="0">Choose</option> <option value="dp_2_38_4.85">4.85 lbs/ft</option> <option value="dp_2_38_6.65">6.65 lbs/ft</option> </select> <select name="third" id="second_dp_2_78" onchange="nextSelect(this);"> <option value="0">Choose</option> <option value="dp_2_78_6.85">6.85 lbs/ft</option> <option value="dp_2_78_10.4">10.4 lbs/ft</option> </select> >>>>>>and so on till 3rd selection<<<<<<<<< </div> <form action="pdfHandle.php" method="post" id="pdfsearch"> <fieldset> <table border="0" cellpadding="0" cellspacing="0"> <tr> <td width="142" height="146"> <p> Type:<br /> Size:<br /> Weight:<br /> </td> <td width="266"><select name="first" onclick="nextSelect(this);"> <option value="0">Choose</option> <option value="dp">Drill Pipe</option> <option value="hw">Heavy Weight</option> </select><br/> <select name="select"> </select> <br/> <select name="select"> </select> <br/> <select name="select"> </select> </td> </tr> </table> <p> <input type="submit" name="submit" id="submit" value="Create PDF" /> <input type="reset" value="Reset Selection" /> </p> </fieldset> </form> ----------------------------------------------------------------------- i would like to know what i am missing here and what is making Safari n chrome not to run this page properly, when u execute this code, only the 1st selection will appear while the rest of the selections are Null, i hope someone will guide me through this or direct me to solution or any other way of doing this perhaps i thank you for viewing this post. Hi! I'm new to JavaScript and I've done some small adjustments to my clients site, but it won't show properly in IE (the shadowbox js at least.). I thought js was accepted in all newer browsers. Do you have a quick fix or idea on why it doesn't work? You can view source on my site, I use mootools, and shadowbox/corners and rightclick blocker. Is it generally a 'bad thing' to use js in webpages I want everyone to view in the same way? I tried the same effects with CSS but it's not supported in the same way corss-browser, unfortunately. The 'no selection' CSS class I have on the site is also not accepted in IE. It's very annoying! http://santinacrolla.ihaarr.com/p thank you in advance! Hi Everyone, I have a strange problem that I can't resolve. Have a look at www.snaptease.co.uk/random.html and you will see a random image every time you refresh. Now look at www.snaptease.co.uk/random1.html and you won't see the image. The only difference is in the js/random.js and js/random1.js each file references. js/random.js uses the same html link to index.html js/random1.js links to individual html files that exist and valid. The working code looks like this: [CODE] images[0] = "<a href = 'index.html'><img src='images/games/aa01q.jpg' alt='album art' title='Do you recognise this album?'></a>";[CODE] The non working code looks like this: [CODE] images[0] = "<a href = 'answers/aa01.html'><img src='images/games/aa01q.jpg' alt='album art' title='Do you recognise this Album?'></a>";[CODE] Even if I enter the full url it makes no difference. Please tell me what I am doing wrong and how to fix it. I've been banging my head over this for a while now so I would appreciate any help. Thanks in advance Martin Hello, I made a little code for my website but it doesn't work and I can't find out what the problem is. The problem is that the line return 2; does return undefined and not 2 as expected. I also tried to replace var xmlhttp2 = ''; for var xmlhttp2 = null; but it still not work. Does anyone know what is incorrect? Thanks in advance, PHP Code: function get_image(url) { var xmlhttp2 = ''; xmlhttp2=GetXmlHttpObject() xmlhttp2.onreadystatechange=function() { if (xmlhttp2.readyState == 4) { return 2; } }; xmlhttp2.open("GET", 'image_print.php?url=' + url, true); xmlhttp2.send(null); //return output; } Hey, everyone. I wrote a JavaScript for a forum based RPG. This is the first JavaScript that I ever wrote and I was surprised that it actually worked the way it was supposed to. The problem is that when I post it in a thread on the phpBB forum, the link that says "Jump!" doesn't do anything. When I save the code to Notepad and open on my browser, the link works fine. <html> <body> <script type="text/javascript"> function calculate() { var RACE, RAND=Math.floor(Math.random()*3); RACE = document.calcform.RACE.value; if (RACE == 1 && RAND != 0) {document.write("<a href=http://desertcolossus.com/adventures/viewforum.php?f=2>Land</a>"); } if (RACE == 1 && RAND == 0) {document.write("<a href=http://desertcolossus.com/adventures/viewforum.php?f=2>Secret Area 1</a>"); } if ((RACE == 2 || RACE == 3 || RACE == 4) && RAND != 0) {document.write("<a href=http://desertcolossus.com/adventures/viewforum.php?f=3>Land</a>"); } if ((RACE == 2 || RACE == 3|| RACE == 4) && RAND == 0) {document.write("<a href=http://desertcolossus.com/adventures/viewforum.php?f=3>Secret Area 2</a>"); } if ((RACE == 5 || RACE == 6) && RAND != 0) {document.write("<a href=http://desertcolossus.com/adventures/viewforum.php?f=4>Land</a>"); }; if ((RACE == 5 || RACE == 6) && RAND == 0) {document.write("<a href=http://desertcolossus.com/adventures/viewforum.php?f=4>Secret Area 3</a>"); }; if (RACE == 7 && RAND != 0) {document.write("<a href=http://desertcolossus.com/adventures/viewforum.php?f=5>Land</a>"); }; if (RACE == 7 && RAND == 0) {document.write("<a href=http://desertcolossus.com/adventures/viewforum.php?f=5>Secret Area 4</a>"); }; if (RACE == 8 && RAND != 0) {document.write("<a href=http://desertcolossus.com/adventures/viewforum.php?f=6>Land</a>"); }; if (RACE == 8 && RAND == 0) {document.write("<a href=http://desertcolossus.com/adventures/viewforum.php?f=6>Secret Area 5</a>"); }; } </script> <form id="calcform" name="calcform"> <label for="RACE">RACE</label> <input type="text" size="3" id="RACE" name="RACE" /> <a href="javascript:calculate()">Jump!</a> </form> Enter the number associated with your character's race. 1 - Goron 2 - Sheikah 3 - Hylian 4 - Human 5 - Gerudo 6 - Zora 7 - Deku 8 - Fairy </body> </html> I write for ezinearticles, hubpages, bukisa etc. and obtained author widgets for my site. When placed in Sidebar, the w3c validator throws hundreds of errors, whereas if I place the same code in pages, it works flawlessly. Do I need some special code to put it in the sidebar? The code goes on something like this: Code: <script type="text/javascript" src="http://ezinearticles.com/widget/inc/eawidget.js"></script><script type="text/javascript" src="http://ezinearticles.com/widget/widgetfetch.php?theme=100&cheader=bb2020&cborder=d0d0d0&cbackground=f1f1f1&ctopic=f1f1f1&ctopictext=000000&ch3=bb2020&cfooter=f1f1f1&cfootertext=000000&height=400&width=315&articles=3&authorid=My Name&bio=1"></script> Can someone help me out on this? Thanks Hi, I have a javascript I created to compare the textbox value to the array and write something on the textbox but somehow it is giving me a syntax error. I am not good in javascript so I am really not sure which one is giving me problem. Can someone please help? Thanks. My logic is to check if my 18 textbox is not empty and if not then get the label of each textbox and compare to my array listed below. If the value of each label in the textbox exist, then write and equal word in the hidden textbox and if it doesn't exist, increment to the value of 1 to the textbox. Here is my javascript code: Code: function CalculateTotal(){ var homelessness = new Array (); homelessness[0] = "70250", homelessness[1] = "70260", homelessness[2] = "70750", ); var financial = new Array (); financial[0] = "96580", financial[1] = "96500", financial[2] = "96580", ); var emergency = new Array (); emergency[0] = "79660", emergency[1] = "80105", emergency[2] = "96020", ); for (i=3; i<18; i++) for (var k=3; k<18; k++) { if((amounts[i] != "") && (amounts[i] == desig[k])) { var issueId = impact.charAt(k); var impact_txt = document.getElementById(issueId).value; for ( var x = 0; x < homelessness.length; x++ ) { var myArray[ homelessness[ x ] ] = homelessness[ x ]; if ( myArray[impact_txt] == homelessness[] ) && (document.getElementById('impact1').value == "")) { document.getElementById('impact1').value = "Homelessness"; } } for ( var x = 0; x < financial.length; x++ ) { var myArray[ financial[ x ] ] = financial[ x ]; if ( myArray[impact_txt] == financial[] ) && (document.getElementById('impact2').value == "")) { document.getElementById('impact2').value = "Financial Stability and Independence"; } } for ( var x = 0; x < emergency.length; x++ ) { var myArray[ emergency[ x ] ] = emergency[ x ]; if ( myArray[impact_txt] == emergency[] ) && (document.getElementById('impact2').value == "")) { document.getElementById('impact3').value = "Emergency Crisis and Services"; } } } } } } //body code <table> <tr> <td style="width:380px;text-align:left"><label for="d" id="D" name="D" title="80104">Crime and Drug Use <a href="javascript:alert('');">what is this?</a></label></td> <td style="float:right"> $<input id="d" name="d" class="text" type="text" value="<?php safeEcho($form['d'])?>" style="width:90px;" onChange="CalculateTotal();" /> <?php helper_error('d');?> </td><td> <input name="impact1" id="impact1" type="text" value="" onclick="CalculateTotal();" /> </td> </tr> <tr> <td style="width:380px;text-align:left"><label for="e" id="E" name="E" title="80101">Early Childhood Development <a href="javascript:alert('');">what is this?</a></label></td> <td style="float:right"> $<input id="e" name="e" class="text" type="text" value="<?php safeEcho($form['e'])?>" style="width:90px;" onChange="CalculateTotal()" /> <?php helper_error('e');?> </td><td> <input name="impact2" id="impact2" type="text" value="" onclick="CalculateTotal();" /> </td> </tr> <tr> <td style="width:380px;text-align:left"><label for="f" id="F" name="F" title="80105">Emergency and Crisis Services <a href="javascript:alert('');">what is this?</a></label></td> <td style="float:right"> $<input id="f" name="f" class="text" type="text" value="<?php safeEcho($form['f'])?>" style="width:90px;" onChange="CalculateTotal()" /> <?php helper_error('f');?> </td><td> <input name="impact3" id="impact3" type="text" value="" onclick="CalculateTotal();" /> </td> </tr> Hope you can help me to make my javascript work. Thanks. Alright, so I'm trying to get Javascript to work for me on my own website, and I can't even seem to get it to work when I test the files offline. I can take an example script from the internet, copy it, and put it on my computer. From then on, the script no longer works. I try uploading the file to my webhost, and it still won't work. It's not Browser Support because I'm using the same browser I used to view the example, which worked on the website it came from. There's no differences in the code I used, as opposed to the code they used. Javascript still won't work. Can anyone explain any reason why this is? Is there some kind of extra Java Support one would need on their webhost to make JS work? One of the websites I'm trying to get my script from is this: http://sixrevisions.com/tutorials/ja...cript_tooltip/ Hi - would appreciate some help with this school project. I can't get this simple quiz to work correctly, it should give a pop-up with a pass/fail message on submit. Can anyone see the error? Instead of posting the whole code - the live version is here with all the code in the doc head... http://bit.ly/hR8JYk HTML: Code: <!-- video player begin --> <div id="playerHolder"> <div class="player" id="playerDiv"> <div id="playerwidget"></div> <div id="adCompanionBanner" style="visibility:hidden;"></div> </div> </div> In firefox, I type Code: javascript:document.getElementById("player").sendEvent(''SEEK", 0); into the Address bar and hit enter. Why doesn't it work? How do I correctly "seek" a video. |