Jump to content

Ingolme

Moderator
  • Posts

    14,897
  • Joined

  • Last visited

  • Days Won

    176

Everything posted by Ingolme

  1. It can't be fixed without forcing the input to lose focus.The best way to do that is to move the focus to another element that you're sure won't be under the box. Choose your element and then, when the mouse hovers over the box set the focus of that element using the focus() method: element.focus() where "element" is a reference to the element you want to focus. The less efficient solution would be to loop through every single <input> element can call the blur() method instead.
  2. The normal approach is to use a server-side language to include the variable part of the content. The most popular language is PHP. In PHP the page would look something like this: <?php// Select content based on queryif(isset($_GET['p'])) { switch($_GET['p']) { case 'about': $title = 'About Us'; $content = 'includes/about.php'; break; ... }}?><html><head> <title><?php echo $title; ?></title></head><body>-- Header ---- Menu --<?php include $content; ?>-- Footer --</body></html> Please check the W3Schools PHP tutorial first and if you still don't understand ask questions here.
  3. You should have checked the error console, look at this: SyntaxError: missing ) after argument list}};
  4. You're working with XSL? In XSL you can create the image like this: <xsl:element name="img"> <xsl:attribute name="src"> <xsl:value-of select=" ... selector here ..." /> </xsl:attribute> <xsl:attribute name="alt">Alternate text</xsl:attribute></xsl:element> In PHP, using variables in HTML attributes just means printing their value along with the HTML. echo '<img src="' . $value . '" alt="alt">';
  5. That looks like it will work. The page would "blink" (refresh) under either of the following conditions: The button is a link, which isn't the case since you're using the selector for a <button> element. The button is inside a form and is considered a submit button. If your button is inside a form then remove the form. If you have other event handlers assigned to the button or elements in the page, show it. It would also be helpful to see the HTML of the page.
  6. To slow down an animation you need to add more frames. It's easy if you're using a motion tween.
  7. The sample you're showing from TDResponse doesn't look at all like XML, it's not a surprise that the parser doesn't like it. Actually, it sounds like you're not looking at its actual value. Use htmlspecialchars() to see its real content: echo htmlspecialchars($TDResponse);
  8. The <meta> tag only works on the current window. In HTML you just put the Javascript between <script> tags and it will work.
  9. $page_title doesn't have a value. Like I told you, when the function stops running the variables in it are destroyed, including $page_title.If you take that code out of the function then it will work.
  10. You need to use an XML DOM library to add, edit and remove nodes to the document. PHP's DOMDocument is almost identical to Javascript's XML DOM API so I recommend reading the XML DOM tutorial and then studying PHP's DOMDocument extension
  11. Ingolme

    Valid number?

    Perhaps it's validation before passing to the server-side. PHP casts to numbers using the same rules as Javascript using (int) or intval(), (float) or floatval()
  12. An ID should only be used on one element of the document. I don't know how jQuery will behave if more than one element has the same ID, you should use a class name.
  13. If you show the value that's in $TDResponse we can figure out what the problem is.
  14. If $TDResponse is empty then there's the problem. You're not getting data. I recommend removing the @ error suppressing operator so you can see why you're getting the wrong data.
  15. Ingolme

    Valid number?

    A regular expression would, which is what I provided earlier.
  16. Ingolme

    Valid number?

    That should work. However, if x is "5abc" it will evaluate to 5 and be a number. If you're fine with that then your script is OK.
  17. Return is what the function gives back to the caller.When you call a function and assign it to a variable the return value is what the variable will contain. function sum(a, { return (a + ;}var X = sum(5, 3);alert(X) // Displays "8"
  18. It means that $page_title is local to the function and can't be read from outside.After that function is executed, if $page_title was undefined it will continue to be undefined. I believe global &$page_title will fix that, though I don't think a function is necessary to check the variable in the first place.
  19. Have you checked that $TDResponse has the value you expected it to have?
  20. The global keyword creates a copy of the variable, not a reference to the variable itself.
  21. Ingolme

    Valid number?

    The point of Number() isn't to validate numbers, but to cast to a number.When casting to number, as long as the first character is numeric it is considered a number and it will continue to parse until it finds a non.numeric character. Now that I think of it, NaN is never equal to another NaN. The only way to check that a "number" is not a number is to use isNaN().
  22. You don't need any certificates at all to make money from web development. There's nothing illegal about that.
  23. W3Schools certificates don't have the same kind of validity as a college degree. They're just an indication that the owners of W3Schools.com accept you as understanding the language. Their word may not be enough for a potential employer.
  24. These rules are causing the problem: li:hover a {background:#CC0000;color:inherit;}li:hover li a:hover {background:#FF0000;color:inherit;} You can just delete them and the code should work just the same except without the problem. When targeting li:hover, you're highlighting the <a> element as long as the mouse is over the entire <li> element.
  25. Ingolme

    Valid number?

    You can use a regular expression to check that only numbers are used. if(!/[0-9]+(\.?[0-9])?/.test(str)) { alert("Number not valid.");}
×
×
  • Create New...