你的onclick是放在哪个标签的?不会就直接这么写在那里吧

解决方案 »

  1.   

    我只是简单的框架是这样的。
    具体的是在button的onclick国内的还没有用到过的ApcoodinatorV5L10
    中可以一个jsp动态的嵌入另外一个jsp。
    所有有了前套的body了,其实一个来自控制jsp的body
    另外一个来自被嵌入的body。转成画面上后就成了这样了。问题是会不会影响调用的javascript函数?
    帮忙想想看。高手!!
      

  2.   

    你至少犯了2个错
    1。javascript语句必须写在<script>和</script>之间
    2。调用javascript必须有事件源
      

  3.   

    <html>
    <head>
    <script language="javascript">
    var Word,Doc,Uncorrected,Corrected;
    var wdDialogToolsSpellingAndGrammar = 828;
    var wdDoNotSaveChanges = 0;
    Uncorrected = "Helllo world!";
    Word = new ActiveXObject("Excel.Application");
    //Word = new ActiveXObject("Word.Application");
    Doc = Word.Documents.Add();
    Word.Selection.Text = Uncorrected;
    Word.Dialogs(wdDialogToolsSpellingAndGrammar).Show();
    if (Word.Selection.Text.length != 1) 
       Corrected = Word.Selection.Text;
    else
       Corrected = Uncorrected;
    //Doc.Close(wdDoNotSaveChanges);
    //Word.Quit();
    </script>
    </head>
    <body>
    </body>
    </html>
      

  4.   

    弄錯了﹐Excel的不記得了﹐你自已查一下Excel對象吧<html>
    <head>
    <script language="javascript">var Word,Doc,Uncorrected,Corrected;
    var wdDialogToolsSpellingAndGrammar = 828;
    var wdDoNotSaveChanges = 0;
    Uncorrected = "Helllo world!";
    Word = new ActiveXObject("Word.Application");
    Doc = Word.Documents.Add();
    Word.Selection.Text = Uncorrected;
    Word.Dialogs(wdDialogToolsSpellingAndGrammar).Show();
    if (Word.Selection.Text.length != 1) 
       Corrected = Word.Selection.Text;
    else
       Corrected = Uncorrected;
    Doc.Close(wdDoNotSaveChanges);
    Word.Quit();
    /* Excel
    var Word,Doc,Uncorrected,Corrected;
    var wdDialogToolsSpellingAndGrammar = 828;
    var wdDoNotSaveChanges = 0;
    Uncorrected = "Helllo world!";
    Word = new ActiveXObject("Excel.Application");
    Doc = Word.Workbook.Add();
    sheet=Doc.Worksheet.Add();
    sheet.Selection.Text = Uncorrected;
    sheet.Dialogs(wdDialogToolsSpellingAndGrammar).Show();
    if (Word.Selection.Text.length != 1) 
       Corrected = Word.Selection.Text;
    else
       Corrected = Uncorrected;
    Doc.Close(wdDoNotSaveChanges);
    Word.Quit();
    */
    </script>
    </head>
    <body>
    </body>
    </html>
      

  5.   

    <head>
    function chkExec(){
    }
    </head>
    <body>
    <body>
    <input type="button" name="BUTTON" onclick="javascript:chkExec()">
    </body>
    </body>在JSP 中是用 单引号的。
      

  6.   

    <head>
    <script type="text/javascript">
    function chkExec(){
    }
    </script>
    </head>
      

  7.   

    <!doctype html public "-//W3C//DTD XHTML 1.0 transitional//EN"
      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <meta name="Generator" content="EditPlus" />
    <meta name="Author" content="cybernaute(思客)" />
    <meta name="Copyright" content="" />
    <meta name="Keywords" content="" />
    <meta name="Description" content="" />
    <title> New Document </title>
    <script type="text/JavaScript">
    <!--
    function aa() {
    alert("aaaaa");
    }
    function bb() {
      alert("bbbbb");
    }
    //-->
    </script>
    </head><body>
    <input type="button" value="aa" onclick="aa();">
    <body>
    <input type="button" value="bb" onclick="bb();">
    </body>
    </body>
    </html>在IE6和firefox1.0下没有出现错误,但建议慎用body嵌套。