熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> Java編程 >> JSP教程 >> 正文

Jquery獲取頁面傳值

2022-06-13   來源: JSP教程 

  function request(paras){

  var url = locationhref;

  var paraString = urlsubstring(urlindexOf("?")+urllength)split("&");

  var paraObj = {}

  for (i=; j=paraString[i]; i++){

  paraObj[jsubstring(jindexOf("="))toLowerCase()] = jsubstring(jindexOf("=")+jlength);

  }

  var returnValue = paraObj[parastoLowerCase()];

  if(typeof(returnValue)=="undefined"){

  return "";

  }else{

  return returnValue;

  }

  }

  //如你給出的地址可以這樣

  var classid = request("classid");

  var id = request("id");


From:http://tw.wingwit.com/Article/program/Java/JSP/201311/20521.html
    推薦文章
    Copyright © 2005-2022 電腦知識網 Computer Knowledge   All rights reserved.