Tag: frontend

从JavaScript传递并获取ID到PHP控制器

我有一个内联可编辑表(我使用了Tabledit ),每行都有一个ID,ID应传递给控制器​​操作(Yii2),以便我将编辑后的数据保存到数据库中。 这是我的js文件中的Tabledit代码: file.assetID = info.response; // the ID for (var i = 0; i < file.length; i++) { // the table if (file[i].type == "image/jpeg") { var type = "photo"; } else if (file[i].type == "video/mp4") { var type = "video"; } messageHtml += '’; messageHtml += ” + file[i].assetID + ”; messageHtml += […]

Ckeditor和Lightbox不起作用

美好的一天! 我通过这个http://ckeditor.com/addon/lightbox指令做了一切,但我总是产生这个错误(当按下按钮灯箱时):未捕获的TypeError:无法读取未定义的属性’split’ 码: Replace Textarea by Code — CKEditor Sample CKEditor Samples » Replace Textarea Elements Using JavaScript Code This editor is using an <iframe> element-based editing area, provided by the Wysiwygarea plugin. CKEDITOR.replace( ‘textarea_id’ ) CKEDITOR.replace( ‘editor1’ ); CKEditor – The text editor for the Internet – http://ckeditor.com Copyright © 2003-2015, CKSource – Frederico […]

当插入符号位于特定div / span / a标记内时,以及当插入符号离开标记时,触发事件

这个想法是这样的 – 有一个含有一些文本的满足要素。 我试图构建一个标记机制(类似于在键入’@’时twitter的人员标记)。 每当用户键入“@”时,它会在他们继续输入时显示带有建议和filter的弹出窗口。 直到这里它很容易,我已经弄清楚了。 如果/仅当插入符号位于包含标记的元素上时,我需要显示弹出窗口时出现问题。 Some random text before @samadams Some random text after 现在,每当用户将标签移动到标签/点击它时,我想触发一个显示弹出窗口的事件,并在插入符号离开标签时将其删除。 (有点像焦点/模糊,但它们似乎不起作用)。 onmousedown工作,但无法判断光标是否已通过键盘移动到锚标签中。 此外,我在angularjs中这样做,因此,任何针对此的解决方案都是优选的,但不是必需的。 一直试图让这个工作一天,任何帮助非常感谢。

如何从json为100个项目创建html而不创建100个单个html文件?

我开发了一个带有phonegap和jquery mobile的应用程序。 我有100个项目,需要单页。 html对所有人来说都是一样的。 它只是显示名称和一些信息。 如何解析我的html中的1个项目并显示信息而不创建100个单个html文件? 我把所有的信息都当作json。 编辑:用户点击这100个项目中的一个,然后将出现新页面

从webpack导入owl.carousel

我是F2E世界的新手。 我刚刚使用create-react-app创建了一个Web应用程序。 ( https://github.com/facebookincubator/create-react-app ) 我想将owl.carousel导入到我的项目中,以便我遵循NPM( https://www.npmjs.com/package/owl.carousel )的指南,其语法是: import $ from ‘jquery’; import ‘imports?jQuery=jquery!owl.carousel’; 但调试器控制台指示错误: Unexpected ‘!’ in ‘imports?jQuery=jquery!owl.carousel’. Do not use import syntax to configure webpack loaders import/no-webpack-loader-syntax 我尝试了另一种语法: import owlCarousel from ‘owl.carousel’ 而错误将是: Uncaught TypeError: Cannot read property ‘fn’ of undefined 有人可以帮我弄清楚发生了什么吗? 谢谢。 更新:我的webpack加载器设置: loaders: [ // Process JS with Babel. { test: […]