抱歉标题,我知道它凌乱,但我不知道我怎么能描述这种情况.
我们有一个输入字段.但没有形式元素.这是代码
<input name="search" id="search" onkeypress="SearchBox(this.value);" type="text" value="Search"/>
<input name="searchbutton" align="left" class="okbutton" id="searchbutton" onclick="SearchBox(search.value);" type="button"/>
Run Code Online (Sandbox Code Playgroud)
SearchBox函数检查keycode,如果是13(输入按钮charcode)发送搜索请求.此代码适用于IE8/9,但在IE10中有一些有趣的行为.
上面的代码页面中间.我们在LOGIN的页面顶部有一个按钮元素.
在IE10中;
我在输入中输入一个单词并按回车键:
注意:抱歉语言,英语不是我的母语.注2:删除了SearchBox()函数.检查jsfiddle链接以获取最新代码.
我搜索了很多但没有找到从剪贴板获取base64编码数据.我可以捕获粘贴事件,然后将事件分配给变量
clipBoard = e.clipboardData ? e.clipboardData : window.clipboardData;
Run Code Online (Sandbox Code Playgroud)
在铬; 我可以得到已粘贴的打印屏幕,就像这样
if (clipBoard.types[0] == "Files") {
var blob = clipBoard.items[0].getAsFile();
var reader = new FileReader();
reader.onload = function(event){
console.log(event.target.result);
}; // data url!
reader.readAsDataURL(blob);
}
Run Code Online (Sandbox Code Playgroud)
但是在11中,clipBoard变量没有"items"或"types".我将上传该图像服务器,但我没有得到base64编码数据.
我正在做一个网站项目。我在 Google Developers Console 上创建了一个应用程序,并在我的服务器上安装了 Google SDK。授权完成,离线访问完成,列出所有文件/目录完成,创建文件完成。
现在我想列出位于根目录中的文件/目录。我的意思是只有那些不是所有的子目录。
这是代码示例:
// $client is a Google_Client object
$service = new Google_Service_Drive($client);
// Print the names and IDs for up to 10 files.
$optParams = array(
'pageSize' => 10,
'fields' => "nextPageToken, files(contentHints/thumbnail,fileExtension,iconLink,id,name,size,thumbnailLink,webContentLink,webViewLink,mimeType,parents)",
'q' => "trashed=false"
);
$results = $service->files->listFiles($optParams);
if (count($results->getFiles()) == 0) {
print "No files found.\n";
} else {
print "Files:\n";
foreach ($results->getFiles() as $file) {
echo "Dosya Ad?: ".$file->getName()."<br>";
echo "Dosya Id: ".$file->getId()."<br>";
echo "Tip: ".$file->getMimeType()."<br>";
echo "Dosya Link: …Run Code Online (Sandbox Code Playgroud)