Hey Guys,
I am having a small issue with using the append function.
My problem is I am trying to implement a favourites category
on my jQuery Mobile website. I am using append to add to the favourites list. The problem is I have 2 different pages for the favourite function, when I click on a favourite button from the first page which I will call 'buy' the favourites should be added to a new page called 'sendFavourites'. This is what I have come up with I'm not sure why this isn't sending to the 'sendFavourites' page.
The Send button will lead to the 'sendFavourites' page where there needs to be a form presented in order for the customer to be able to send the favourites to their email.
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- </head>
- <!DOCTYPE html>
-
- <html>
-
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.css">
- <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
- <script src="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.js"></script>
-
- <link rel="stylesheet" href="css/style.css" media="screen" />
-
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
- <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
-
- </head>
- <body>
- <div data-role="page" id="buy">
- <a href="#sendFavourites" data-role="button" data-inline="true" >Send</a>
- <button id="fav1" data-inline="true" data-theme="a" data-icon="star">Fav1</button>
- <button id="fav2" data-inline="true" data-theme="a" data-icon="star">Fav2</button>
- <button id="fav3" data-inline="true" data-theme="a" data-icon="star">Fav3</button>
- <button id="fav4" data-inline="true" data-theme="a" data-icon="star">Fav4</button>
- <button id="fav5" data-inline="true" data-theme="a" data-icon="star">Fav5</button>
- <button id="fav6" data-inline="true" data-theme="a" data-icon="star">Fav6</button>
- <button id="fav7" data-inline="true" data-theme="a" data-icon="star">Fav7</button>
- <button id="fav8" data-inline="true" data-theme="a" data-icon="star">Fav8</button>
- <ol>
- <li></li>
- </ol>
- </div>
- <div data-role="page" id="sendFavourites">
- <script>
- $(document).ready(function(){
- $("#fav1").click(function(){
- $("ol").append(" <li>Add Fav 1</li>");
- });
- $("#fav2").click(function(){
- $("ol").append(" <li>Add Fav 2</li>");
- });
- $("#fav3").click(function(){
- $("ol").append(" <li>Add Fav 3</li>");
- });
- $("#fav4").click(function(){
- $("ol").append(" <li>Add Fav 4</li>");
- });
- $("#fav5").click(function(){
- $("ol").append(" <li>Add Fav 5</li>");
- });
- $("#fav6").click(function(){
- $("ol").append(" <li>Add Fav 6</li>");
- });
- $("#fav7").click(function(){
- $("ol").append(" <li>Add Fav 7</li>");
- });
- $("#fav8").click(function(){
- $("ol").append(" <li>Add Fav 8</li>");
- });
- });
- </script>
-
- </div>
- </body>
- </html>
Any help on this, I would be grateful,
Regards