Jump to content

jesh

Members
  • Posts

    2,293
  • Joined

  • Last visited

Everything posted by jesh

  1. jesh

    CSS Clip

    Every once in awhile I branch out and try new things. Today, the new thing is a photo album viewer control.In the process of doing this, I thought that the clip property in CSS would work PERFECTLY for what I was trying to do - namely, hide some content behind a little view window. However, I can't get it to do anything. Anyone have any luck using the CSS clip property?I've tried placing the style on the div and I've tried placing it on the img. I've tried specifying a width/height for the div that is greater than that of the img and I've tried specifying a width/height for the div that is less than that of the img. I've also tried setting the overflow to "hidden" on the div and I've tried using positioning. Nothing seems to work.Here is my code sample, can anyone get it to clip the image? <html><head><style type="text/css">#Clipper { clip: rect(10px, 40px, 40px, 0px); }</style></head><body><div id="Clipper"><img src="http://www.w3schools.com/images/w3default80.jpg" /></div></body></html>
  2. jesh

    Linefeed in XML

    I would attempt to solve it in the display layer. If you were displaying this on a web page, you could specify that the containing element for the information be only, say, 200px wide. This would force the text to wrap somewhere in the middle of the information.I don't work much with XML these days, I'm sure someone else has a better solution for you. Maybe this link will help: http://www.xml.com/pub/a/2001/11/07/whitespace.html
  3. Nice link justsomeguy! That'll come in handy.
  4. A tracert dies at nwmn-asr2.eastlink.ca [24.215.102.150] with a "Destination host unreachable."
  5. jesh

    Add values together

    Thanks! Obviously, in the table provided it didn't matter since all records had "Fish" in the Stock column, but going forward, I would assume more Stock items would be added.
  6. jesh

    Add values together

    I would only add: SELECT SUM(Quantity) AS 'Number of Fish'FROM INVENTORY WHERE Stock = 'Fish'
  7. jesh

    Image onLoad

    I don't know about fontcolor and fontsize, I've never used them. You're better off using the HTML DOM if you want to affect the style of an element. Something like this: var mydiv = document.getElementById("mydivid");mydiv.style.color = "#cc0000";mydiv.style.fontSize = "11px"; Or: var mydiv = document.getElementById("mydivid");mydiv.className = "Red"; // this is the name of a css class
  8. I tried PINGing you and it returned an IP address but the requests timed out. So it doesn't look like a DNS issue.
  9. When you have a form with only a single text field and the focus is in that text field, when the user hits ENTER, the form is submitted.Check out this Google search for more information.
  10. It has to be because of what aspnetguy suggested earlier. If your tags_table array has 5 elements (0,1,2,3, and 4), you're attempting to run your for loop from 0 through 5 (inclusive) and that breaks your script. If you are testing this in Firefox and you open the JavaScript Console under the Tools menu, you should see an error telling you something like "tags_table has no properties" and your script dies.Get rid of the "<=" in your for loop.
  11. jesh

    Image onLoad

    For the most part - with the exception of getElementById which probably ought to be getElementByID - javascript uses lowerCamelCase for all methods such as "indexOf", "setTimeout", "getUTCMonth", etc. For events, it uses lowercase. Every programming language I've come across has these little idiosyncrasies that you just have to get used to.
  12. jesh

    Image onLoad

    Here's a list of events: http://www.w3schools.com/jsref/jsref_events.aspLike this list, I always use lowercase for events in javascript.
  13. jesh

    CSS Vertical Aligment

    Try using line-height: .mainMenu ul li a { color:#000000; text-decoration:none; background: #FFFFFF; display: block; margin: 2px; padding: 0 0 0 3px; border: 1px solid #000000; height: 20px; line-height: 20px; text-align: center;}
  14. jesh

    Linefeed in XML

    You don't want to put <br /> in with your XML, it's just not good practice.If you are trying to display line breaks after each element, maybe you could do that in your javascript. Rather than: document.getElementById("IS").innerHTML = xmlDoc.getElementsByTagName("englisch1")[0].childNodes[0].nodeValue; Try: document.getElementById("IS").innerHTML = xmlDoc.getElementsByTagName("englisch1")[0].childNodes[0].nodeValue + "<br />"; Otherwise, you might want to look into the XSL tutorials.
  15. If your HTML looked something like this: <select id="state" onchange="CheckState(this);"> <option value="OR">Oregon</option> <option value="FL">Florida</option></select><input type="checkbox" id="FloridaBox" style="display: none;" /> You could have javascript like this: function CheckState(obj){ if(obj.value == "FL") { document.getElementById("FloridaBox").style.display = "block"; } else { document.getElementById("FloridaBox").style.display = "none"; }}
  16. jesh

    If and combinations

    What if, instead, you dynamically built the WHERE part of your SQL query based on the values of the form?Since I don't know VB, here is the idea using javascript var wherestring = "";if (date1 != "" && date2 != ""){ wherestring = "company_date BETWEEN " + date1 + " AND " + date2;}if (company != ""){ if (wherestring != "") { wherestring += " AND "; } wherestring = "company = '" + company "'";} Then, when you build your SQL query, you'd do something like this: sql = "SELECT * FROM tblcompany"if (wherestring != ""){ sql += " WHERE " + wherestring;}
  17. It's because browsers parse the code from the top of the page down to the bottom of the page. If you have some javascript that attempts to access an object that the browser hasn't seen yet, your script won't function as you might expect it to. This is why you have to either use the onload event to run the script after the page loads or put the script down at the bottom of the page just before the </body> tag.
  18. Try: document.getElementById("tp").checked == true For more info, check out the tutorial.
  19. What happens if you just visit your ASP page (gethint.asp) in your browser by typing in the address in the address bar? Do you see "no suggestion"? What happens if you visit "gethint.asp?q=ci", do you see "Cinderella"? Or, when you do these tests, are you only seeing your ASP code?
  20. The information from 5,000 to 50,000 customers will be entered into that form between the times that you are able to import the data into your Excel spreadsheet? Is there a reason you aren't using a database like MySQL or SQL Server?
  21. But this won't: <script>var as = document.getElementsByTagName("td")for(i=0;i<as.length;i++){ as[i].style.padding="10px"}</script><table border="1"> <tr> <td>This</td><td>will</td><td>all</td><td>be</td><td>the same</td> </tr></table>
  22. Are you calling that javascript before or after the browser has parsed through the file and built the DOM?
  23. If you plan on doing this through a browser, you're most likely going to have to use an <input type="file" /> element in your form to allow the visitor to upload a file to your server. This is the only way that I know of to allow a visitor to browse files on his/her computer.Then, once the file is uploaded (i.e. the form is submitted), you'll have to open it and render the contents to the textarea. This would require a round trip from the client to the server and back.To ease page loading, you might consider an AJAX solution. You could capture an onchange event for the <input type="file" /> which could automatically attempt to POST the file to your server. Then the response could be the text value of the file which you could use the HTML DOM to change the value of the textarea.
  24. Ahh, good to know. Like I said, I don't use dynamic functions like that very often.
  25. Ahh, I had just thought of that too. Something like this might also work:chart[0] = eval(i);
×
×
  • Create New...