Solved

java script error - object  not found

Posted on 2011-03-11
4
237 Views
Last Modified: 2012-08-14
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
Comment
Question by:vbnetcoder
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 500 total points
ID: 35111108
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
 

Author Comment

by:vbnetcoder
ID: 35111114
It was working fine in Google Chrome
0
 
LVL 83

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 500 total points
ID: 35111170
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
 

Author Closing Comment

by:vbnetcoder
ID: 35112405
ty
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Avoid defining the variables in the global scope; trying to define them in a local function scope. Because:   • Look-up is performed every time a variable is accessed.   • Variables are resolved backwards from most specific to least specific scope…
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question