Jump to content

Ingolme

Moderator
  • Posts

    14,901
  • Joined

  • Last visited

  • Days Won

    177

Everything posted by Ingolme

  1. To be more clear. The first function $() returns an object, and methods of that object return the exact same object. Here's a simplified example: function a(x) { return { value : x, b : function() { return this; } c : function() { return this; } }}a("A").b().b();
  2. The function returns the same object that it is a method of.
  3. That depends on the content management system you're using to get the data. This isn't an HTML problem, this has to do with your content management system. So we need to know what content management system your website is using.
  4. When you call removeEventListener, the function you pass has to be exactly the same function as the one that was passed to addEventListener. For example, this won't work because, while a and b do the same thing, they are still two different entities. var a = function() { alert(1); };var b = function() { alert(1); };element.addEventListener("click", a, false);element.removeEventListener("click", b, false); Just a note: This is an unnecessary wrapping of a function: var call_back = function(event) { D.drag.move(event);}; While it results in a completely new and different function, its functionality is identical to this: var call_back = D.drag.move; And this is also likely to fix your removeEventListener problem, since now you're referring to the actual function and not the anonymous one it's wrapped in.
  5. I don't think they respond. They'll look at it eventually and some day the correction will be on the website.
  6. Ingolme

    math symbol

    No, it does not exist. That doesn't make sense.
  7. It seems you're using the alias "p" multiple times for the same table: FROM produk as p, kategori_produk as kp, produk as p, jenis_material as jm, produk as p, merk_material as mm, produk as p, gudang_material as gm You only need to put the table once.
  8. What is wrong about the definition? The example looks perfectly functional to me.
  9. i either write XML in a normal code editor or I have a programming language generate it. I believe it would be a waste to spend money on an XML editor since XML is becoming obsolete as a data storage and transmission format.
  10. That is quite a lot of queries. Perhaps you need to redesign your software. Look for instances where you're querying the same data twice and store the results in a variable instead. Find places where you might be looping through the results of one query to perform another one and see if it can be resolved with a JOIN instead.
  11. You're performing an AJAX request to showPreview.php, that file must also be saved in UTF-8. I believe it is preferable to save it without a byte-order mark, but I don't think it should really affect the outcome aside from having three extra characters at the beginning of the document.
  12. You can use the "REPORT ERROR" link at the bottom of the page to notify the W3Schools staff that something on the page is wrong.
  13. At the bottom of the page there's a link labeled "REPORT ERROR" which notifies the W3Schools staff of errors on the particular page you clicked the link on. There is a danger in using the background property when you just want to set one part, that being that you'll reset any other background properties that you had set earlier. Suppose you want to change the background color of an element on hover and you use just "background", then the background image will disappear.
  14. Ingolme

    math symbol

    In what language? That's not valid Javascript or PHP.
  15. These are VALUES, as the query indicates: VALUES (`$varc`, `$vard`) String values must be wrapped in single quotes or double quotes, not backticks.
  16. It's still a table identifier, not the value of a field. MySQL doesn't know it's a variable, only PHP does.
  17. Backticks are used around table identifiers and field identifiers in the query. Single or double quotes are used around string values.
  18. If you have two different tables and you want them styled differently, give the <table> element a class attribute and use descendent selector to target the <td> elements within them. <table class="table1"><table class="table2">.table1 td { border: 1px solid black;}
  19. Instead of putting the border on the container, put it right on the <img> element itself.
  20. Normally videogames are programmed in object-oriented style. Each monster is an instance of the Monster class and they all have a method .attack() to which you pass the player as a parameter. Inside this function, you do an operation with the monster's stats and the player's stats. The attack() method should be the same for all monsters. This is a very simple example of an object-oriented way to program monsters in a videogame: function Player() { var self = this; this.stats = { attack: 1, defense: 1}; this.health = 100; this.maxHealth = 100;}function Monster() { var self = this; this.stats = { attack: 1, defense: 1}; this.health = 100; this.maxHealth = 100; this.attack = function(p) { // Very simplistic example function p.health -= self.attack }}var player = new Player();player.stats.attack = 6;player.stats.defense = 7;var jelly = new Monster();jelly.stats.attack = 5;jelly.stats.defense = 8;// The monster attacks the playerjelly.attack(player);
  21. To calculate the percentage of something, divide the value by the maximum value, then multiply by 100. If maximum health is 600 and the current health is 26, then the percentage would be 100 * 26/600, which is 4.333%
  22. Are you referring to the HTML entities to display symbols such as © and ™?
  23. Do you understand what my line of code is doing?
  24. Choose whether you want to go mobile-first or desktop-first. If you are going desktop-first then code all your CSS for a desktop website. If you're going mobile-first, code your CSS exclusively for small screens. After you have done making your design you start adding media queries. If you're going desktop-first, then resize the window until your site breaks. Make a media query with max-width set to the width at which the page broke and use CSS to rearrange things. Then continue resizing the window until the page breaks again, then add another media query. Media queries should go at the end of the stylesheet and in order from highest resolution to lowest. If you're going mobile first, start with a small screen, about 320 pixels wide, and go increasing the size until the page looks like it's too wide, then you can use media queries with the min-width property to rearrange things and stack things horizontally. Media queries should go in order from smallest resolution to highest resolution.
  25. I see where the problem is. You're not setting the width of the span, you're setting the width of the entire bar. Here's what your code should look like: document.getElementById('progressBar').getElementsByTagName("span")[0].style.width = "40%";
×
×
  • Create New...