Reputation: 57
I'm making a prototype of a website like this
Original: http://imageshack.us/a/img513/6013/tavor.png
My website: http://imageshack.us/a/img507/8461/manok.png
The picture on the right is the div id ovsian, the small one on the left is ovsia-mini
<div id="ovsian" name="ovsian" value="15" onclick="test()">OVSIA 15r</div>
<script type="text/javascript">
document.getElementById('ovsia-mini').style.backgroundImage="url('http://localhost/musli/mini.png')";
var kaina = this.ovsian.value;
$('#price').html("kaina");
}
</script>
I tried to do it this way but then realized that you can't put a value to a div element (at least with html).
How do I set the price value of "ovsian" (right on picture) to 15 and then onclick
add the 15 to the total price and print it in the gray box at the left?
What technology should I use? XML, AJAX? PHP/MYSQL? I don't know any of them.
I'm planing to pass the final price&product selection around in a cookie. I know it's a security fail but there is no personal information in a simple shopping cart like that, so session hijacking and all that stuff is not a problem.
How hard do you think a project like this is? What would be the best way to do it? The purpose of the website is mostly learning so all the detail you can write would be very appreciated :)
Upvotes: 0
Views: 288
Reputation: 8594
When you talk about technology, it will depend on your skills.
You have mentioned AJAX, PHP/MySQL. I deduce that you are talking about javascript to handle the client side processing and PHP/MySQL the backend. These languages will definetly work and they are pretty easy to learn and use, plus there is a great community around them.
I would also recommend learning the jQuery framework. It makes client side programming very easy.
You also mention XML. XML is mostly used for data exchange between the server side and client side. While it works, I prefer using JSON, which is easy to manipulate and handle both on the server side and client side.
Upvotes: 1