Repositorio del curso CCOM4030 el semestre B91 del proyecto Artesanías con el Instituto de Cultura

artesano.html 1.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>Artesanos</title>
  5. <script src="jquery/dist/jquery.min.js">
  6. </script>
  7. </head>
  8. <body>
  9. <ons-toolbar>
  10. <div class="left">
  11. <ons-back-button>Back</ons-back-button>
  12. </div>
  13. </ons-toolbar>
  14. <script type="text/javascript">
  15. function getUrlVars() {
  16. var vars = [], hash;
  17. var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
  18. for(var i = 0; i < hashes.length; i++)
  19. {
  20. hash = hashes[i].split('=');
  21. vars.push(hash[0]);
  22. vars[hash[0]] = hash[1];
  23. }
  24. return vars;
  25. }
  26. nombre = decodeURIComponent(getUrlVars()["nombre"]);
  27. renglon = "json/MADERA.json";
  28. $.getJSON(renglon, function(json) {
  29. for (i = 0; i < json.length; i++) {
  30. if (json[i].Nombre == nombre) {
  31. break;
  32. }
  33. }
  34. console.log("entre a artesano.html...???");
  35. document.write("<h1 align='center'>" + json[i].Nombre + "</h1>");
  36. document.write("<h2 align='center'>" + json[i].Municipio + "</h1>");
  37. document.write("<h2 align='center'>" + json[i].Especificaciones + "</h2>");
  38. document.write("<a class='button' href='tel://" + json[i]["Teléfono 1"] + "'>" + "<h2 align='center'>" + json[i]["Teléfono 1"] + "</h2>" + "</a>");
  39. document.write("<a href='mailto:" + json[i]["E-mail"] + "'>" + "<h2 align='center'>" + json[i]["E-mail"] + "</h2>" + "</a>");
  40. console.log("SE CORRE");
  41. });
  42. </script>
  43. </body>
  44. </html>