Jump to content

Ingolme

Moderator
  • Posts

    14,522
  • Joined

  • Last visited

  • Days Won

    116

Ingolme last won the day on June 19

Ingolme had the most liked content!

7 Followers

Previous Fields

  • Languages
    C++, Java, PHP, SQL, Javascript, CSS, HTML

Contact Methods

  • Website URL
    https://www.thecodingfox.com/

Profile Information

  • Interests
    Web development, drawing, videogames, foxes.

Recent Profile Visitors

191,157 profile views

Ingolme's Achievements

w3schools Guru

w3schools Guru (7/7)

1k

Reputation

  1. PHP and Javascript operate in two completely different environments. PHP generates Javascript code and Javascript is unaware that PHP was running at all. You could even write something this and it could potentially generate usable Javascript: var <?php echo $_SESSION['varname'] ?> = "Hello World!"; In order to have Javascript treat something as a string, it has to be wrapped in quotation marks. On PHP's end, you'll want to escape any quotation marks that are in the string itself. A working example should look something like this: var s = "<?php echo addslashes($_SESSION['subscriptionid']); ?>";
  2. Javascript has a feature where you can access any object's properties or methods using square brackets and a string inside. window.alert() is the same as window["alert"](). myClass.value is the same as myClass["value"]. Since the square bracket notation uses a string instead of an identifier, you can put a variable containing a string within the square brackets.
  3. I think it should work if you use strings instead. Selecting methods dynamically is going to be pretty confusing to anybody who has to maintain your code. I think it's a practice which should be avoided. ... ... constructor(){ this.config = { "branch": "branchA" }; this.classVar = {"a":1} } main(){ this.classVar["b"] = 2; this.branchB(); this[this.config.branch](); } ... ... var myClass = new MyClass(); myClass.main(); myClass.config.branch = "branchB"; myClass.main();
  4. I have removed the code from your previous post. When posting code, don't post more than around 20 lines because anything more and nobody is going to want to read all of it. You must only post the few lines of code that are related to the particular problem you are trying to solve.
  5. You have defined a function, but are not calling it. The code in a function only runs when the function is called. See the "function invocation" section in the Javascript tutorial: https://www.w3schools.com/js/js_functions.asp
  6. Did the tutorials and videos use Visual Studio Code or Visual Studio? Video Studio Code is just a basic code editor, Visual Studio is an IDE (Integrated Development Environment) designed to manage software projects.
  7. Adding to my previous post, it looks like browsers are fast enough to process pixel data of videos after all, as in the example shown here: https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Manipulating_video_using_canvas
  8. You probably would have to do the math yourself for each pixel and draw the result on a canvas. I don't think that would run fast enough to work on videos. There is nothing natively in Javascript or HTML that converts between RGB and HSL colors that I am aware of. To run algorithms on individual pixels, I would use getImageData() and putImageData() to do pixel manipulation.
  9. Unfortunately, I cannot allow you to link to your website here. Can you describe the issue and show the code which is causing it? I did not see any responsive issues on your website.
  10. backgroundColor needs a capitalized C. IDs are not permitted to begin with a number, but I think browsers might still work if you do that. I would recommend fixing the ID anyway.
  11. You're probably looking for the value of the element: var eingabe = document.getElementById('meininput').value;
  12. It's generally done with a server-side programming language. For personal sites, PHP works fine for that. In PHP, you would use the include() statement.
  13. Setting max-height with overflow would do it, as long as your element is a block type.
  14. There's no need to show the code that he wrote, it's the code that is on the tutorial page: https://www.w3schools.com/howto/howto_js_slideshow_gallery.asp The topic is asking how to put two of them on the page at the same time without duplicating the Javascript. I've answered this one already. The problem can be solved by attaching events using Javascript instead of as an HTML attribute.
  15. Yes, it will prevent anybody from seeing the blocked paths, whether they're search engines or people.
×
×
  • Create New...