承接 global-source/javascript_uri_query 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

global-source/javascript_uri_query

Composer 安装命令:

composer require global-source/javascript_uri_query

包简介

Core Javascript Library for URI CURD.

README 文档

README

Core Javascript Library for Powerful URL level Operations ADD|UPDATE|DELETE and much more...

Packagist Packagist

One library to perform most of the URI operations. Such as,

Action Method Description
Add URI.addNew(key, val) To add new param to URL.
Bulk Add URI.add([{key1 : val1},{key2: val2}]) To add multiple params to URL.
Append URI.append(key, val) To add new item to the existing value.
Update Value URI.add([{key: val}]) To perform update with add function.
Delete URI.remove(key) To remove param from URL.
Bulk Delete URI.remove([key1, key2]) To remove multiple param from URL.
Delete All URI.removeAll() To remove all param in the URL.
Clear URI.clear() TO clear the URL history.
Update URI.update() To update URI status.
Get URI.get(key) To get value of a param.

Installation

Include the URI library to project by using,

    <script src="uri_helper.min.js"></script>

For ES6:

    <script src="uri_helper_es6.min.js"></script>
    <script>
     let URI = new _URI(); 
    </script>

Methods

getAll()

To get list of URI params as Object.

    
           URI.getAll();    
        
        // URL : http://domain.com/?type=my-ticket&page=1&limit=5
        
        // Output : ["type=myTicket", "page=1", "limit=5"]
        

get()

To get value of the param from URI.

           URI.get('type');
        
        // URI : http://domain.com/?type=myTicket&page=2&limit=5
        
        // OUT : 'myTicket'

addNew()

To add single param to the URI. If item already exists, then value get updated.

   
           URI.add('page', 1);
        
        // Before URL : http://domain.com/?type=my-ticket
        
        // After URL : http://domain.com/?type=my-ticket&page=1
        

add()

To add list of params to the URI. If item already exists, then value get updated.

   
           URI.add([{'page': 1}, {'limit': 5}]);
        
        // Before URL : http://domain.com/?type=my-ticket
        
        // After URL : http://domain.com/?type=my-ticket&page=1&limit=5
        

append()

To append value to the param in the URI.

   
           URI.append(name, bala);
        
        // Before URL : http://domain.com/?name=shankar
        
        // After URL : http://domain.com/?name=shankar,bala
        

remove()

To remove list of param from the URI.

  
           URI.remove(['page','limit']);   // For Bulk.
           URI.remove('type');             // For Single.   
           URI.remove('id','55')       // For Single Value.
        
        // Before URL : http://domain.com/?type=my-ticket&page=1&limit=5
        
        // After URL : http://domain.com/?
        
        // For Single Value:
        // Before URL : http://domain.com/?id=45,23,55,34
        
        // After URL : http://domain.com/?id=45,23,34

removeAll()

To remove all param in the URI.

   
           URI.removeAll();
        
        // Before URI : http://domain.com/?type=my-ticket&page=2&limit=5
        
        // After URI : http://domain.com/?

prevPage()

To go back to previous page by update the URI.

   
           URI.prevPage();
        
        // Before URL : http://domain.com/?type=my-ticket&page=2&limit=5
        
        // After URL : http://domain.com/?type=my-ticket&page=1&limit=5

nextPage()

To move to next page by update the URI.

   
           URI.nextPage();
        
        // Before URL : http://domain.com/?type=my-ticket&page=1&limit=5
        
        // After URL : http://domain.com/?type=my-ticket&page=2&limit=5
        

isParamExists()

To check the param is exist in URI or Not.

        
           URI.isParamExists('page');        
           URI.isParamExists('newPage');
        
        // URL : http://domain.com/?type=my-ticket&page=2&limit=5
        
        // OUT 1 : true
        // OUT 2 : false
       

License

MIT License

统计信息

  • 总下载量: 15
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: JavaScript

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-01-28

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固