S
S
Stergy2018-09-10 11:46:50
React
Stergy, 2018-09-10 11:46:50

How to change the display of elements by specifying the suffix in the link?

Hello, there is a form written in React. It is necessary that some form fields appear only if the user follows a link with a certain prefix. For example, the site mysite.com:3000 - displays the usual functionality
How to make the link mysite.com:3000?extra_fiedls display additional forms that are not visible when switching to a regular domain.
So far, the page is not tied to any hosting and does not have a domain, but we need a universal solution that would work on any domain, just by adding a specific suffix, it would open additional fields in the form.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
FRF, 2018-09-10
@frf_nn

add an anchor to the document.location.search value, this is the part of the url including the "?". In your case it will be "?extra_fiedls" regardless of the site. except when the page is opened from a local path, such as "file://C/projects/..."

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question