Jump to content

jeffman

Members
  • Posts

    7,761
  • Joined

  • Last visited

Everything posted by jeffman

  1. Tables are notoriously picky about innerHTML. I try never to use that property on any table element but a TD element. So that might mean deleting and creating TD elements using the deleteCell and insertCell methods. Or if you really want to do bigger chunks at a time, then some DOM methods might work, such as these and this. Maybe cloneNode could do some of the work? Without seeing more code, I cannot be sure what might be causing the 5007 error. Usually it means the object doesn't exist. Try alerting "unitstartdate"+totaltablerows to see if the + operator is not casting the values the way you expect. It might be trying to do math instead of concatenation.
  2. I know you asked about CSS, but I think your best bet is the InfiniteScroll plugin for jQuery (or Wordpress).
  3. I did not say "page." I said "script." Your page loads just fine. The script you're trying to link to doesn't load because the URL is malformed. Look at this line, which I found in your document: <script src=http://www.yourfuture2012.co.uk/futur/lib/functions.js javascript></script> The "e" is missing from /future/. The original code did not use the complete path because the script is on their own site. So you may not have noticed that when you typed or pasted the missing parts of the path that the "e" did not get carried over. It's a common mistake. You should also notice the word javascript just sitting there doing nothing. The original has a language attribute that seems not to have been pasted correctly, but a language attribute is no longer good HTML, so let's get rid of it anyway. It's not part of the problem, but we want to be virtuous. Your tag should look like this: <script src=http://www.yourfuture2012.co.uk/future/lib/functions.js type='text/javascript'></script>
  4. You can't. Confusion arose because your first post talks about passing data from one PHP file to another. That's not what you're doing. You're sending data from JavaScript running in the browser to a PHP script. Your option is to send data in a query string, or as POST data from a form, or to use AJAX. Your first idea was fine. What you didn't realize was that in the URL 'new.php?xpto', xpto is no longer a variable. It's just a string. What you need instead is a string that contains all the data. JSON is one technique that will work.
  5. I would use the same line height for all. Make it the height you want the lines to be when they wrap. Then use padding or margin at the top or bottom of #Navigator li
  6. May a suggest a different approach? Fill an array with the values you need, then shuffle it. $nums = range(1,20);shuffle($nums);
  7. Please explain in more detail. If you want to know whether the query data is arriving at your script correctly, simply write this: var_dump($_GET); Try it with no other code in the script to make sure an error isn't messing things up.
  8. You left the "e" off "future" in the URL of the script. I discovered this in Firefox by viewing your source and clicking the script's URL, which Firefox renders as a link. (A very handy feature.) What appeared was an error message. So I figured the URL was incorrect.
  9. In plugins.js, there is a section of code beginning with this line: a(window).resize(function () I'm not certain, but it looks like the code that follows does the image resizing. Why they like that better than CSS, I'm not sure.
  10. It's true that nodeValue and textContent concatenate the values of all text nodes in a node. But text nodes do exist in the object and can be accessed the old-fashioned way. You simply forgot the correct syntax. Try this echo $li->childNodes->item(0)->textContent; Of course. if you don't know the exact location of the text node, you can loop through the childNodes and test the nodeType or nodeName.
  11. To my mind, just being a block-level element makes something a container. So if you wanted to use CSS to make a span display as a block element, I guess that would make it a container also. Is there a particular problem you are trying to solve? Or did you read something in a book you want to understand more carefully? I ask because I know you want to improve your skills, and this concept seems so unimportant, you might spend your time on something better.
  12. I assume Meg refers to the widget you see at the bottom of, for example, a blog entry, which loads a limited number of comments at one time. When the last of the comments scrolls into view, the widget loads 40 more (usually via AJAX), and this goes on and on, until the user quits, or the comments run out. It's a very user-friendly way of handling a huge amount of content. If I'm correct, and this is what Meg is after, I cannot imagine a way to do it with CSS alone. You'd need to load ALL of the content into the document as it downloads but break it into sections. Most of the sections would not display until something triggers them to do so. A pseudoclass similar to :hover might work, but I'm not aware of a pseudoclass like that. If there is a CSS solution, I'd love to read about it. Maybe something that uses animation. An animated photobanner here might give you ideas. There are of course plenty of JavaScript solutions you can Google.
  13. Almost any element can be thought of as a container. I usually think an element is a contained if it displays as a block and is normally used to hold other things. I think of a div as a container. The new header and footer elements work like divs, so they are also containers in my mind. I do not usually think of a link or a list item as a container. Container is not an official word used by the W3C, so other people may have different meanings for it.
  14. 1. Since your body background is black, add a margin-top to the first div on the page. 2. Add a black background to the first div on the page. 3. Add a wide black border-top to the first div on the page. 4. Insert a black div at the top of the page. One of those should work. 1 and 3 will not allow you to have content in the black area; 2 and 4 will.
  15. I took a few seconds to look at the logo image. You probably compressed it too much. 16 colors is not a lot. One result is that the outline around the D is a bit jagged. I don't know if this caused the gray lines or not. Sometimes artifacts like that show up if you resize an image to make it larger.
  16. You'll probably want to use PHP, so test for it first. A simple script like this should confirm whether it's available: <?php phpinfo();?> That's the entire document. Name it info.php or anything else with a .php extension and try to call it from your browser. If you get an empty screen, and view source shows you the script, PHP is not on.
  17. That is correct. I opened your image in PhotoShop, and the line is there. It is difficult to see at 100% but at 600% it is very obvious.
  18. KeyHot is a global variable. If you set the value of KeyHot[27] to true, it STAYS true until your script changes it. But you gain nothing by using an array in this case. if (charCode == 27) is the only test you should need.
  19. A resource is what mysql_query returns. Look at the examples here to see how to use it.
  20. An event is something that changes the environment. Many events are caused by the user, like a click or mousemove event. Events also occur when the page stops loading, and when an image stops loading. A function is a set of instructions that get executed whenever the function is called. A function can be called when an event fires. For that to happen, your program must bind the function to the event. There are several ways to do that. You've probably seen this: function sayHello () { alert ("Hello");}document.getElementById("myButton").onclick = sayHello; // notice there are no (parentheses) used in the assignment There are other ways to bind a function to an event. element.addEventListener is the W3C standard.
  21. var inputs = document.getElementById("hurricane_damage").getElementsByTagName("input"); That will get you a collection of all inputs that are descendants of #hurricane_damage. Loop through that. Note that if you have other kinds of inputs, you'll have to test the type attribute to be sure you examine only checkboxes.
  22. I cannot duplicate this. Maybe justsomeguy has an answer
  23. jeffman

    email

    It's mostly a server-side script. It sends an email message if it receives form data. If it does not receive form data, it outputs an HTML form. HTML is not a scripting language, and there is no way to send email directly from a browser. Data must first be posted to the server, and a server-side script like this one sends the mail. Note that the example on that page exists to show you how to sanitize data before you mail it (which of course you should do). Most of the email tutorial is on the previous page. FWIW, I think it's bad practice to use the $_REQUEST superglobal as the example does. I recommend using the $_POST superglobal instead.
  24. If $_POST['price1'] is in fact a string, that should work. Try var_dump($_POST); to see exactly what data types it contains.
×
×
  • Create New...