Jump to content

Ingolme

Moderator
  • Posts

    14,901
  • Joined

  • Last visited

  • Days Won

    177

Everything posted by Ingolme

  1. I'd say your script is telling the link not to do anything by using preventDefault() and return false;
  2. Square brackets are a shorthand representation of an array. If there's nothing between them then it represents an empty array. It's equivalent to writing var result = new Array(); except it's a little more efficient in most browsers.
  3. Ingolme

    XML pointer

    I tested this code on that page and it works fine: var book = xmlDoc.getElementsByTagName("book")[2]; // Get the book you're looking for (number 2 in the list)var authors = book.getElementsByTagName("author"); // Get a list of authors of the book.var a = authors[3]; // The author you want is number 3 on the listvar name = a.firstChild; // The name is the textnode contained in the <author> elementdocument.write(name.nodeValue);
  4. The user may somehow arrive to the page without using your form, but putting the URL in the navigation bar or for some other unexpected reason. Rather than having PHP throw warnings or errors it's best to have your program prepared for unexpected cases. You might even get odd entries in your database if your script isn't prepared for these cases.
  5. Just in case you get to the file without having used the form, which can happen.
  6. Ingolme

    XML pointer

    Because I told it to write a.nodeValue instead of name.nodeValue. A simple mistake, you should look through the code and try to find these kind of mistakes yourself. It's important to understand the code instead of just copying and pasting.
  7. Ingolme

    XML pointer

    Empty text nodes are still considered text nodes. That includes line breaks between tags. You should use getElementsByTagName() to get the element you want. You also need to access the text node once you have the element. var book = xmlDoc.getElementsByTagName("book")[2]; // Get the book you're looking for (number 2 in the list)var authors = book.getElementsByTagName("author"); // Get a list of authors of the book.var a = authors[3]; // The author you want is number 3 on the listvar name = a.firstChild; // The name is the textnode contained in the <author> elementdocument.write(a.nodeValue);
  8. Ingolme

    RSS Help

    Because Chrome doesn't have a built-in RSS reader. Most browsers don't. RSS feeds are meant to be read by a reader, it's not something a browser necessarily has to do.
  9. It's very complicated. You should first learn to use PHP's GD library. After that you still need to do the thinking required to turn numbers into shapes and then tell PHP to draw the shapes. You also need to remember to write code that will draw axes and print numbers.
  10. What you actually need to do is check if the variable exists. if(isset($_POST['name']) { $name = $_POST['name'];} else { $name = '';}
  11. It looks like your web host is doing this. Maybe it's some form of advertising. By the way, <!DOCTYPE html4> is an invalid doctype declaration and will make the page run in quirks mode.For a list of proper HTML doctypes, check Common DOCTYPE Declarations here: http://w3schools.com/tags/tag_doctype.asp
  12. Ingolme

    Doctype?

    There's also this:padding: 10 10 10 20px; and this:margin:25 0px; Put units on all your CSS first and then see if the problem is still occurring. If it is, then post your updated code.
  13. Ingolme

    Doctype?

    Here's the problem: margin: 0 5 0 5; Internet Explorer lets you get away with forgetting to put units but other browsers ignore this rule altogether.
  14. Ingolme

    Doctype?

    Without seeing more I can't tell you exactly why it's behaving differently. If you set a width to the element it will be the same in all browsers. The height is determined by content. The content size depends on the font size which is set by the browser.
  15. The problem with that is that if the value changes in the database while the user is still browsing the site, the value in the session won't change until another query to the database is made.
  16. Ingolme

    Doctype?

    Any of the valid document type declarations will make the browser run in standards compliant mode. Getting it to look right in Internet explorer requires some effort from your part. It's possible that, if you're running in standards compliant mode and your elements still have different sized margins it means that some elements have the browser's default margin. Elements such as <ul>, <p> and <form> have a margin my default which may be different in different browsers. Setting them to zero or a fixed value in the stylesheet will solve that problem.In addition, in standards compliant mode, vertical margins, those that are above or below the element, are applied to the ancestors of the element that has the margin. The <p> element's default margin applies to the <div> element that contains it. If you're trying to center a block element, you need to give it a set width and then set its left and right margins to "auto"
  17. The !IE part is not necessary because other browsers don't parse those comments. That's also the reason I added the <!-- --> to each tag as well, because browsers will consider it badly formed HTML otherwise.
  18. Perhaps this:<!--[iF gt IE 6]--> Content <!--[ENDIF]-->
  19. Ingolme

    RSS Help

    What browser are you using? I know that Firefox can read RSS feeds. You need RSS reading software to use feeds. Even with a .xml extension it would work by adding it to the feed reader. You can add feeds to Google Reader.
  20. Ingolme

    Selectors- why?

    <something> isn't a valid HTML element.
  21. Ingolme

    RSS Help

    You should probably give the file a .rss extension and use .htaccess to tell the server to send it with an "application/rss+xml" Content-type header.If your server supports PHP you can give the file a .php extension and make PHP send the header: <?php header ("Content-type: application/rss+xml"); ?>
  22. The <html> tag is required as the root element of the document.The lang="en" attribute tells search engines and other devices that the text in the page is written in English.
  23. To remove horizontal spaces you'll have to put all the image tags in a row without spaces or line breaks between them: <img /><img /><img /> rather than <img /><img /><img />
  24. Perhaps the font you used isn't available to the browser. Internet Explorer doesn't have native support for SVG so you probably should stick with PNG.
  25. If it's image data, just putting the jsp file in the src of the image should work:<img src="file.jsp" alt="image">
×
×
  • Create New...