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
Solved

java script error - object  not found

Posted on 2011-03-11
4
233 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
  • 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
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…

808 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