Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation since 12/16/2018 in Posts

  1. 1 point
    The content of the page in the iframe is inside a wrapper with a white background, while the document itself does not have a set background color. Because of that, the white ends where the content does.
  2. 1 point
    I don't know what the full requirements of your software are, but your code should look something like this: $type2 = 'Some default value'; $type_link = 'Another default value'; if(isset($typeChunks[0]) { $type2 = $typeChunks[0]; } if(isset($typeChunks[1]) { $type_link = $typeChunks[1]; } I'm also not sure why you've wrapped brackets around every single statement, they're not needed. There are also inconsistencies in your variable naming, you should either use all underscores ($type_link, $type_chunks) or all camel case ($typeLink, $typeChunks).
  3. 1 point
    Yes! Now it's working. I think this project was a bit too ambitious for me as a beginner with only 1 month study from the w3c-schools tutorials ... But in the process of trying to get it fixed I learned a lot of Javascript, much more than only by following the tutorials. Now a can fill in the rest of the code, hopefully without problems. Once again, thank you very much!
  4. 1 point
    Other than what I described? I'm sure you could come up with something that is more complex, but I don't know why you would. If you're looking for a built-in recursive object key search, I don't believe there is one. You would need to roll your own.
  5. 1 point
    If you're talking about Array.map, that's only available on arrays, not Objects. Maybe you can convert an Object to an array, but regular Objects don't have a map method. You can return the keys of an object though and loop through them that way. It sounds like you need a recursive function that checks if you're dealing with an array or object and searches appropriately. It would call itself if it found another array or object.
  6. 1 point
    Can't you simply add class of size you want such as 'w3-half' to table, then add margin: 0 auto;? Theres a class 'w3-auto' that gives you margin-left: auto; margin-right: auto; so use that as well <table class="w3-table-all w3-half w3-auto"> /*yada yada yada */ </table> Should give 50% width of parent width and centred.
  7. 1 point
    It's correct to wrap property names in quotes in Javascript. JSON stands for "JavaScript Object Notation", after all. If the JSON is in a string as when returned by AJAX, you need to use JSON.parse() to read it, but if you can just have the JSON right in the code itself, you won't need to parse it.
  8. 1 point
    The reason is that the keys haven't changed. You should use a foreach() loop where possible to iterate through arrays. I rarely ever use a for loop. If you would like to reassign the indices after the call to array_unique(), you can use array_values(). Then you can use a classic for() loop. $unique_even_numbers = array_values(array_unique($even_numbers));
  9. 1 point
    I honestly can't make out what you are trying to say and what you really want? Most of the time, and this time it's utter gibberish.
  10. 1 point
    Remove float: left from the gallery and add text-align: center. You're missing a semi-colon after width: 90%, so it's not being interpreted correctly.
×