SoFunction
Updated on 2025-04-09

How to get the Get value by js

This article example describes how to get the Get value by js. Share it for your reference, as follows:

function getUrlParam(name)
{
  var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)"); //Construct a regular expression object containing target parameters  var r = (1).match(reg); //Match the target parameters  if (r!=null) return unescape(r[2]);
  return null; //Return parameter value}

For more information about JavaScript, readers who are interested in reading this site's special topic:Summary of json operation skills in JavaScript》、《Summary of JavaScript switching effects and techniques》、《Summary of JavaScript search algorithm skills》、《Summary of JavaScript animation effects and techniques》、《Summary of JavaScript Errors and Debugging Skills》、《Summary of JavaScript data structure and algorithm techniques》、《Summary of JavaScript traversal algorithm and skills"and"Summary of JavaScript mathematical operations usage

I hope this article will be helpful to everyone's JavaScript programming.