Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/451.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/joomla/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 当我尝试从小程序调用方法时,会出现“对象不支持此属性或方法”_Java_Javascript_Html_Css_Applet - Fatal编程技术网

Java 当我尝试从小程序调用方法时,会出现“对象不支持此属性或方法”

Java 当我尝试从小程序调用方法时,会出现“对象不支持此属性或方法”,java,javascript,html,css,applet,Java,Javascript,Html,Css,Applet,对象不支持此属性或方法在javascript中出现,并在第行停止,在该行中,Liferay Portal将处理来自小程序的方法调用 javascript代码段: <script type="text/javascript"> function processSigning(){ var applet = document.applets["SignApplet"]; var path_to_certificate = document.getE

对象不支持此属性或方法在javascript中出现,并在第行停止,在该行中,Liferay Portal将处理来自小程序的方法调用

javascript代码段:

<script type="text/javascript">
    function processSigning(){
        var applet = document.applets["SignApplet"];
        var path_to_certificate = document.getElementById("certificate").value;
        var pass = document.getElementById("password").value;
        var filePath = document.getElementById("documentSign").value;
        applet.filePath = document.getElementById("documentSign").value;

        //at this line, call of method from applet, javascript stops, but applet has this method
        //and it's public
        applet.profileTestPKCS12(path_to_certificate, pass);

        document.getElementById("file").value = applet.getDocumentString(filePath);
        document.getElementById("sign").value = applet.getSignString();
        document.getElementById("cert").value = applet.getCertificateString();
        document.forms['mainForm'].submit();
//        document.getElementById("mainForm").submit();


    }
</script>
小程序的html代码段:

<APPLET name="SignApplet" mayscript code="SignApplet.class" archive="<%=renderResponse.encodeURL(renderRequest.getContextPath() + "/lib/SignApplet.jar")%>, <%=renderResponse.encodeURL(renderRequest.getContextPath() + "/lib/crypto.tsp.jar")%>, <%=renderResponse.encodeURL(renderRequest.getContextPath() + "/lib/crypto.gammaprov.jar")%>" height=500 width=500 style="display:none;">
    <PARAM name="boxmessage" value="Please wait, while applet is loading">
</APPLET>
W3C的网站

无价值 该值会导致元素不会出现在格式化结构中,即在可视媒体中,该元素不会生成框,并且对布局没有影响。子元素也不会生成任何框;元素及其内容将完全从格式化结构中删除

W3C的网站

无价值 该值会导致元素不会出现在格式化结构中,即在可视媒体中,该元素不会生成框,并且对布局没有影响。子元素也不会生成任何框;元素及其内容将完全从格式化结构中删除


在小程序中,u应避免使用display:none。。。。。当u定义为“无”时,在视觉媒体中,元素不会生成框,并且对布局没有影响。。。。因此,最好在小程序中尝试visiblity:hidden属性,而不是display:none…

您应该避免使用display:none。。。。。当u定义为“无”时,在视觉媒体中,元素不会生成框,并且对布局没有影响。。。。因此,最好尝试visiblity:hidden属性,而不是display:none…

错误发生在哪一行?在此小程序中。profileTestPKCS12path\u to\u证书,pass;这听起来可能很傻,但为了防止此类问题,我通常会验证对象是否存在。类似于:ifdocument.applets[SignApplet]{//do stuf…}如果它不存在怎么办,但我必须使用这个applet?在哪一行发生错误?在这个applet.profileTestPKCS12path_to_证书,pass;这听起来可能很傻,但为了防止此类问题,我通常会验证对象是否存在。类似于:ifdocument.applets[SignApplet]{//do stuf…}如果它不存在怎么办,但我必须使用这个小程序?实际上我不需要显示小程序,它进行计算实际上我不需要显示小程序,它进行计算
<APPLET name="SignApplet" ... style="display:none;">