Solved

java script error - object  not found

Posted on 2011-03-11
4
230 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 82

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 82

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
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…

760 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now