Retrieve user's image selection from website [closed] - javascript

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I am trying to make a website where the user needs to pick one image from a selection presented on the site. When the user selects a picture, i.e. clicks on it, I somehow need to retrieve the name/ID of the selected photo, and have this available on the server.
This is because I must run a bash script on my server, with the selected image ID as input.
What is the simplest way this can be achieved?

Here's how to find the id of the element you clicked ...
$(document).ready(function() {
$(".some-image").click(function(event) {
// do something with the image id below
console.log(event.target.id);
});
});
Copied almost entirely from this stack-overflow question/answer here

Related

How do you create a sharable custom url depending on user selected options [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I have seen websites that create a sharable link that is generated depending on what options the user chooses but I'm not really sure how they're implemented (or what this process is called).
e.g. this website has a share button at the bottom that creates a sharable link for a given selection.
You can do a rudimental but easy solution. Add a URL Parameter to the button link and redirect on click depending on the parameter.

jQuery remember option [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 3 years ago.
Improve this question
I have created an option that by clicking on span text shows or hides the sidebar. how to remember user selection after reloading page that the sidebar page was shown or hidden depending on the user's choice?
Once you refresh the page, everything that is not stored somewhere, for example a database, will be lost.
The easiest approach would be to save user's selection to his browser's localStorage.
So, after setting the sidebar to whatever state you want, you can save it like this:
localStorage.setItem('showSidebar', true); // or false
and then, when the page is reloaded, you can get the data like this:
var showSidebar = localStorage.getItem('showSidebar') || false;

How to open a new box when clicked on a link [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I am a beginner in web developing world.
I have a table of data fetched from mysql database shown in php. Now I want to create a link on each row which on click will open up a new box (not window) of specific width-height and will show detailed information.
How can i do this ?
Think you searching for modals windows.
Here is example https://raventools.com/blog/create-a-modal-dialog-using-css-and-javascript
Create a div with css display:none;, and use javascript to toggle the visiblity. That might work.

New page for every user [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
What i basically want to do is to log in a user and make a new page for every user with its own personal details.
So for example user A signs in, he would have a different view than user B.
I am using javascript ans firebase for back end.
How can i make that happen?
A rough idea would be enough.
You should use Sessions for each user and one the bases of Session value you must populate values for the user each user will have seperate details and each user will have different data page will be same but data will be different so user feels that he has a new page

Pass Variables from Button to Form on Next Page [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I would like to pass variables from a button to an input form on another page.
For example,
The user clicks a button with the package they want, the button loads the next page and fill out the form with the package information they have selected. What is the best way to go about this? I am designing the website using Joomla.
Thanks,
Ed
I can suggest you to use localStorage to get this done.
localStorage.setItem('testObject', value);
then get it on other page like this:
var retrievedObject = localStorage.getItem('testObject');
then set the text field with retrievedObject .
see this post to get better idea:Storing Objects in HTML5 localStorage

Categories