1.0.9 • Published 5 years ago
wwp-js-url-helper v1.0.9
install
npm install wwp-js-url-helper --save
inport
import jsurl from 'wwp-js-url-helper'
functions
var url = 'http://localhost:8080/?id=1#/test?name=11'
jsurl.getSearch('id',[url]); // 1
jsurl.updateSearch('id','2',[url]); // http://localhost:8080/?id=2#/test?name=11
jsurl.removeSearch('id',[url]); // http://localhost:8080/#/test?name=11
jsurl.getHash('name',[url]); // 11
jsurl.updateHash('name','22',[url]); // http://localhost:8080/?id=1#/test?name=22
jsurl.removeSearch('name',[url]); // http://localhost:8080/?id=1#/test