`
韩悠悠
  • 浏览: 826896 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
社区版块
存档分类
最新评论

window.location.search

    博客分类:
  • web
 
阅读更多

location.search   返回“?”以及以后的内容,如“http://www.a.com/b/c.asp?selection=3&jumpto=4”,location.search返回"?selection=3&jumpto=4";如果地址里没有“?”,则返回空字符串。

 

var  url=document.location.search;  
   
  if(url.indexOf("?")!=-1)  
  {  
  var   str   =   url.substr(1)  
   
  }

分享到:
评论

相关推荐

    获得当前页面的url

    location.search; //获取url中"?"符后的字串 document.referrer 获取来路的url,相当于php的$_SERVER['HTTP_REFERER']。 encodeURIComponent() 对url进行转定义,相当于php的urlencode()函数。

    html5手机微信端网页获取微信会员资料微信头像昵称openid,asp、php、jsp、js、ajax微信网站微信登录接口源码

    本微信登录代码主要适用于手机... var r = window.location.search.substr(1).match(reg); if ( r != null ){ return unescape(r[2]); } else { return null ; } }//获取url中传递过来的值window.onload = function(){

    子窗口向父窗口传递值

    当然打开子窗口可用window.open()或window.showModalDialog()[与window.showModelessDialog()类似]....id1=qurey1&id2=query2",在子窗口中用window.location.search来获取该请求字符串.再利用字符串分割便可获得数据.

    push-parse:使用解析为Phonegap推送通知插件

    适用于Cordova / PhoneGap的push-parse插件 使用解析推送通知服务这插件添加推送通知到PhoneGap的应用程序必须有一个应用 用法 用法示例: var channel = "test" ; var message = "message" ;... location . search

    test-disabling-loading-routes

    测试禁用加载路由创建该项目的目的是演示将loading操作添加到您的应用... window . location . search . includes ( 'skipLoading' ) ) { return true ; } }} 在此演示中,导航应具有以下结果: 导航到/posts/ ,路线

    24小时弹一次窗代码

    offset += search.length; // set index of beginning of value end = window.document.cookie.indexOf(";", offset) // set index of end of cookie value if (end == -1) end = window.document.cookie.length...

    JavaScript权威指南

    The Location Object Section 13.10. The History Object Section 13.11. Multiple Windows and Frames Chapter 14. The Document Object Section 14.1. Document Overview Section 14.2. Dynamically ...

    location-origin.js:[removed].origin 的 Polyfill

    window . location . origin ; //=> "http://localhost:8888" 安装 包管理器 bower install location-origin npm install location-origin // You don't have to assign it to a variable. // It automatically ...

    城市热点客户端

    a.document.getElementById("link").click()}}else if(a.location.search.match("[?&]frm="))a.setTimeout(function(){var e= a.document.getElementById("frm");if(e.value){e.value="";a.history.back(1)}else{e....

    js使用小技巧

    网页传递参数 location.search(); 可编辑 obj.contenteditable=true 执行菜单命令 obj.execCommand 双字节字符 /[^x00-xff]/ 汉字 /[u4e00-u9fa5]/ 让英文字符串超出表格宽度自动换行 word-wrap: ...

    基于extjs的.NET3.5控件Coolite 1.0.0.34580(Preview预览版)

    rendered into the location of the ResourcePlaceHolder. Example (New) 44. Renamed <ext:ViewPort> to <ext:Viewport>. Change to lowercase "p". 45. Renamed <Body> inner property to ...

    newMap地图

    /^\w+:\/\//.test(a)){var c=window.location,d=c.port?":"+c.port:"",e=c.protocol+"//"+c.host.split(":").shift()+d;if(a.indexOf("/")===0)a=e+a;else{var f=c.pathname.split("/");f.pop(),a=e+f.join("/")+"/...

    Optimization Modelling A Practical Approach

    List of Figures...................................................................................................... xv List of Tables ...................................................................

    remota

    雷莫塔船。...( ( ) => { const query = new URLSearchParams ( new URL ( window . location . href ) . search ) ; const code = query . get ( "code" ) ; if ( ! code ) return ; const remota = Re

    FlexGraphics_V_1.79_D4-XE10.2_Downloadly.ir

    - FIX: The TFlexPanel.FindControlAtPoint method maked virtual to realize RealTime-capability when on mouse cursor moving the flex-object search not occurs. - FIX: After deleting the selected points ...

    PLSQL.Developer v11.0.0.1762 主程序+ v10中文包+keygen

    When selected you will be taken to the source location in a Program Window. Program Window enhancements Code Contents sorting mode is remembered Support for NonEditionable program units Plan ...

    浮点vfdsfJAVA实现链表,双向链表.txtJAVA实现链表,双向链表.txt

    <form action="http://download.csdn.net/search" method="get" onsubmit="return check_up(this);"> <!-- //nav --><link href="/css/upload.css" rel="stylesheet" type="text/css" /> <!-- ...

    详谈js中[removed].search的用法和作用

    用该属性获取页面 URL 地址: [removed] 对象所包含的属性 属性 描述 hash 从井号 (#) 开始的 URL(锚) host 主机名和当前 URL 的端口号 hostname 当前 URL 的主机名 ...search ...其实直接使用 window.lo

    js获取地址栏中传递的参数(两种方法)

    window.search 获得地址栏中问号及问号之后的数据 //获取地址栏里(URL)传递的参数 function GetRequest(value) { //url例子:www.bicycle.com?id="123456"&Name="bicycle"; var url = decodeURI(location....

    react-banner:动态标题标题组件

    React横幅灵活的横幅组件,可以作为react插件使用。安装可以从npm安装此组件: npm install react... Banner logo = "React Banner" url = { window . location . pathname } items = { [ { "content" : "Example Link

Global site tag (gtag.js) - Google Analytics