SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Evangelist NokX's Avatar
    Join Date
    Feb 2003
    Location
    Knoxville, TN
    Posts
    525
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    "Object Expected" with IE (%$#@)

    i have a function called g_checkStatus() that's inside of an onclick attribute in a div tag. it works perfect in every browser except for IE. with IE i get an "Object Expected" error.

    if i replace onclick="g_checkStatus();" with onclick="alert('testing');" it works fine in IE. even if i strip the g_checkStatus function of everything and just simply have it trigger an alert() i get the "Object Expected" error, as well.

    there's gotta be something i'm missing, i just don't know what IE is wanting me to do.

  2. #2
    SitePoint Wizard bronze trophy chris.upjohn's Avatar
    Join Date
    Apr 2010
    Location
    Melbourne, AU
    Posts
    2,197
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    Whats in your g_checkStatus() function?

  3. #3
    SitePoint Evangelist NokX's Avatar
    Join Date
    Feb 2003
    Location
    Knoxville, TN
    Posts
    525
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by SgtLegend View Post
    Whats in your g_checkStatus() function?
    i will comment out everything in the function and just put alert('testing'); and it still gives me that error; so i don't think it's what's inside that's causing the issue. it seems IE is maybe not loading the function before it's called, but the function is at the top of the page and you can't activate the onclick event until it's loaded on the page...so that doesn't really make sense.

    very frustrating indeed.

  4. #4
    Non-Member Kalon's Avatar
    Join Date
    Aug 2010
    Location
    At my computer
    Posts
    2,012
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hard to tell what the problem is if you don't post your html and javascript code.

  5. #5
    SitePoint Evangelist NokX's Avatar
    Join Date
    Feb 2003
    Location
    Knoxville, TN
    Posts
    525
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    function g_checkStatus() {
        /*this.statusDialog = new oldi.statusWindow.dialog();
        this.statusDialog.create(g_checkStatus.arguments);
        this.statusDialog.caller = null;
        this.statusDialog.onShow(g_checkStatus.arguments);*/
        alert('testing');
    }
    
    /* located inside a javascript object */
    /* all this is doing is creating a grid and i'm adding the onclick event into the <div> */
    
    loadTriggersComplete: function(type, data)
        {
            // remove rows from Trigger grid
            this.trigGrid.model.clearData();
            this.trigGrid.update();
    
            if(data)
            {     
                var model = this.trigGrid.model;
                var trigs = [];
                dojo.lang.forEach(data, function(stats)
                {
                    var oc1 = 'onclick="g_checkStatus(\'trigger\', \'' + stats.Name + '\', \'' + stats.CompareTag1REC + '\', \'' + stats.CompareTag1ErrStr + '\', \'' + stats.CompareTag1EH1 + '\', \'' + stats.CompareTag1EH2 + '\', \'' + stats.CompareTag1EH3 + '\', \'' + stats.CompareTag1EH4 + '\', \'' + stats.CompareTag1EH5 + '\', \'' + stats.CompareTag1EH6 + '\', \'' + stats.CompareTag1EH7 + '\', \'' + stats.CompareTag1EH8 + '\', 1);"';
                    var oc2 = 'onclick="g_checkStatus(\'trigger\', \'' + stats.Name + '\', \'' + stats.CompareTag2REC + '\', \'' + stats.CompareTag2ErrStr + '\', \'' + stats.CompareTag2EH1 + '\', \'' + stats.CompareTag2EH2 + '\', \'' + stats.CompareTag2EH3 + '\', \'' + stats.CompareTag2EH4 + '\', \'' + stats.CompareTag2EH5 + '\', \'' + stats.CompareTag2EH6 + '\', \'' + stats.CompareTag2EH7 + '\', \'' + stats.CompareTag2EH8 + '\', 2);"';
                    
                    var compTag1 = (stats.CompareTag1EF > 0) ? '<div ' + oc1 +' id="' + stats.Name + '_Tag1" class="cell-button-red">Status</div>' : '<div ' + oc1 +' id="' + stats.Name + '_Tag1" class="cell-button-gray">Status</div>';
                    var compTag2 = (stats.CompareTag2EF > 0) ? '<div ' + oc2 +' id="' + stats.Name + '_Tag2" class="cell-button-red">Status</div>' : '<div ' + oc2 +' id="' + stats.Name + '_Tag2" class="cell-button-gray">Status</div>';
                    var esf = (stats.ErrorStateFlag > 0) ? 'True' : 'False';
                    var newRowData = [stats.Name, stats.ExeCnt, stats.IoErrCnt, stats.AvgExeMs, stats.MinExeMs, stats.MaxExeMs, stats.AvgCycleMs, stats.MinCycleMs, stats.MaxCycleMs, esf, compTag1, compTag2];
                    
                    model.insert(newRowData, model.count);
                    trigs.push([stats.Name, stats.ExeCnt]);
                });
                this.trigGrid.update();
            }
            else
            { 
                dojo.debug("Error: Unable to get Trigger Status!");
            }
        },


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •