0

在我的 html 上,我有这个标签供用户从他们的计算机上浏览文件,就像这样

   *<form action="SamePageUpload.php" method="post"
    enctype="multipart/form-data">
   <label for="file">Filename:</label>
   <input type="file" name="file" id="file"><br>
   <input type="submit" name="submit" value="FINISH" onClick="echoHello()">
   </form>*

通过点击提交按钮,它会触发'echoHello()'js函数,我想将图像传递给一个php文件SamePageUpload.php

*

<script>
        function echoHello()
                {
                     var url = "SamePageUpload.php";
                     var cv = ????;
                    $.post(url, {contentVar: cv}, function(data){      
                        $("#alertDiv").html(data).show();
                    });

                 }
    </script>*

但我不知道是什么????应该分配给 cv,我想知道代表图像文件用户选择的变量是什么?请帮忙,谢谢


使用Option.bind

let f g x = if x < 0 then None else Option.bind g (Some x)
4

0 回答 0