L
L
Lici2014-05-31 19:05:19
PHP
Lici, 2014-05-31 19:05:19

How to pass data to JS script via link?

There is a calculator type form in JS on the page, which, in response to a user request, provides a specific list of data.
For example, a person enters the color "green" into the field, the shape "square" into the field, and as a result, he gets below the calculation of all the green and square that is in the database.
And if you need to send the user to this layout, then you need to give him a link that will fill in the "color"-green and "shape"-square fields for him and click the "find" button.
In short, you need to create a link to the page, on which there will already be a layout of everything green and square.
How to do it?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
P
Pavel Solovyov, 2014-05-31
@pavel_salauyou

you can pass the parameters to the hash in the url, exmple.com#color=green, and then parse and set the value in js.

S
Stepan, 2014-05-31
@L3n1n

1. Use $_GET in php
2. Parse url stackoverflow.com/questions/979975/how-to-get-the-...

A
Alexey, 2014-05-31
@HaJIuBauKa

Well, use a form for this, and then:
This will be your form expressed in URL parameters. Then shove it anywhere

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question