textarea

求助!js无法获取<textarea></textarea>中的值

♀尐吖头ヾ 提交于 2020-02-27 10:57:01
< ! DOCTYPE html > < html lang = "en" > < head > < meta charset = "UTF-8" > < meta name = "viewport" content = "width=device-width, initial-scale=1.0" > < meta http - equiv = "Content-Type" content = "text/html; charset=UTF-8" / > < title > Get weather information ( GWI ) < / title > < style > #testarea { margin : 0 px ; width : 1541 px ; height : 404 px ; } #submit { height : 12 px ; width : 6 px ; } < / style > < / head > < body > <?php require ( 'functionDefine.php' ) ; $requestKey = array ( array ( //www.heweather.com array ( 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' ,

跨文档消息传递 postMessage

孤人 提交于 2020-02-27 05:09:58
一、跨文档消息传递 1. postMessage 发送信息 向当前页面的 <iframe> 元素传送数据 // 接收方window对象.postMessage( "message", "接收方域名" ); var iframeWindow = document.getElementById("myframe").contentWindow; //contentWindow iframeWindow.postMessage("a secret","http://www.wrox.com"); //向内嵌框架发送消息 接收信息 该方法触发接收方 window 对象的 message 事件,并且传递个 onmessage处理程序的 event 包括以下三方面信息 data:postMessage()第一个参数传过来的 message,最好只传字符串 (结合: JSON.stringify(), JSON.parse() ) origin: 发生消息的文档所在的域 source: 发送消息的文档的 window对象 代理 //接收到其他窗口发送过来的信息 window.addEventListener("message", function(event){ event.source.postMessage("收到",event.origin) //向原窗口发送回执 }) 2. 例子 外层

在jQuery中设置textarea的值

左心房为你撑大大i 提交于 2020-02-27 00:36:46
我正在尝试使用jquery通过以下代码在textarea字段中设置值: $("textarea#ExampleMessage").attr("value", result.exampleMessage); 问题是,一旦执行此代码,就不会更改textarea中的文本吗? 但是,当执行 alert($("textarea#ExampleMessage").attr("value")) ,是否返回新设置的值? #1楼 当页面中有JQuery v1.4.4时,这些都不起作用。 当将JQuery v1.7.1注入我的页面时,它终于可以工作了。 因此,就我而言,是导致问题的原因是我的JQuery版本。 id ==> textareaid ====================== var script1 = document.createElement("script"); script1.src = "http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"; document.body.appendChild(script1); var script2 = document.createElement("script"); script2.type = "text/javascript"; script2

XSS 扫描器成长记

老子叫甜甜 提交于 2020-02-25 23:18:47
作者:w7ay @知道创宇404实验室 时间:2020年2月12日 原文地址: https://paper.seebug.org/1119/ 为了实现自动刷SRC的目标,过年前就开始对w13scan的xss扫描功能进行优化,灵感来源于xray所宣称的基于语义的扫描技术。 之前xss扫描是参考 w3af 中的源码,原理也很简单就是暴力的使用xss的payload进行请求,最后在返回文本中查找关键字,xss payload一般有以下几个部分。 后面我认真的学习了一下 Xsstrike 、 Xray 、 Awvs 中的检测技巧以及检测参数,想将它们的优点和为一体。 XSStrike 先说说 Xsstrike ,里面带有xss扫描和fuzz,但感觉xss扫描的效果也不是太理想。不过它的一些特性还是可以学习的。 DOM XSS Xsstrike的dom扫描,是通过正则来分析敏感函数 sources = r'''document\.(URL|documentURI|URLUnencoded|baseURI|cookie|referrer)|location\.(href|search|hash|pathname)|window\.name|history\.(pushState|replaceState)(local|session)Storage''' sinks = r'''eval

教你如何在博客园放“可运行\"代码

可紊 提交于 2020-02-18 20:03:25
原文地址: http://www.cnblogs.com/littledu/archive/2011/05/08/2040298.html 教你如何在博客园放“可运行"代码 自从看到别人的博客可以放上面那种可运行的代码后,我一直在研究这种效果是怎么弄出来的,我知道蓝色理想上面可以在编辑器里直接将代码放进一个可运行的代码框,发布后就是可运行的了。但博客园的默认的三个编辑器里,死活找不到那可运行的按钮。直到昨天,在群里某高手提示说可以自己写一个,然后他给我说了思路,并提供了一个demo,就是在页面嵌入一个textarea,然后单击运行代码时,将textarea里的所有内容在新open的页面里执行,就行了。我在本地测试,实践结果是可行的,但一放上博客园这里,<script>总给过滤掉了,实在是郁闷得很。无奈,昨天又以失败告终。 今天,就在刚刚,我又在某群发问了,另一高手回答了我的问题,我才知道,怎样才能让script不被过滤。下面,是步骤: 1.首先,准备一个textarea,这个文本框里放上我们所要执行的代码,可以是任意代码,比如一个标准的html页,也可以像我下面一样,直接放上一段js代码,如下: 1 <textarea cols= "20" rows= "8" id= "con" > 1 <script type= "text/javascript" > 2 alert(

