Function getQueryParam

  • Get the query param's value of the current Web URL(location.search).

    Usage:

    // http://example.com/?t1=1&t2=2&t3=3&t4=4#2333
    // ?t1=1&t2=2&t3=3&t4=4
    const p1 = getQueryParam('t3');
    const p2 = getQueryParam('t4');
    console.log(p1, p2);

    Output:

    3 4
    

    Parameters

    • param: string

      Query param.

    Returns string

    value