Jump to content

justsomeguy

Moderator
  • Content Count

    31,096
  • Joined

  • Last visited

  • Days Won

    42

justsomeguy last won the day on January 9

justsomeguy had the most liked content!

Community Reputation

1,089 Excellent

About justsomeguy

  • Rank
    More Human Than Human
  • Birthday 06/03/1979

Contact Methods

  • Website URL
    http://
  • ICQ
    0

Profile Information

  • Location
    Phoenix

Previous Fields

  • Languages
    Focusing on PHP and JavaScript

Recent Profile Visitors

290,084 profile views
  1. justsomeguy

    return from function???

    Sounds like you've got an error stopping the other code from running. Make sure to check the console in your browser's developer tools. It might be the variable AmendForm, it doesn't look like it's defined. Pass this instead to pass the element where you have the attribute.
  2. justsomeguy

    return from function???

    I'll move this to Javascript since it doesn't have anything to do with PHP.
  3. justsomeguy

    return from function???

    Depends on what the browser vendors decide to do. I don't believe that method is part of the standard, so when you're talking about non-standard things you'll find that they work differently in different browsers. That will work in older browsers, sure. It might not work on mobile devices though, for example. https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault Note that those examples also attach the listener using addEventListener rather than using event attributes.
  4. justsomeguy

    return from function???

    The modern way to do that is to get the event object inside the event handler, and cancel the default action.
  5. justsomeguy

    responsive menu

    Run the toggle function when any of the links are clicked.
  6. justsomeguy

    Filtering Feature for Website

    It's certainly simple for a seasoned developer, that's a basic part of using databases. If you don't know how to use databases then it's not going to be easy though. You need a form for people to submit whatever you want them to submit, and your code that processes the form needs to build a query with the appropriate WHERE clauses for your database structure. e.g.: SELECT * FROM people WHERE facility = 3 AND specialty = 10
  7. justsomeguy

    How do I get a stable array

    I use the MDN is the definitive Javascript reference. If I have a question about arrays I'll search for "mdn array" to get their pages about it.
  8. justsomeguy

    How do I get a stable array

    That's the wrong kind of copy. Javascript uses references for a lot of things like arrays and objects, so if you have a variable that's an array and set another variable to it, all you've done is made 2 variables that point to the same thing, that's what the reference is. You want an actual separate copy. It looks like you can use Array.from for that now: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from var copy = Array.from(sumArray); That's just a faster way to do this: var copy = []; for (var i = 0; i < sumArray.length; i++) { copy[i] = sumArray[i]; }
  9. justsomeguy

    How do I get a stable array

    You can make a copy of the array, or reverse it back.
  10. justsomeguy

    How do I get a stable array

    Did you try taking all of that code out of the loop? Right now, this is your loop: for (var i = 0; i < sumArray.length; i++) { if (sumArray[i]) { sum += Math.pow(2, i); } document.getElementById("s1").innerHTML = sum; document.getElementById("s2").innerHTML = sum; /*console.log(sumArray.reverse());*/ document.getElementById("demo").innerHTML = Number(sumArray.join("")); document.getElementById("posit0").innerHTML = sumArray [0]; document.getElementById("place0").innerHTML = sumArray [0]; document.getElementById("cijfer0").innerHTML = sumArray [0]; document.getElementById("value0").innerHTML = sumArray [0] * Math.pow(2, 0); document.getElementById("posit1").innerHTML = sumArray [1]; document.getElementById("place1").innerHTML = sumArray [1]; document.getElementById("cijfer1").innerHTML = sumArray [1]; document.getElementById("value1").innerHTML = sumArray [1] * Math.pow(2, 1); document.getElementById("posit2").innerHTML = sumArray [2]; document.getElementById("place2").innerHTML = sumArray [2]; document.getElementById("cijfer2").innerHTML = sumArray [2]; document.getElementById("value2").innerHTML = sumArray [2] * Math.pow(2, 2); document.getElementById("posit3").innerHTML = sumArray [3]; document.getElementById("place3").innerHTML = sumArray [3]; document.getElementById("cijfer3").innerHTML = sumArray [3]; document.getElementById("value3").innerHTML = sumArray [3] * Math.pow(2, 3); document.getElementById("posit4").innerHTML = sumArray [4]; document.getElementById("place4").innerHTML = sumArray [4]; document.getElementById("cijfer4").innerHTML = sumArray [4]; document.getElementById("value4").innerHTML = sumArray [4] * Math.pow(2, 4); document.getElementById("posit5").innerHTML = sumArray [5]; document.getElementById("place5").innerHTML = sumArray [5]; document.getElementById("cijfer5").innerHTML = sumArray [5]; document.getElementById("value5").innerHTML = sumArray [5] * Math.pow(2, 5); document.getElementById("posit6").innerHTML = sumArray [6]; document.getElementById("place6").innerHTML = sumArray [6]; document.getElementById("cijfer6").innerHTML = sumArray [6]; document.getElementById("value6").innerHTML = sumArray [6] * Math.pow(2, 6); document.getElementById("posit7").innerHTML = sumArray [7]; document.getElementById("place7").innerHTML = sumArray [7]; document.getElementById("cijfer7").innerHTML = sumArray [7]; document.getElementById("value7").innerHTML = sumArray [7] * Math.pow(2, 7); document.getElementById("posit8").innerHTML = sumArray [8]; document.getElementById("place8").innerHTML = sumArray [8]; document.getElementById("cijfer8").innerHTML = sumArray [8]; document.getElementById("value8").innerHTML = sumArray [8] * Math.pow(2, 8); document.getElementById("posit9").innerHTML = sumArray [9]; document.getElementById("place9").innerHTML = sumArray [9]; document.getElementById("cijfer9").innerHTML = sumArray [9]; document.getElementById("value9").innerHTML = sumArray [9] * Math.pow(2, 9); document.getElementById("posit10").innerHTML = sumArray [10]; document.getElementById("place10").innerHTML = sumArray [10]; document.getElementById("cijfer10").innerHTML = sumArray [10]; document.getElementById("value10").innerHTML = sumArray [10] * Math.pow(2, 10); document.getElementById("posit11").innerHTML = sumArray [11]; document.getElementById("place11").innerHTML = sumArray [11]; document.getElementById("cijfer11").innerHTML = sumArray [11]; document.getElementById("value11").innerHTML = sumArray [11] * Math.pow(2, 11); } You don't need to do all of that for every element in the array. I think you put that in the loop by mistake. Keep in mind also that Array.reverse is destructive, it changes the original array. Since you're trying to do that inside the loop that's another reason why it seems that you put too much code in there.
  11. justsomeguy

    How do I get a stable array

    I don't think I understand what the problem is, but it looks like the loop where you calculate the sum is too big. That loop should only calculate the sum, not change all of those elements on the page for each element in the arrray. You would keep reversing the array every time through the loop, which means that sumArray would keep changing.
  12. justsomeguy

    Desperately need to upgrade website security

    What do you mean by that? Just with the GA tracking cookies you can determine how to contact someone and gain some insight about their browsing habits? Is there a proof-of-concept of that or anything? I'm assuming you're not talking about the website administrator and just some random attacker trying to intercept traffic, I don't understand how that person would gain enough information to contact someone and act like they know them. Again, I'm looking for technical details on how an attack like that would work. I'm a technical person, I can understand the details. What I don't understand is how you think they can happen, in a technical sense. I mean, if the website is currently vulnerable, then wouldn't attacks like that be happening now? There's not, though. It IS possible to negate a specific attack, and websites that are not interactive and which don't do things like having people create accounts and log in and post content (like the w3schools site), are simple not vulnerable to several classes of attacks which rely on those kinds of things.
  13. justsomeguy

    Desperately need to upgrade website security

    3 cookies on the home page, actually, and all of them are for Google Analytics. That's typically not considered sensitive information. What are you referring to technically? How does an attacker "intercept a link?" Are you referring to a MITM attack? Again, what are you referring to, technically? What something on the website can someone pretend to be an admin about, and how? And, technically, how would SSL/TLS prevent it? How does SSL/TLS prevent phishing attacks? Sure. How does SSL/TLS prevent that? Is the w3schools.com site hosting malware? If not, why bring this up? Again, since you're speaking with a technical audience, I would appreciate a technical description of the problem, and specifically how it can be rectified with SSL/TLS.
  14. justsomeguy

    Page Preview for link-hover

    It doesn't seem that difficult, but if you're expecting a ready-made thing that you just drop in and it works, you're probably not going to find that. The major pieces are a short blob of text, and an optional image, with a popup element to show them. That's the basics of it. How you get that text and that image is something that you can probably think about. Maybe one option is to send an ajax request for that other page (which will only work for pages on the same domain, as in Wikipedia), and find the preview text and optional image somewhere in the HTML, like the metadata in the head. Another option would be to build those anchor tags so that they use data attributes to include the text and image right in the link itself. There are probably other options you could come up with too. Maybe you have a database that has the text and image for every page on your site, for example. I haven't looked in-depth into how Wikipedia does it to know which solution they decided on. Since sometimes there is a delay, it sounds like they probably send an ajax request to the URL.
  15. justsomeguy

    I want to delete my account permanently

    You only have one post other than this one, what data are you concerned about?
×