8

This is one for the ages. I'm writing an MVC4 application and have just added some code to dynamically generate some html from a JSON object passed from a controller. It is triggered after a SlickGrid event for double-clicking a row which fetches the data from the controller and pushes a new set of JQ-generated html elements to the page.

Now for the kicker:

I get a dull ringing noise coming from my monitor (I believe) upon double-clicking the row and seeing the HTML. The html is a "window" of sorts and as such has a button to close the information (which does nothing more than set the container to display: none;).

When the HTML is visible...the ringing noise is heard, when I click close and hide the HTML, it goes away. This is annoyingly reliable. I have no idea what could cause this. Here's a bit of code but I doubt it'll give any insight

Dynamic HTML Generation Function:

function OrderDataDisplay(obj) {
        var tabHTML = "<div id='__t" + obj.DepRunningNo + "' style='position: absolute;" + 
        "bottom: 0px;" +
        "left: 20px;" +
        "height: 17px;" +
        "text-align: center;" +
        "padding: 3px;" +
        "width: 100px;" +
        "background: -webkit-linear-gradient(top, rgb(20, 20, 20) 0%, rgb(53, 50, 50) 100%);" +
        "border-top: 1px;" +
        "border-left: 1px;" +
        "border-right: 1px;" +
        "border-style: ridge;" +
        "border-color: #424242;" +
        "color: #FFF;" +
        "border-radius: 15px 15px 0 0;" +
        "font-family: Geneva;" +
        "font-size: 15px;'>Ticket #" + obj[0].DepRunningNo + "</div>";

        var dataHTML = "";

        for (var key in obj[0]) {
            if (obj[0].hasOwnProperty(key)) {
                if(obj[0][key] != null)
                    dataHTML += "<div style='border: 1px solid black; display: block;'>" + key + ": " + obj[0][key] + "</div>";
            }
        }

        $("#ticketTabs").append(tabHTML);
        $("#ticketTab").append(dataHTML);

        $("#ticketTab").show();
        $("#ticketTabs").show();
        console.log(obj);
    }
Mike H.
  • 1,731
  • 9
  • 31
  • 4
    +1 - What an amazing question. "ringing noise" from monitor, how to solve with jQuery, that's a new one! – adeneo Oct 04 '13 at 20:10
  • Haha I know right? I honestly thought I was losing my mind until I had a coworker come and hear it too – Mike H. Oct 04 '13 at 20:10
  • Two very important questions: 1) Is it a CRT or LCD panel? 2) Does it have embedded speakers? If it's a CRT then there is some physical part that has a specific resonant frequency and that resonance is being achieved with a specific display configuration. – Jim Garrison Oct 04 '13 at 20:14
  • LCD (CRT's still exist?) and no it does not, which is even creepier. – Mike H. Oct 04 '13 at 20:16
  • 1
    I had something similar years ago but found it was color. If i brought up a page with a lot of white it would hum but if I closed that or brought up a screen with color it would stop. – Matt Bodily Oct 04 '13 at 20:19
  • @MattBodily I wish I could triple-vote your answer because I've experienced that precise issue – MonkeyZeus Oct 04 '13 at 20:20
  • This reminds me of [the case of the 500 mile email](http://www.ibiblio.org/harris/500milemail.html). – idbehold Oct 04 '13 at 20:28
  • @MattBodily my God man you are a genius! Throw that into an answer so I can give you a big green check! – Mike H. Oct 04 '13 at 20:29
  • done and appreciated :) – Matt Bodily Oct 04 '13 at 20:30
  • You saved my sanity, it's the least I could do! – Mike H. Oct 04 '13 at 20:30

1 Answers1

8

I had something similar years ago but found it was color. If i brought up a page with a lot of white it would hum but if I closed that or brought up a screen with color it would stop

Matt Bodily
  • 6,403
  • 4
  • 29
  • 48