我有一个aspx页面,我想在点击一个按钮后启动一些javascript。像这样......
<p><input type='image' src='http://images.aviary.com/images/edit-photo.png' value='Edit photo' onclick="return launchEditor('imgClub', ' <%= imgClub.ImageUrl.ToString()%> ');" /></p>
javascript在下面(它是Adobe的Aviary / Feather)
<script type='text/javascript'>
var featherEditor = new Aviary.Feather({
apiKey: 'your-key-here',
apiVersion: 3,
theme: 'dark', // Check out our new 'light' and 'dark' themes!
tools: 'all',
appendTo: '',
onSave: function(imageID, newURL) {
var img = document.getElementById(imageID);
img.src = newURL;
},
onError: function(errorObj) {
alert(errorObj.message);
}
});
function launchEditor(id, src) {
featherEditor.launch({
image: id,
url: src
});
return false;
}
</script>
问题是我在
的<% imgClub.ImageUrl.ToString()%>
收到错误
onclick="return launchEditor('imgClub', ' <%= imgClub.ImageUrl.ToString()%> ');"