Jump to content

Ingolme

Moderator
  • Posts

    14,897
  • Joined

  • Last visited

  • Days Won

    176

Everything posted by Ingolme

  1. For the drawing part, I create a new canvas element (document.createElement("canvas")), I draw on it and when everything is drawn I use the drawImage() method to draw the contents of that canvas onto the visible canvas.You need to use clearRect() to delete everything on the backbuffer canvas before beginning a new frame in the game cycle.
  2. A share button is just a link (<a> element) to one of the social media websites. It has a query string with the URL of the current page in it. Right at the bottom of this thread you can see the share buttons for this topic.Each site has its own sharing format, I'm sure you can see the information for the site on their own page. Here's an example of the facebook share link http://www.facebook.com/sharer/sharer.php?u=(url here)
  3. Javascript has a particular syntax for singletons: var GameState = { "property1" : 0x80, "property2" : "value 2", "property3" : true, "method1" : function(arg) { this.property1 = 0x40; this.property2 = arg; }, "method2" : function() { var value; if(property3) { return (property1 & 0x80); } else { return (property1 & 0x7F); } }}
  4. Ingolme

    type casting

    You use it to convert database numbers, which are returned as strings, into PHP integers or floats.You also use it to convert information sent through GET, POST, COOKIE and others which are strings, into numbers. Every time you print a value from PHP the value is automatically being typecasted to string.
  5. It looks like you're going to have to change the stylesheet link to suit the directory structure of Wordpress.
  6. It sounds like a really complex thing. I don't believe that all Flash documents can be converted to HTML 5. I wonder how it deals with shape tweening or movieclip hierarchy.
  7. That's correct. A <div> is a block element. All block elements behave that way.
  8. -f means "is file" and -d means "is directory" therefore !-f means "is not file" and !-d means "is not directory."RewriteCond implies a condition, therefore it translated to:If REQUEST_FILENAME is not a file and REQUEST_FILENAME is not a directory then rewrite the URL.
  9. If the player is too big then it will overflow. You should make its container larger, or make the player smaller.
  10. Javascript can't save information. All it can do is change what is visible on the page at the moment for the particular user that is viewing the page.
  11. Personally, I prefer to stay passive about it. If they do anything to the site, I just reupload the files and possibly fix any vulnerabilities I detected.
  12. Ingolme

    xml in php file

    If there's mark-up in the database information, surround it with <![CDATA[ ]]> tags or use htmlspecialchars(). (Since this is XML, htmlentities() will cause invalid entities) As mentioned, the content-type header should be application/rss+xml
  13. GET and POST are data sent from the client. It's all new data.
  14. What is the POST and GET have different values? I can't see a good reason to access both at the same time.
  15. I use the offsetWidth property to determine the length of the sentence to make my marquee scripts work.
  16. People call it a marquee. I suppose there would be a few Javascript marquees since the HTML element for it is invalid. It's pretty simple to make, but it will wait for the entire text to be scrolled out of view before reappearing on the right.
  17. Ingolme

    2 questions?

    If the file has HTML in it, it has to be saved with .html or .php extension. .js is only for pure Javascript.
  18. "line-height" is the property that sets the spacing between lines of text.
  19. CSS has nothing to do with search engine optimization. The crawler doesn't care how wide your links are or where they are located. For the purpose of removing redundant code, you probably don't need that <div> element since the <ul> is already acting as the container for the list items.
  20. Ingolme

    xml in php file

    Is this supposed to be an RSS feed?
  21. If the browser is doing it that way then there's nothing you can do to fix it.On solution would be to have a <div> or <span> element display as an inline-block and use a background-image instead. You would need to specify the width and height of the image on the element. The image would lose its semantic meaning which means that search engines and machines wouldn't recognize it as an image.
  22. I don't believe regular expressions are capable of that. That is not what regular expressions are intended for.
  23. In HTML 4.01 and XHTML 1.0, the name attribute was not available in the Strict doctype. According to W3Schools, it seems like it has been retained in the HTML 5 specification.
  24. If this is purely Javascript and no PHP involved then there is no need for the <form> element. However, if it is purely Javascript, anybody can just look at the source code to see the answers. The name attribute is not valid on the <form> element. It is an old and deprecated way to access forms. You should use HTML DOM methods getElementsByTagName() and getElementById(). Here's a question and a way to access its elements: <fieldset id="question1"> <legend>What is the answer to this question?</legend> <label><input type="radio" name="q1" value="right"> Right answer</label> <label><input type="radio" name="q1" value="wrong"> Wrong answer</label></fieldset><input type="button" id="answer"><script type="text/javascript"> document.getElementById("answer").onclick = validate; function validate() { var radios; var i; var right; radios = document.getElementById("question1").getElementsByTagName("input"); right = false; for(i = 0; i < radios.length; i++) { if(radios[i].value == "yes" && radios[i].checked == true) { right = true; } } if(right) { alert("You answered correctly"); } else { alert("Wrong answer"); } }</script>
×
×
  • Create New...