Find ueditor.all.js under the root directory of the editor. It scares me when I open it. There are tens of thousands of lines of code, but don’t be afraid. Search: cllback() to find this function
function callback(){ try{ var link, json, loader, body = (iframe.contentDocument || iframe.contentWindow.document).body, result = body.innerText || body.textContent || ''; json = (new Function("return " + result))(); link = me.options.imageUrlPrefix + json.url; if(json.state == 'SUCCESS' && json.url) { loader = me.document.getElementById(loadingId); loader.setAttribute('src', link); loader.setAttribute('_src', link); loader.setAttribute('title', json.title || ''); loader.setAttribute('alt', json.original || ''); loader.setAttribute('style','max-width:650px');//这里就是哥加入的代码 loader.removeAttribute('id'); domUtils.removeClasses(loader, 'loadingclass'); }
The above introduces how to set the default width and height when uploading images in Baidu ueditor, including the content. I hope it will be helpful to friends who are interested in PHP tutorials.