Jump to content

Ingolme

Moderator
  • Posts

    14,901
  • Joined

  • Last visited

  • Days Won

    177

Everything posted by Ingolme

  1. Some browsers might not work with absolute file paths for security reasons. Use relative paths. You can use ../ to move up a directory from the current HTML file's location.
  2. Canvas is much more versatile and more efficient than SVG. SVG is a format to save vector data, which is different than displaying an image on the screen, which is what the canvas does. You should forget about SVG because it's interfering with your learning of Javascript.
  3. WebGL is an interface that allows a programmer to have closer access to the computer's graphics chip to perform expensive operations.
  4. The match() method returns an array of matches. The first match would be what's outside of the parentheses, all subsequent matches are associated to a pair of parentheses. Since the match of the whole expression is the same as what's in parentheses, the result will be an array of two identical elements.
  5. Perhaps "imprecise" would be a better word. Certainly requestAnimationFrame() has higher accuracy. It's a newer function that isn't as widely supported. For example, IE9 and under won't be able to use it.
  6. You don't need more than one animation function.
  7. Animation in Javascript is done by using setInterval() or setTimeout() to manipulate an element's style periodically.
  8. I made a mistake in my previous post, it's Schema, not XSL. It's an XML-based language that is used to define a set of rules. You can learn about XML Schema here: http://www.w3schools.com/schema/default.asp
  9. Because if you didn't initialize it as an empty string the result will start off saying "undefined" and some browsers will throw an error message "text is not defined"
  10. You should correct your HTML code, fix any mistakes that the W3C validator shows.
  11. You're able to use it in any environment that uses Javascript. Whether or not it's a good idea is another thing.
  12. Because it still is part of the language.
  13. That means that the variable "form" isn't set. That's probably a scope issue. Give the <form> element an ID attribute and use getElementById() to access it.
  14. The page takes too long to load, though I was capable of seeing the source code for a moment. There could be many reasons why it's not working, I would start by making sure the HTML is valid: http://validator.w3.org/#validate_by_input Drop the HTML transitional doctype and use HTML 5. You pointed to the wrong line. Line 87 is this one: confirmDialog('Confirm', 'Are you sure?', function () { form.submit();}); So put the console.log() there: console.log(form);form.submit();
  15. Is English your native language? You seem to have trouble understanding what things are saying. /* Using test */var a = str.test(exp);alert(a); // Shows "true" or "false"/* Equivalent operation: */var a = true;var e = str.exec(exp);if(e === null) { a = false;}alert(a); // Shows "true" or "false", the same value as it would in the previous example
  16. Javascript animation works much different than CSS animation. It's possible to alter stylesheets with Javascript, but it's complicated and almost always not worth it, especially for something like animation.
  17. The game does have a guide. It says "Use your finger to draw the shapes". It's clear the game is developed for mobile devices, in the case of a device without a touch screen, draw the shapes with the mouse. This thread is quite old, I'm not sure if the person who made it is going to come back to the forums. Try to reply to more active threads.
  18. No, no words are reserved in XML. What you're showing is part of XSL, an XML-based language which does have particular keywords. However, the namespace (xs:) allows it to be distinguished from other XML formats that have the same keywords.
  19. What they're saying is correct. Calling test() is the same as first calling exec() and then returning true if the exec() return value isn't null.
  20. Line 87 should have console.log(this); which has no reason to trigger any errors. The error should be occurring on line 88, meaning that the value of "this" should be visible in the javascript console. This is getting tedious. Can you show an online sample page?
  21. What does your current code look like?
  22. Robots are very good at math, computers are math machines. And if the question is written in text it can even read the text and figure out what the question is. An example people often point out when showing how smart computers are is wolfram alpha. Go ahead and ask it anything, it reads English and gives answers. Answer 2 + 2 What is the third letter in "designated"? What color is the sky?
  23. It has to be logging something. There's something you're not doing right. Make sure you're running the right code, and that previous code hasn't been cached by the browser.
  24. These things are much too advanced for you. You need to have understanding of Javascript is a language and then you will be able to know what the code is doing. The things you're showing are programs made with Javascript, and all programs are different. In order to know what a program does you have to already have a lot of experience in Javascript. Ignore that code and try to go back to more basic things.
  25. Ingolme

    php if else

    I'd recommend the switch() structure for this case. Justsomeguy said it clearly. Check to see what value the string has, var_dump() will be more useful as it will tell you how many characters the string has: var_dump($db_oregion); I'm suspecting it's the & problem that Don Jajo mentioned.
×
×
  • Create New...