随笔分类 -  js

摘要:方法1 $.getScript('/themes/sh/Public/xtpla/js/jquery.plugins.min.js'); 方法2 <script type="text/javascript"> (function() { var bp = document.createElement 阅读全文
posted @ 2020-10-09 15:49 王玉岩 阅读(252) 评论(0) 推荐(0)
摘要:两个js文件中,不生效 加载div的js写在info202009.js文件中, 元素事件写在lbs.js文件中, 虽然使lbs.js放在info202009.js文件之后,但是事件仍然不起作用?? <script src="__TMPL__Public/static/js/info202009.js 阅读全文
posted @ 2020-09-26 10:33 王玉岩 阅读(668) 评论(0) 推荐(0)
摘要:之前php后端调用接口,例如调用远端crm打电话接口,不会考虑跨域问题。 但是在js里面,,,,,如果是跨域请求,那么需要处理一下 不处理就会报一下错误: 阅读全文
posted @ 2020-08-27 10:23 王玉岩 阅读(113) 评论(0) 推荐(0)
摘要:<button onclick="nihao(this)">你好</button> <script> function nihao(obj){ console.log(obj); console.log(this); console.log($(obj)); console.log($(this)) 阅读全文
posted @ 2020-07-08 16:04 王玉岩 阅读(125) 评论(0) 推荐(0)
摘要:<div class="info"> <div class="content"> <span>1</span> <span>2</span> </div> <div class="content"> <span>3</span> <span>4</span> </div> </div> consol 阅读全文
posted @ 2020-07-08 15:50 王玉岩 阅读(109) 评论(0) 推荐(0)
摘要:jquery each 遍历对象和数组 jquery中each可用于遍历对象和数组,如需退出each循环可使回调函数返回false 1. $().each(),dom数组 !!! 回调函数拥有两个参数:第一个为对象的成员或数组的索引,第二个为对应变量或内容。如需退出each循环可使回调函数返回fal 阅读全文
posted @ 2020-07-08 15:27 王玉岩 阅读(104) 评论(0) 推荐(0)
摘要:var file = files[0]; var reader = new FileReader(); reader.onload = function() { document.getElementById("filecontent").innerHTML = this.result; }; re 阅读全文
posted @ 2018-02-07 17:02 王玉岩 阅读(160) 评论(0) 推荐(0)
摘要:1.字符串 $this->assign('id',$id); var health_id = '<?php echo $id;?>'; 2-1数组 $this->assign('cycle', ArchivesUtil::CYCLE); var cycle = eval("(" + '<?php e 阅读全文
posted @ 2017-12-09 09:32 王玉岩 阅读(1178) 评论(0) 推荐(0)
摘要:<img src="{pigcms{$static_path}community/img/shequ01.png" alt=""/><input class="ipt-file" id="file1" type="file" name="img"/> //图片预览function aaa(id) { 阅读全文
posted @ 2017-12-05 09:36 王玉岩 阅读(179) 评论(0) 推荐(0)
摘要:Document 阅读全文
posted @ 2017-12-05 09:35 王玉岩 阅读(56) 评论(0) 推荐(0)
摘要:var a = {a:1, b:2}; console.log(JSON.stringify(a)); //输出 {"a":1,"b":2} console.log(a.a); //输出 1 阅读全文
posted @ 2017-12-05 09:07 王玉岩 阅读(137) 评论(0) 推荐(0)