FCF 2.0 development in progress...
> > > >
[News] [Packages API] [Downloads] [Donate to the project] [Contacts]

fcf.buildUrl() function

string fcf.buildUrl(string|fcf.RouteInfo a_url, object a_args = undefined, string a_anchor = undefined)

Package: fcf-framework-core

File: fcf-framework-core:fcf.js

Available from version: 2.0.2

Gathers a new URL from the original one by adding arguments and an anchor

Arguments

string|fcf.RouteInfo a_url
- Source URL

object a_args = undefined
- An object containing additional GET query arguments

string a_anchor = undefined
- A new anchor
Result
string
- New URL

Example:

let url = fcf.buildUrl("http://localhost:8080/index.html", {arg1: "value1"}, "ancor_value"); console.log(url);

Output:

http://localhost:8080/index.html?arg1=value1#ancor_value