Jump to content

jeffman

Members
  • Posts

    7,761
  • Joined

  • Last visited

Everything posted by jeffman

  1. You need to save passwords on a server using an interface like PHP. It can be done without a database using a few simple file commands.
  2. I assume you mean simplexml_load_file(). That returns a simplexml element. Read about that here. It's a simple interface, so it might not do everything you want, but it's not bad.
  3. CSS does not create elements. It applies style to an element, but only if the element exists in the HTML. <header>blah blah</header>
  4. A option element does not support the change event. The select element does. The select element also has a .value property that you can test in javascript. It returns the value property of the currently selected option. FWIW, you're using a really old way of responding to events. Here's an explanation of better options. Read the whole document.
  5. You'll need to have SOME element that can always be displayed. That will be the thing users mouseover/mouseout. An element with display:none does not register mouse events.
  6. Technically, one echo statement is faster than multiples, yeah, and purists fix that. Realistically, on today's servers, the difference is almost never one you can notice.
  7. Wow. You've bent over backwards a lot more than you needed to. First problem, by default the body element has padding or margin, depending on the vendor. You should always set that to 0. In fact, most of us set the padding and margin of all elements to 0, like this: * { padding: 0; margin: 0;} That way, when you need padding or margin, set it yourself, and you know exactly what you're getting. With that fixed, don't set the width of your topbar to 100%, and don't set its position, top, or bottom AT ALL. Same with the bottom bar. See if just doing that fixes your problem.
  8. Well, it is really messy. And it's so long I really don't have time to inspect it. And I can't do a good job with that anyway, since I can't run it without your database. I do know that it parses without an error, but you already knew that. I don't see any obvious ways to clean it up. Part of me wants to combine a lot of those echo statements, but that's not a big deal. If it works, let it work?
  9. Try removing float:left from div class="allcontent" -- that works in FF and doesn't change Chrome.
  10. It's odd that you refer to a { without referring to both { and }, since they always come in pairs. Do you think you're crashing because you are mistakenly adding one brace instead of wrapping a set of statements in a pair of braces? Anyway It is technically correct to execute a single statement after a conditional (if, while, and so on) without enclosing it in braces. But it is generally not good practice. The reason is that you often end up editing your code so that multiple statements follow a conditional. In that case, you need to add the braces. And sometimes people forget. If the braces had been there from the start, adding more statements is very easy.
  11. Play with the example here. Create a textarea instead of a p . Do you know how to trigger an action with a click event? If not read this entire page. There important legacy problems to know about.
  12. FWIW, I tried loading it into a DOMDocument and also got an error. OTOH, the W3C validates it as good XML.
  13. That could be more efficient. <form name="brand"> <select data-role="slider" name="model" id="model"> <option value="sedan">sedan</option> <option value="sportster">sportster</option> </select></form> and then var kind = document.getElementById("model").value; 1. There's nothing wrong with using uppercase identifiers, but seasoned scripters use lowercase id's and camelCase variable names. 2. The dot syntax you were using technically works, but it's cumbersome if anything ever needs to be updated. I suspect you've been reading some old documentation.
  14. 1. Neither of those is a correct function definition, because you have forgotten {braces}. A function should look like this: function myFunction () { alert("Hello!");} Since document.write() was not enclosed in a function, it was executed immediately. 2. Using document.write() will overwrite your document, including your script. Everything will vanish except the text you are writing. To verify that your function is being called, use alert(). EDIT. Do you mean for the id to be #testo or #test ? In your HTML the id is test.
  15. I seem to remember having problems with old versions using element tag names as variable names.
  16. You'll have to show us some JavaScript. What worked for the radio buttons, and what you've tried for the select element. They really aren't the same. Actually, select elements are much easier.
  17. Here's the tutorial. View the second example.
  18. If the file is in XML format, you should probably use AJAX. Then navigate the DOM document using DOM methods. Populate your document dynamically. My experience is that 5000 lines can be a little slow on older machines.
  19. I'm using http://validator.w3.org . I'm assuming you posted the corrected HTML. I can duplicate the error if I replace the span elements with h7 elements, but not with p elements. I suspect the real objection to the h7 is that such an element doesn't exist. (Egg on my face!) Headers go from h1-h6. I'm not sure why it didn't just say that. And as I said, I did not get an error when I replaced the h tags with p tags. FWIW, if you are using all those <br> elements to create space, you might consider using CSS margins or padding instead.
  20. You should post more HTML, or provide a link. We might have to see a lot of it to see what the "context" is. Normally a p is allowed in a div. I suspect the p is wrapped in an inline element like an <a> or a <li> or something similar. I don't know why the error refers to the div, though. Seeing more HTML would be helpful.
  21. YesAre they in a folder called portfolio_archivos? I don't recommend it. Look at the source code it generates. It's needlessly complicated, and the CSS is hard to edit.
  22. Omit the language attribute (language="JavaScript") not the script. H elements should come outside div elements. Divs hold content. A header is not content. It labels content. If you are using an H element for something that is not a header, put the text in a text container (like a p or a span) and style it with CSS instead.
  23. FWIW, Google found some old references indicating that window.open was supported by IE 3 and Netscape 3. That's roughly 1996. IE 3 was the first version of IE to include JavaScript. I wish I still had some of my first textbooks on this stuff.
×
×
  • Create New...