• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 241
  • Last Modified:

java script error - object not found

I have this code

<asp:HyperLink ID="hlMainImageChange"
                                              NavigateUrl="javascript:ImageChange('main', 'change');" runat="server">Change</asp:HyperLink>


That tries to call this code:

 function ImageChange(strImgType, strFunction) {

        var WinSettings = "center:yes;resizable:no;dialogHeight:300px"
     
        var MyArgs = window.showModalDialog("../change_file.aspx?Product_ID=" + prodid + "&ImageType=" + strImgType + "&FunctionType=" + strFunction, MyArgs, WinSettings)

    }


 but does not make it there because i get a error

Microsoft JScript runtime error: Object expected



0
vbnetcoder
Asked:
vbnetcoder
  • 2
  • 2
2 Solutions
 
Dave BaldwinFixer of ProblemsCommented:
You're trying to use "MyArgs" in the line that defines it.  I don't think that works.

var MyArgs = window.showModalDialog("../change_file.aspx?Product_ID=" + prodid + "&ImageType=" + strImgType + "&FunctionType=" + strFunction, MyArgs, WinSettings)
0
 
vbnetcoderAuthor Commented:
It was working fine in Google Chrome
0
 
Dave BaldwinFixer of ProblemsCommented:
Then it is passing a 'null' in Chrome and that is what Microsoft Jscript is objecting to.  Every browser has it's own javascript interpreter with it's own differences and Microsoft's Jscript in IE8 seems to be the pickiest.
0
 
vbnetcoderAuthor Commented:
ty
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now