Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ringing noise from monitor after dynamically generating HTML

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);
    }
like image 427
Mike H. Avatar asked Oct 04 '13 20:10

Mike H.


1 Answers

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

like image 142
Matt Bodily Avatar answered Oct 31 '22 12:10

Matt Bodily