Function getUrlParam

  • Get a single URL parameter (from the "location.search", before "#")

    Parameters

    • key: string

      key name

    Returns string | undefined

    • result
    getUrlParam('key1')
    // key1 => xxx

    getUrlParam('key1', 'https://test.com?key1=100#/home?key1=200')
    // key1 => 100

    5.0.0

  • Get a single URL parameter (from the "location.search", before "#")

    Parameters

    • key: string

      key name

    • url: string

      pass in the url string

    Returns string | undefined

    • result
    getUrlParam('key1')
    // key1 => xxx

    getUrlParam('key1', 'https://test.com?key1=100#/home?key1=200')
    // key1 => 100

    5.0.0