PhoneGap использовать Filepicker Corodova - PullRequest
1 голос
/ 06 октября 2019

Я - новый разработчик PhoneGap, и я попытался использовать плагин Corodova, поэтому я установил его вот так

cordova plugin add cordova-plugin-chooser

, и он установил его последовательно, а затем импортировал в свое приложение PhoneGap вот так

<plugin name="cordova-plugin-chooser" />

и я получаю ошибку

refernceerror filepicker is not defined

и это мой код

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
        <title>stop studio</title>
		
    </head>
    <body>
	<div class="center">
	<lu> 
	<li>
	<button id="newp" onclick="ff()"><h1>new   f photo</h1></button>
	</li>
	<li>
		<button id="newv" ><h2>new video</h3></button>
		<button id="save" background-color="green"><p>save</p><button>
		</li>
	
		
		
		</lu>
		<p id="hi">fuc</p>
		</div>
		  <style>
		  #newv{
		  background-color:#f26d49;
		  }
		  #save{
		  background-color:#7340c9;
		  }
		  #newp{
		  background-color:#3dffff;
		  }
		  li{
		   list-style-type: none;
		  }
		  .center{
		   margin: auto;
  width: 50%;

  border: 3px solid green;
  padding: 10px;
		  }
		  </style>
		  <plugin name="cordova-plugin-chooser" />
		  
		  <script>


	
		  function ff()
		  {
		  try {
			  FilePicker.pickFile(successCallback,errorCallback);
function successCallback(path) {
  alert("You picked this file: " + path);
}
}
catch(error) {
  alert(error);
  // expected output: ReferenceError: nonExistentFunction is not defined
  // Note - error messages will vary depending on browser
}

		  alert("hi");
	
}
</script>

        <script type="text/javascript" src="cordova.js"></script>
    </body>
</html>
...