由于现有seajs等封装,jQuery等已不在全局暴露,即使网站中已使用jQuery,在console也使用不了。

在chrome中可以用以下代码加入jQuery:

fetch('//code.jquery.com/jquery-latest.min.js').then(r => r.text()).then(r => eval(r))

POST JSON 数据:


jQuery.ajax({
"url":"/someurl",
"method":"POST",
"headers": { "Content-Type": "application/json"},
"dataType":"JSON",
"processData":false,
"data":JSON.stringify({}),
"success": function(data){
console.log(data);
copy(data);
}
})

POST application/x-www-form-urlencoded 数据

jQuery.ajax({
"url":"/url",
"method":"POST",
"dataType":"JSON",
"data": {"key": "value"},
"success": function(data){
console.log(data);
}
})

jQuery.ajax({
"url":"/url",
"method":"POST",
"dataType":"JSON",
"processData":false,
"data": jQuery.param({"key": JSON.stringify(object)}),
"success": function(data){
console.log(data);
}
})

来自: stackoverflow

在chrome console中添加jQuery的更多相关文章

  1. 如何在网页中添加 jQuery。

    转自:http://www.runoob.com/jquery/jquery-install.html 网页中添加 jQuery 可以通过多种方法在网页中添加 jQuery. 您可以使用以下方法: 从 ...

  2. 浏览器console中加入jquery,测试选择元素

    一.chrome浏览器F12打开调试界面,在console中输入(firefox同样可以): var jquery = document.createElement('script'); jquery ...

  3. 在django模板中添加jquery

    路径 /project_name /app_name /templates /index.html /project_name setting.py /static /js jquery.js 导入方 ...

  4. 在Chrome Console中加载jQuery

    var jq = document.createElement('script'); jq.src = "//ajax.googleapis.com/ajax/libs/jquery/1/j ...

  5. vs2013在用户控件中添加jquery智能提示

    一.在script文件夹下面添加_references.js文件夹 二.把jquery文件拖到该文件中 保存,重新打开相应的文件,即出现智能提示

  6. [No000014D]chrome console 调试 引入 jquery等外部库

    var importJs=document.createElement('script') //在页面新建一个script标签 importJs.setAttribute("type&quo ...

  7. 再eclipse的javaweb项目中添加JQuery文件时jquery-2.1.4.min.js报错

    解决方法: eclipse导入jquery包后报错,下面有个不错的解决方法,需要的朋友可以参考下 eclipse导入jquery包后报错,处理步骤如下: 1.打开项目.project文件,去掉如下内容 ...

  8. 浏览器console中加入jquery方便调试

    var jquery = document.createElement('script'); jquery.src = "http://apps.bdimg.com/libs/jquery/ ...

  9. chrome console控制台引入jquery库

    var jqueryJs=document.createElement('script');jqueryJs.setAttribute("type","text/Java ...

随机推荐

  1. 通过sql查找指定字段存在哪些表中

    select * from INFORMATION_SCHEMA.columns where COLUMN_NAME Like '%order_type%';

  2. css IFC 与 BFC分析

    在我们做的网页上通常最重要的其中一点就是美观度,bfc他是一个块级格式化上下文,它是一个独立的渲染区域,只有Block-level box参与, 它规定了内部的Block-level Box如何布局, ...

  3. java自定义注释

    一.什么是注释 说起注释,得先提一提什么是元数据(metadata).所谓元数据就是数据的数据.也就是说,元数据是描述数据的.就象数据表中的字段一样,每个字段描述了这个字段下的数据的含义.而J2SE5 ...

  4. Wpf TemplateBinding

    TemplateBinding. ControlTemplate最终会被用到一个控件上,我们称这个控件为模板目标控件或者模板化控件,ControlTemplate里面的控件可以使用TemplateBi ...

  5. Spring EnableWebMvc vs WebMvcConfigurationSupport

    EnableWebMvc vs WebMvcConfigurationSupport spring doc解释 WebMvcConfigurationSupport: This is the main ...

  6. kickstart文件制作与光盘镜像制作

    kickstart文件,是linux(Redhat.Centos.Fedora)下的anaconda安装程序的配置文件,基于此文件,可以实现linux的无人值守安装,在需要大规模部署安装linux的情 ...

  7. cookie 就是一些字符串信息

    什么是 Cookie “cookie 是存储于访问者的计算机中的变量.每当同一台计算机通过浏览器请求某个页面时,就会发送这个 cookie.你可以使用JavaScript 来创建和取回cookie 的 ...

  8. 使用Visual Studio 2017 C++17模块(module)特性

    环境: win7_x64旗舰版.VS2017企业版 一.安装VS2017 1.1 安装VS2017时,必须要勾选“使用C++的modules开发”选项 1.2 安装成功后,会在VS安装目录Micros ...

  9. IntelliJ IDEA自动导入包去除星号(import xxx.*)

    打开设置>Editor>Code Style>Java>Scheme Default>Imports ① 将Class count to use import with ...

  10. Delphi 10.2.3

    链接: https://pan.baidu.com/s/1Fy2LbcpmujOiqtNZ3ZySOQ 提取码: ts5k