【ueditor】api方法
//让其选中文本高亮
editor.selection.getRange().select();
//高亮后,才能获取到选中文本,当选中字失去焦点的情况下是获取不到的选中文本的
var text = editor.selection.getText(); /**测试**/
console.log("^_^");
/**测试**/ //给选中的文本,增加a标签
editor.selection.getRange().applyInlineStyle("a",{"href":url,"target":"_blank","name":"pc"}); //创建一个节点
var node=document.createElement("span");
//拼接安卓/IOS的商品详情的超链
node.innerHTML="<a href=\"#\" name=\"ios\" style=\"display: none;\" onclick=\"IOSOpen()\">"+text+"</a>"
+"<a href=\"#\" name=\"android\" style=\"display: none;\" onclick=\"AnDroidOpen()\">"+text+"</a>";
//选中文本后增加节点
editor.selection.getRange().insertNode(node);
【ueditor】api方法的更多相关文章
- Xcode itunes完美打包api方法
转:http://bbs.csdn.net/topics/390948190 Xcode6 itunes完美打包api 方法! 特点轻盈小巧,方便快捷!
- 外部调用mvc的api方法时,如何解决跨域请求问题?
首先,创建一个mvc项目(包含webapi),我们模拟一个场景 1)在项目的Controller 创建一个WeiXinApiController public class WeiXinApiContr ...
- Xcode6 itunes完美打包api 方法
转:http://bbs.csdn.net/topics/390948190 Xcode6 itunes完美打包api 方法! 特点轻盈小巧,方便快捷!
- Atitit. 衡量项目规模 ----包含的类的数量 .net java类库包含多少类 多少个api方法??
Atitit. 衡量项目规模 ----包含的类的数量 .net java类库包含多少类 多少个api方法?? 1 framework 4.5 (10万个api)1 2 Jdk8 57M1 3 Gi ...
- Java中的API方法总结
API方法总结 File file = new File(path); #创建文件对象,指向一个目录 file.exists() #判断目录或者文件是否存在 File[] files = file.l ...
- C#MVC通过AJAX调用API方法进行上传下载
//这是写的一个类,具体是上传图片的上传和下载 public class FileResult { public int Code { get; set; } pub ...
- 【ASP.NET Core】MVC模型绑定——实现同一个API方法兼容JSON和Form-data输入
在上一篇文章中,老周给大伙伴们大致说了下 MVC 下的模型绑定,今天咱们进行一下细化,先聊聊模型绑定中涉及到的一些组件对象. ------------------------------------- ...
- js常用API方法
String对象常用的API:API指应用程序编程接口,实际上就是一些提前预设好的方法. charAt() 方法可返回指定位置的字符. stringObject.charAt(index) index ...
- IDEA设置显示中文文档API方法说明
首先,我们从网上下载好对应的java最新的中文api文档,chm格式的 chm其实相当于一个压缩包,里面有许多html文件 让IDEA显示中文文档,其实原理就是是让IDEA把java的api的对应ht ...
随机推荐
- 无法安装Windows Live“OnCatalogResult:0x80190194”错误的解决方法
今天想安装一个博客客户端,结果安装一直报错"OnCatalogResult:0x80190194",百度查到了解决发放再此记录下来,以备后用. 到官网下载了一个在线安装程序,可是一 ...
- 4-iscsi
Iscsi 1. 创建lvm 2. 安装scsi服务端软件包 第一种(命令模式) 第二种(配置文件模式) 客户端 Node1 寻找scsi服务器上的储存设备 将scsi设备挂载 ...
- [LeetCode] Add Strings 字符串相加
Given two non-negative numbers num1 and num2 represented as string, return the sum of num1 and num2. ...
- [LeetCode] Design Phone Directory 设计电话目录
Design a Phone Directory which supports the following operations: get: Provide a number which is not ...
- [LeetCode] The Skyline Problem 天际线问题
A city's skyline is the outer contour of the silhouette formed by all the buildings in that city whe ...
- [LeetCode] Surrounded Regions 包围区域
Given a 2D board containing 'X' and 'O', capture all regions surrounded by 'X'. A region is captured ...
- [LeetCode] Remove Duplicates from Sorted List II 移除有序链表中的重复项之二
Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numb ...
- [LeetCode] Letter Combinations of a Phone Number 电话号码的字母组合
Given a digit string, return all possible letter combinations that the number could represent. A map ...
- D3D三层Texture纹理经像素着色器实现渲染YUV420P
简单记录一下这两天用Texture实现渲染YUV420P的一些要点. 在视频播放的过程中,有的时候解码出来的数据是YUV420P的.表面(surface)通过设置参数是可以渲染YUV420P的,但Te ...
- Android工程的编译过程
现在很多人想对Android工程的编译和打包进行自动化,比如建立每日构建系统.自动生成发布文件等等.这些都需要我们对Android工程的编译和打包有一个深入的理解,至少要知道它的每一步都做了什么,需要 ...