我写了一个基于jCrop的extedned插件,一个接一个地裁剪多个图像.
我使用Chrome开发和调试,一切正常,没有任何JavaScript问题.当我在资源管理器中进行测试时,它崩溃并抛出一个写出的脚本错误
jcrop api is null or not an object
所以我的javascript很简单......
var jcrop_api; //Global var to be used thorugh out the client
//some code here
//jCrop documention tells us to use this to assign itself to an object.
//I look for both because i use .net masterpages and sometimes not.
$('#SourceImage, #body_SourceImage').Jcrop({},function () { jcrop_api = this; });
//some more code but not far down the line i need to set jCrop options using API
jcrop_api.setOptions({
boxWidth: bw,
onSelect: updateCoords, …Run Code Online (Sandbox Code Playgroud)