JS - 报错:TypeError: e[h] is not a function
提交表单时报错:e[h] is not a function
原因:<button> 的 id 或 name 不可为 submit, 更名后即可。
提交表单时报错:e[h] is not a function
原因:<button> 的 id 或 name 不可为 submit, 更名后即可。
public function indexAction() {
//获取父级代号pid
$pid = $this->getParam('pcode');
//数据查询
$areaModel = new Model_Area();
$fields = "*";
$whereArr[] = array('pid', $pid);
$areadetail = $areaModel->getArea($fields, $whereArr);
//var_dump($areadetail);
echo json_encode($areadetail);
}
<script type="text/javascript" src="//g.alicdn.com/dingding/open-develop/0.8.4/dingtalk.js"></script>
内部代码如下,作用是实现二维码的展现。
<script>
!function (window, document) {
function d(a) {
var e, c = document.createElement("iframe"),
d = "https://login.dingtalk.com/login/qrcode.htm?goto=" + a.goto ;
//console.log(d);
d += a.style ? "&style=" + encodeURIComponent(a.style) : "",
d += a.href ? "&href=" + a.href : "",
c.src = d,
c.frameBorder = "0",
c.allowTransparency = "true",
c.scrolling = "no",
c.width = a.width ? a.width + 'px' : "365px",
c.height = a.height ? a.height + 'px' : "400px",
e = document.getElementById(a.id),
e.innerHTML = "",
e.appendChild(c)
}
window.DDLogin = d
}(window, document);
</script>
$userinfo = json_decode($userinfo, true);
$count = json_decode(json_encode($count), true);
foreach($simplelist as $obj){
echo "姓名:".$obj->name." uerid:".$obj->userid."<br/>";
}
var ue = UE.getEditor('editor2', {
toolbars: [[
'source', '|', 'undo', 'redo', '|',
'bold', 'italic', 'underline', '|',
'selectall', 'cleardoc', '|',
'fontfamily', 'fontsize', '|',
'justifyleft', 'justifycenter', 'justifyright', 'justifyjustify', '|',
'simpleupload', '|',
'removeformat', '|'
]],
iframeCssUrl: '../ueditor/themes/editor2.css',
initialFrameHeight:500,
enableAutoSave: false,
enableContextMenu: false,
elementPathEnabled : false,
focus:false,
autoHeightEnabled:false
});
var arr1 = new Array(3);
arr1[0] = "a";
arr1[1] = "b";
arr1[2] = "c";
arr1[3] = "d";
var arr2 = new Array(3);
arr2[0] = "x";
arr2[1] = "y";
arr2[2] = "z";
console.log(arr1);
console.log(arr2);
var length = arr1.length;
console.log(length);
var arr3 = new Array(3);
for(var j=0;j<length;j++){
var a = 2*j;
console.log(a);
var b = 2*j+1;
console.log(b);
arr3[a]=arr1[j];
arr3[b]=arr2[j];
}
console.log(arr3);
var str = arr3.join("");
console.log(str);
//axbyczd
if(confirm('确认删除图片' + selectItem.join(",") + '吗?')) {
$.ajax({
url: "del/batchdel",
type: 'POST',
dataType: 'json',
data: 'items=' + selectItem.join(","),
success: function (data) {
if (data.code == 200) {
errorDis(data.info);
refresh();
} else {
errorDis(data.info);
return false;
}
}
});
}
function download(src) {
var a = document.createElement('a');
a.setAttribute("href", src);
a.setAttribute("download", "");
var evObj = document.createEvent('MouseEvents');
evObj.initMouseEvent( 'click', true, true, window, 0, 0, 0, 0, 0, false, false, true, false, 0, null);
a.dispatchEvent(evObj);
};
//实例化编辑器editor
var ue = UE.getEditor('editor');
//实例化编辑器editor2
var ue2 = UE.getEditor('editor2');
function removeformat() {
//全选
ue.execCommand('selectall');
//未格式化的内容
var content1 = ue.getContent();
//清除格式
ue.execCommand('removeformat');
//格式化后的内容
var content2 = ue.getContent();
//过滤掉
content2 = content2.replace(/ /g, "");
//过滤掉<p><br/></p>
content2 = content2.replace(/<p><br\/><\/p>/g, "");
//保留原来的内容
ue.setContent(content1, false);
//将内容赋予编辑器2
ue2.setContent(content2, false);
}