none
Microsoft JScript runtime error: Object expected

    Question

  • I am getting thi error message every time i debug my application .. how can i resolve this issue..

     <script type="javascript" language="javascript">
            function Clickheretoprint() {
                var disp_setting = "toolbar=yes,location=no,directories=yes,menubar=yes,";
                disp_setting += "scrollbars=yes,width=650, height=600, left=100, top=25";
                var content_vlue = document.getElementById("print_content").innerHTML;
     
                var docprint = window.open("", "", disp_setting);
                docprint.document.open();
                docprint.document.write('<html><head><title>Inel Power System</title>');
                docprint.document.write('</head><body onLoad="self.print()"><center>');
                docprint.document.write(content_vlue);
                docprint.document.write('</center></body></html>');
                docprint.document.close();
                docprint.focus();
            }
    </script><asp:Button ID="btnPrint" runat="server" Text="Print" OnClientClick = "javascript:Clickheretoprint()"
                                 Height="29px" 
                                style="font-weight: 700" Width="70px" />


    New born in developing

    Tuesday, September 11, 2012 7:32 AM

Answers

  • i changed the script line to this and its working now 

       <script type='text/javascript' language="javascript">


    New born in developing

    Tuesday, September 11, 2012 8:56 AM

All replies

  • from VS, select

    Debug>Start without debugging

    when the page opens in IE, press f12 to display the developer tool>Script tab, click "Start Debugging".... refresh your page to display the client script errors.

    jScript is not javascript (well it is, but only MSIE browsers will recognise the <script> tags....) the error message is comming from one of your VS resource files. (include the full error details when asking questions)

    Probably your VS project .net version and your server/application pool versions are different

    or

    your IE (version not mentioned) userAgent string is incorrect.

    .net v2 seems to have problems with recognising the IE10 UAS.

    when asking questions in this forum about html, css and scripting for website developers it is helpful if you provide a link to your website for us to examine and debug.

    PS: Quirks is dead.


    Rob^_^

    Tuesday, September 11, 2012 8:53 AM
  • i changed the script line to this and its working now 

       <script type='text/javascript' language="javascript">


    New born in developing

    Tuesday, September 11, 2012 8:56 AM