Jump to content

davej

Moderator
  • Posts

    3,988
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by davej

  1. I was noticing that it is sometimes not so easy to find the relevant reference page. You search, you find the tutorial, so then you look at the tutorial, but it leaves out some details, so then you need to find the reference page. For example, this page; http://www.w3schools.com/js/js_popup.asp Should include these three links; http://www.w3schools.com/jsref/met_win_alert.asphttp://www.w3schools.com/jsref/met_win_confirm.asphttp://www.w3schools.com/jsref/met_win_prompt.asp
  2. If you need to essentially automate a browser you might look at... http://seleniumhq.org/
  3. Why is it that sometimes I have a try-catch that doesn't seem to work? In the code below I was trying to compare onerror and try-catch, but the try-catch doesn't even fire. Also why is it that I can find the tutorial on JS try-catch but I can't find the reference section? Thanks. <html><head><script type="text/javascript">//window.onerror=processErrors;window.onload = function() {$('btn1').onclick = fnBtn1;}function processErrors(msg, url, line){alert('Javascript Error: '+msg+'\nURL: '+url+'\nLine Number: '+line)return true}function fnBtn1() {alert('input button clicked');}function $(id){return document.getElementById(id);}</script></head><body><input type="button" id="btn1" value="Input"/><script type="text/javascript">try{alert('bottom of form';}catch(err){alert('try-catch error:' + err.name + ':' + err.message);}</script></body></html> Re: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Error
  4. Why are most of the double-quotes escaped?
  5. I'm beginning to have some fun with goofy little ideas like this. JS is so quick and easy it reminds me of the old days with interpreted BASIC. <html><head><title>Calc</title><style type="text/css">body {width: 300;margin: 0 auto;text-align: center;}img {border:10px groove gray;}#out {text-align: right;}#err {color: red;}</style><script type="text/javascript">window.onload=function(){$("btn1").onclick=fn1;$("btn2").onclick=fn1;$("btn3").onclick=fn1;$("btn4").onclick=fn1;$("btn5").onclick=fn1;$("btn6").onclick=fn1;$("btn7").onclick=fn1;$("btn8").onclick=fn1;$("btn9").onclick=fn1;$("btn0").onclick=fn1;$("clr").onclick=fnClr;init();}function fn1(event){var elem=event.target;var txt=$("out").value;$("out").value = txt + elem.value;}function fnClr(){$("out").value = "";$("err").innerHTML = "";}function $(id){return document.getElementById(id);}function init(){$("out").value = "";$("err").innerHTML = "";}</script></head><body><h1>Calculator</h1><img src="http://www.hrsolutionsinc.com/engagementcalculator/calculator.jpg"width="100" alt="Logo"/><br/><br/><input type="text" id="out"/><hr/><button id="btn1" value="1">1</button><button id="btn2" value="2">2</button><button id="btn3" value="3">3</button> <button id="clr">C</button><br/><button id="btn4" value="4">4</button><button id="btn5" value="5">5</button><button id="btn6" value="6">6</button> <button id="clr">=</button><br/><button id="btn7" value="7">7</button><button id="btn8" value="8">8</button><button id="btn9" value="9">9</button> <button id="btn0" value="0">0</button><br/><hr/><button id="add">+</button><button id="sub">-</button><button id="mul">*</button><button id="div">/</button><br/><br/><div id="err"></div></body></html>
  6. davej

    Frames?

    So I'm guessing that several iframes could be styled to look just like frames, but at least there would be <body></body> tags. http://www.w3schools.com/Html/html_iframe.asp
  7. davej

    Constants?

    If you have several JSP pages or servlets that need the same bit of information, such as a filepath, how do you handle that? I realize globals are generally frowned upon, so what is usually done? Thanks.
  8. Windows phones? I thought it was Android (Java) vs. Apple (Objective C)?
  9. Well, it works just fine, but the page looks like something from 1998. I would think that a page produced today should at least be XHTML and use CSS. Maybe I am just biased against UPPERCASE. http://www.w3schools.com/html/html_xhtml.asphttp://www.w3schools.com/css/default.asp
  10. davej

    Frames?

    I always hated websites with frames, and I thought that the usage of frames was dying out, but I keep seeing people using them. What is the story? Are frames dead, despised, and obsolete? Thanks.
  11. I will have to try again. I could not get it to work, but then I am getting rusty on SQL.
  12. Both of my ideas seem to work also. I have not yet delved into jQuery so that approach is still a mystery to me. <html><head><title>modified innerHTML tabber</title><script type="text/javascript">var text1;var text2;var text3;window.onload = function(){hide();document.getElementById("btn1").onclick = load1;document.getElementById("btn2").onclick = load2;document.getElementById("btn3").onclick = load3;}function hide() {try{text1 = document.getElementById("text1").innerHTML;text2 = document.getElementById("text2").innerHTML;text3 = document.getElementById("text3").innerHTML;document.getElementById("text2").innerHTML = "";document.getElementById("text3").innerHTML = "";document.getElementById("btn1").href = "#top";document.getElementById("btn2").href = "#top";document.getElementById("btn3").href = "#top";}catch (err){alert('error:' + err.message);}}function load1(){document.getElementById("text1").innerHTML = text1;}function load2(){document.getElementById("text1").innerHTML = text2;}function load3(){document.getElementById("text1").innerHTML = text3;}</script><style type="text/css"> .container {width:960px; margin: 0 auto; background-color:#9999FF; border: 1px solid #9999FF;}.side_menu { width: 200px; float: left; margin-top: 10px;}.side_menu ul, .side_menu li {padding:0; margin:0; text-indent:0; list-style-type: none;}.side_menu a {display: block; background-color: navy; color: white; height: 30px; line-height: 30px; padding: 0 10px; border:1px solid #fff; text-decoration:none;}.side_menu a:hover { background-color:#3366FF; text-decoration:underline;}.content { margin-left:200px; background-color:#FFF; overflow: hidden; margin: 10px 10px 10px 210px;}.content div, .content h1{ margin:10px;}.footer { background-color:#330099; color: #FFF; text-align:center; height: 100px;}.footer p {line-height: 100px;}</style></head><body><a name="top"></a><div class="container"><div class="side_menu"><ul><li><a href="#text1" id="btn1">Button1</a></li><li><a href="#text2" id="btn2">Button2</a></li><li><a href="#text3" id="btn3">Button3</a></li></ul></div><div class="content"><h1>My Content</h1><div id="text1"><h2>Button1 Content</h2> <p>Velit esse cillum dolore eu fugiat nulla pariatur. In reprehenderit in voluptate cupidatat non proident, excepteur sint occaecat. Mollit anim id est laborum.</p> <p>Quis nostrud exercitation sunt in culpa in reprehenderit in voluptate. Ut aliquip ex ea commodo consequat. Sed do eiusmod tempor incididunt duis aute irure dolor cupidatat non proident. Lorem ipsum dolor sit amet, qui officia deserunt eu fugiat nulla pariatur. In reprehenderit in voluptate.</p> <p>Lorem ipsum dolor sit amet, ullamco laboris nisi quis nostrud exercitation. Duis aute irure dolor cupidatat non proident, sed do eiusmod tempor incididunt. In reprehenderit in voluptate eu fugiat nulla pariatur.</p> <p>Ut aliquip ex ea commodo consequat. Duis aute irure dolor excepteur sint occaecat mollit anim id est laborum. In reprehenderit in voluptate quis nostrud exercitation sunt in culpa. Qui officia deserunt ut enim ad minim veniam. Quis nostrud exercitation in reprehenderit in voluptate velit esse cillum dolore.</p> <p>Duis aute irure dolor cupidatat non proident, sunt in culpa. Eu fugiat nulla pariatur. Ut aliquip ex ea commodo consequat.</p> <p>Lorem ipsum dolor sit amet, ullamco laboris nisi quis nostrud exercitation. Duis aute irure dolor cupidatat non proident, sed do eiusmod tempor incididunt. In reprehenderit in voluptate eu fugiat nulla pariatur.</p></div><div id="text2"><h2>Button2 Content</h2> <p>Id quod maxime placeat facere possimus, accusantium doloremque laudantium, et expedita distinctio. Dicta sunt explicabo. Quis nostrum exercitationem quia voluptas sit aspernatur ###### soluta nobis est eligendi optio. Ullam corporis suscipit laboriosam, ut enim ad minima veniam, dicta sunt explicabo. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias sed ut perspiciatis unde omnis.</p> <p>Qui in ea voluptate qui ratione voluptatem sequi nesciunt. Consequatur aut perferendis doloribus asperiores repellat. Sed quia non numquam eius modi dicta sunt explicabo. Et expedita distinctio. Eaque ipsa quae ab illo inventore veritatis id quod maxime placeat facere possimus, consectetur, adipisci velit.</p> <p>Quia voluptas sit aspernatur accusantium doloremque laudantium, sed quia consequuntur magni dolores eos. Vel illum qui dolorem eum fugiat dicta sunt explicabo. Iste natus error sit voluptatem id quod maxime placeat facere possimus, cumque nihil impedit quo minus. Quis nostrum exercitationem sed ut perspiciatis unde omnis aut odit aut fugit.</p> <p>Iste natus error sit voluptatem saepe eveniet ut et voluptates repudiandae sint dicta sunt explicabo. Neque porro quisquam est.</p> <p>Sed ut perspiciatis unde omnis ut enim ad minima veniam, omnis voluptas assumenda est. Id quod maxime placeat facere possimus, qui ratione voluptatem sequi nesciunt. Quia voluptas sit aspernatur neque porro quisquam est, similique sunt in culpa qui officia deserunt mollitia animi.</p></div><div id="text3"><h2>Button3 Content</h2> <p>Building a dynamic relationship between the main players. Organizations capable of double-loop learning, motivating participants and capturing their expectations, exploitation of core competencies as an essential enabler. That will indubitably lay the firm foundations for any leading company an important ingredient of business process reengineering empowerment of all personnel, not just key operatives. Combined with optimal use of human resources, to focus on improvement, not cost, by moving executive focus from lag financial indicators to more actionable lead indicators.</p> <p>Building a dynamic relationship between the main players. As knowledge is fragmented into specialities an investment program where cash flows exactly match shareholders' preferred time patterns of consumption building flexibility through spreading knowledge and self-organization. Benchmarking against industry leaders, an essential process, should be a top priority at all times organizations capable of double-loop learning, highly motivated participants contributing to a valued-added outcome.</p> <p>By moving executive focus from lag financial indicators to more actionable lead indicators, in order to build a shared view of what can be improved, their expectations.</p> <p>To ensure that non-operating cash outflows are assessed. As knowledge is fragmented into specialities quantitative analysis of all the key ratios has a vital role to play in this benchmarking against industry leaders, an essential process, should be a top priority at all times. Motivating participants and capturing their expectations, whenever single-loop learning strategies go wrong, maximization of shareholder wealth through separation of ownership from management. To ensure that non-operating cash outflows are assessed.</p></div></div><div class="footer"><p>Umm I would be the footer</p></div></div></body></html> and the alternative <head> is this... <head><title>modified style.display tabber</title><script type="text/javascript"> window.onload = function(){hide();document.getElementById("btn1").onclick = load1;document.getElementById("btn2").onclick = load2;document.getElementById("btn3").onclick = load3;}function hide() {try{document.getElementById("text2").style.display = "none";document.getElementById("text3").style.display = "none";document.getElementById("btn1").href = "#top";document.getElementById("btn2").href = "#top";document.getElementById("btn3").href = "#top";}catch (err){alert('error:' + err.message);}}function load1(){document.getElementById("text1").style.display = "block";document.getElementById("text2").style.display = "none";document.getElementById("text3").style.display = "none";}function load2(){document.getElementById("text1").style.display = "none";document.getElementById("text2").style.display = "block";document.getElementById("text3").style.display = "none";}function load3(){document.getElementById("text1").style.display = "none";document.getElementById("text2").style.display = "none";document.getElementById("text3").style.display = "block";}</script><style type="text/css"> .container {width:960px; margin: 0 auto; background-color:#9999FF; border: 1px solid #9999FF;}.side_menu { width: 200px; float: left; margin-top: 10px;}.side_menu ul, .side_menu li {padding:0; margin:0; text-indent:0; list-style-type: none;}.side_menu a {display: block; background-color: navy; color: white; height: 30px; line-height: 30px; padding: 0 10px; border:1px solid #fff; text-decoration:none;}.side_menu a:hover { background-color:#3366FF; text-decoration:underline;}.content { margin-left:200px; background-color:#FFF; overflow: hidden; margin: 10px 10px 10px 210px;}.content div, .content h1{ margin:10px;}.footer { background-color:#330099; color: #FFF; text-align:center; height: 100px;}.footer p {line-height: 100px;}</style></head>
  13. Is it true that there is no way to do this without javascript? Css can do something like this with hover, for something like a drop-down menu, but only for the period of time of a hover, right?
  14. Well, I see the onerror event listed here... http://www.w3schools...m_obj_event.asp And I see a rather nifty javascript error detection example here... http://www.javascrip...rs/error3.shtml But I have not been able to get a missing HTML tagged image to fire this error. Oh my! Google turns up lots of stuff... https://www.google.com/#hl=en&sclient=psy-ab&q=javascript+detect+missing+image&oq=javascript+missing+image+&aq=0b&aqi=g-b1&aql=&gs_l=hp.1.0.0i8.1952l7875l0l11143l25l15l0l10l10l1l186l1522l10j5l25l0.frgbld.&pbx=1&bav=on.2,or.r_gc.r_pw.r_qf.,cf.osb&fp=f23c61bd7e89fd45&biw=1080&bih=610
  15. Well, I am not having much luck with percent, and what I have seems fragile... and I'm just looking at Firefox. <html><head> <title>stutt 3</title><style type="text/css">body {color:#333333;font-family: Arial, Helvetica, sans-serif;font-size:12px;font-style:normal;font-weight:normal;margin: 6px 0 0 5px;}a {font-family:Arial,Helvetica,sans-serif;font-size:12px;font-style:normal;text-decoration: underline;font-weight: normal;}div#header {position: relative;height: 100px;}div#navMenu { width: 860px; margin:0; clear: both;}div#navMenu ul { margin:0; padding:0; line-height:30px;}div#navMenu li { list-style:none; float:left; position:relative; background:#E98A25;}.navul { width: 860px;}div#navMenu ul li a { text-align: center; height: 30px; min-width: 90px;/* */ overflow-x: visible; padding-left: 10px; padding-right: 10px; display: block; color: #000; font-family: Arial,Helvetica,sans-serif; font-size:13.5px; font-weight:bold; text-decoration:none; color:black; border: 2.3px solid #F6F6F6;}#navMenu ul ul { position: absolute; visibility: hidden; top:32px;}#navMenu ul li:hover ul { visibility: visible; z-index:9999;}/**********************************************//*sets top level hover color*/#navMenu li:hover { background:#3377FF; color:#000;}/*sets link items hover color and background*/#navMenu ul li:hover ul li a:hover { color:#000; background:#3377FF;}/* Changes text color on hover for main menu hover*/#navMenu a:hover { color:#000;}/* IE7 Display Fix */ #navmenu ul li { display: inline; }/* IE7 Display Fix */ #navmenu ul li { display: inline; } div#container {text-align: left;width: 860px; /* increased width to accomodate more space b/n content and sidebar */margin: 0 auto; /* had margin spelled as marginn */}h1 { text-align: center;color:#E98A25;font-family: Arial, Helvetica, sans-serif;font-size:28px;font-weight:bold;line-height:120px;margin:10px 24px;}ul li { color: #E98A25;list-style-type: square;margin-left: 0px;padding-left: 0px;}</style></head><body><div id="container"><div id="header"> <h1>National Stuttering Association Austin Chapter</h1></div><!--End of header --><div id="navMenu"> <ul class="navul"> <li><a href="#">Home</a></li> <li><a href="#">About Us</a> <ul> <li><a href="#">Our Very Long History</a></li> <li><a href="#">Our Mission</a></li> <li><a href="#">Member Bios from ######</a></li> <li><a href="#">Donate</a></li> </ul> </li> <li><a href="#">Meetings</a> <ul> <li><a href="#">Adult Chapter</a></li> <li><a href="#">Kids Family</a></li> <li><a href="#">Teen TWIST 1234567890 0123</a></li> <li><a href="#">Chattooga 1234567890</a></li> <li><a href="#">Maps</a></li> </ul> </li> <li><a href="#">Testimonials</a></li> <li><a href="#">NSA</a> <ul> <li><a href="#">A1</a></li> <li><a href="#">A2</a></li> <li><a href="#">A3</a></li> </ul> </li> <li class="top"><a href="#">Membership</a></li> </ul><!-- end navul --> <br class="clearFloat" /></div> <!-- end navMenu --> </body></html>
  16. What if you simply used .innerHTML to load an entire div worth of stuff? That would be very straightforward but I don't know how long a javascript string can be or how slow the loading process would be. Or what about the css style display:none ? I've never messed with it.
  17. I simplified it down to the following example case. You want the menu block width to auto-size to the width of the total menu and the text to wrap inside the menu blocks? <html><head> <title>National...</title> <style type="text/css">body { color:#333333; font-family: Arial, Helvetica, sans-serif; font-size:12px; font-style:normal; font-weight:normal; margin: 6px 0 0 5px;}a { font-family:Arial,Helvetica,sans-serif; font-size:12px; font-style:normal; text-decoration: underline; font-weight: normal;}div#header { position: relative; height: 100px;}div#navMenu { width: 860px; margin:0; clear: both;}div#navMenu ul { margin:0; padding:0; line-height:30px;}div#navMenu li { list-style:none; float:left; position:relative; background:#E98A25; }.navul { width: 860px; }div#navMenu ul li a { text-align:center; height: 30px; width: 130px; display:block; color:#000; font-family:Arial,Helvetica,sans-serif; font-size:13.5px; font-weight:bold; text-decoration:none; color:black; border: 2.3px solid #F6F6F6;}#navMenu ul ul { position:absolute; visibility:hidden; top:32px;}#navMenu ul li:hover ul { visibility:visible; z-index:9999;} /**********************************************/ /*sets top level hover color*/ #navMenu li:hover { background:#3377FF; color:#000;} /*sets link items hover color and background*/ #navMenu ul li:hover ul li a:hover { color:#000; background:#3377FF;} /* Changes text color on hover for main menu hover*/ #navMenu a:hover { color:#000;} /* IE7 Display Fix */ #navmenu ul li { display: inline; } /* IE7 Display Fix */ #navmenu ul li { display: inline; } div#container { text-align: left; width: 860px; /* increased width to accomodate more space b/n content and sidebar */ margin: 0 auto; /* had margin spelled as marginn */ }h1 { text-align: center; color:#E98A25; font-family: Arial, Helvetica, sans-serif; font-size:28px; font-weight:bold; line-height:120px; margin:10px 24px; }ul li { color: #E98A25; list-style-type: square; margin-left: 0px; padding-left: 0px;} </style></head> <body> <div id="container"> <div id="header"> <h1>National Stuttering Association Austin Chapter</h1></div><!--End of header --> <div id="navMenu"> <ul class="navul"> <li><a href="#">Home</a></li> <li><a href="#">About Us</a> <ul> <li><a href="#">Our History</a></li> <li><a href="#">Our Mission</a></li> <li><a href="#">Member Bios</a></li> <li><a href="#">Donate</a></li> </ul> </li> <li><a href="#">Meetings</a> <ul> <li><a href="#">Adult Chapter</a></li> <li><a href="#">Kids/Family</a></li> <li><a href="#">Teen/TWIST</a></li> <li><a href="#">"Chat"</a></li> <li><a href="#">Maps</a></li> </ul> </li> <li><a href="#">Testimonials</a></li> <li><a href="#">NSA</a> <ul> <li><a href="#">A1</a></li> <li><a href="#">A2</a></li> <li><a href="#">A3</a></li> </ul> </li> <li><a href="#">Membership</a></li> </ul> <!-- end navul --> <br class="clearFloat" /> </div> <!-- end navMenu --> </body></html>
  18. Would it be possible for Javascript to test the links in a page to see if they are still valid?
  19. <script type="text/javascript">var d = new Date();var t = d.getTime();alert(t);t = d.getTime();alert(t);t = d.getTime();alert(t);</script> So apparently getTime retrieves a constant value that is created when the Date object is instantiated, or is there some trick to this? http://www.w3schools.com/jsref/jsref_gettime.asp
  20. I saw an interesting question a few days ago. They had a table with a compound primary key and they wanted to select the MAX() entries for each category. So the table was like... dept CHAR(6),project_no INT,description CHAR(15),manager CHAR(15)CONSTRAINT PRIMARY KEY(dept, project_no) They wanted to find the highest project_no in each department. --Edited: Corrected the example.
  21. davej

    Noscript?

    I noticed the other day that my noscript message didn't seem to work on my PHP page. Why is that? Thanks. http://www.w3schools.com/tags/tag_noscript.asp
  22. Since the forum search isn't working could it be replaced with a work-around using a link to (site specific) google search? (or would this simply increase the monthly problem of bandwidth exceeded?)
  23. You are saying you have a billing system program but you want something else to enter the text into the fields of the billing system program? The billing system program is a compiled program and not a program that currently uses a browser? Does the billing system program save this data in a standard database?
  24. Seems like each forum should have a sticky for these two lists.
  25. Has anyone here used the Microsoft documented webcam features that are listed here? I am looking at some Logitech webcam information and was referenced to this material. http://msdn.microsof...y/ff567802.aspx or http://msdn.microsof...y/dd389145.aspx The Logitech document was: http://www.filedropper.com/logitechuvcdriverpublicpropertysets
×
×
  • Create New...