HTML5 File API

喜你入骨 提交于 2020-02-16 04:41:04
HTML5 引入了一个 File API 用以提供用户上传文件的信息,并允许网页中的 JavaScript 访问其内容。 以下是一些表单 file 控件: <input type="file" accept="video/*;capture=camcorder"> <input type="file" accept="audio/*;capture=microphone"> <input type="file" accept="image/*;capture=camera">直接调用相机(测试安卓可以,iphone还是有相册) <input type="file" accept="image/*" />调用相机 图片或者相册 <input type="file" multiple accept="image/*" />调用相册 1 FileList 对象 FileList 对象针对表单的 file 控件。 当用户通过 file 控件选取文件后,这个控件的 files 属性值就是 FileList 对象。 // 多选控件 <input type='file' multiple /> <script> document.querySelector('input').onchange = function() { console.log(this.files); }; </script>

最好用的web端代码文本编辑器ACE

倾然丶 夕夏残阳落幕 提交于 2020-02-10 08:06:48
使用足够简单,功能足够强大,体验足够优秀 之前有一个系列文章介绍我在运维系统开发过程中用到的那些顺手的前端插件,总共发了四篇文章介绍了三个非常棒的插件,分别是 bootstrap-duallistbox 、 select2 和 datatables ,今天再更此系列,让好东西让更多的人知道,受益! 本次介绍ace.js,这是一个用JavaScript编写的独立代码编辑器。支持超过120种语言的语法高亮,超过20个不同风格的主题,同时还支持实时语法检查,自定义快捷键绑定,代码折叠,搜索替换,自动缩进等等功能 项目地址为: https://ace.c9.io 我主要用它来替换表单中的textarea标签,以及实现在网页上修改文件的展示,例如之前 配置中心Kerrigan 文章中讲到的web端修改配置文件就用了ace 基本使用 这个项目引入非常简单,只需要引入一个ace.js文件即可,然后实例化即可 // 引入js文件 <script src="/static/js/ace.js"></script> <pre id="content" style="height:620px"></pre> // 实例化编辑器 var editor = ace.edit("content"); github上除了源码文件外,ace还贴心的准备了编译好的项目文件,以方便用户使用

Custom CSS to allow chrome textarea resize smaller than initial state?

时间秒杀一切 提交于 2020-02-09 11:29:06
问题 I like Chrome's nifty textarea resize control. However, the one exception is that the textarea appears to have a hard min-height/min-width setting that's not changeable via custom css, even with !important qualifiers. textarea#myTextArea{min-height:0 !important;min-width:0 !important} Is it possible to override this via jQuery perhaps? 回答1: These " min-height / min-width " rely on cols and rows attributes. Eg. if cols is missing or less than 1, its default value is 20, so the minimum width

Custom CSS to allow chrome textarea resize smaller than initial state?

▼魔方 西西 提交于 2020-02-09 11:27:14
问题 I like Chrome's nifty textarea resize control. However, the one exception is that the textarea appears to have a hard min-height/min-width setting that's not changeable via custom css, even with !important qualifiers. textarea#myTextArea{min-height:0 !important;min-width:0 !important} Is it possible to override this via jQuery perhaps? 回答1: These " min-height / min-width " rely on cols and rows attributes. Eg. if cols is missing or less than 1, its default value is 20, so the minimum width

Custom CSS to allow chrome textarea resize smaller than initial state?

半腔热情 提交于 2020-02-09 11:25:26
问题 I like Chrome's nifty textarea resize control. However, the one exception is that the textarea appears to have a hard min-height/min-width setting that's not changeable via custom css, even with !important qualifiers. textarea#myTextArea{min-height:0 !important;min-width:0 !important} Is it possible to override this via jQuery perhaps? 回答1: These " min-height / min-width " rely on cols and rows attributes. Eg. if cols is missing or less than 1, its default value is 20, so the minimum width