Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: Pobieranie wartości val() nie działa
Forum PHP.pl > Forum > Po stronie przeglądarki
ostrylg
Mam coś takiego



  1. <input type="hidden" id="name" value="test" />
  2. <input type="hidden" id="name_2" value="test2" />
  3. <input type="hidden" id="folder" value="folder2" />


  1. var folder = $("#folder").val();
  2. var name = $("#name").val();
  3. var name_2 = $("#name_2").val();


  1. pano.readConfigUrl("http://inet-media.eu/cms/milezowka/concrete/themes/default/panoramy/" + folder + "/" + name);


niestety wynik jest następujący

  1. pano.readConfigUrl("http://inet-media.eu/cms/milezowka/concrete/themes/default/panoramy/" + folder + "/" + name);
erix
Pokaż może cały kod, bo kontekst też jest istotny, zwłaszcza źródło wywołania.
ostrylg
  1. <head>
  2. <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
  3.  
  4. <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0" />
  5. <meta name="apple-mobile-web-app-capable" content="yes" />
  6. <meta name="apple-mobile-web-app-status-bar-style" content="black" />
  7. <script type="text/javascript" src="panoramy/1/swfobject.js">
  8. </script>
  9. <script type="text/javascript">
  10.  
  11. // hide URL field on the iPhone/iPod touch
  12. function hideUrlBar() {
  13.  
  14. if (((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)))) {
  15. container = document.getElementById("container");
  16. if (container) {
  17. var cheight;
  18. switch(window.innerHeight) {
  19. case 208:cheight=268; break; // landscape
  20. case 336:cheight=396; break; // portrait, in call status bar
  21. case 356:cheight=416; break; // portrait
  22. default:
  23. cheight=window.innerHeight;
  24. }
  25. if ((container.offsetHeight!=cheight) || (window.innerHeight!=cheight)) {
  26. container.style.height=cheight + "px";
  27. setTimeout(function() { hideUrlBar(); }, 1000);
  28. }
  29. }
  30. }
  31.  
  32. if (window.pageYOffset==0) {
  33. window.scrollTo(0, 1);
  34.  
  35. }
  36. }
  37. </script>
  38. <style type="text/css" title="Default">
  39. body, div, h1, h2, h3, span, p {
  40. font-family: Verdana,Arial,Helvetica,sans-serif;
  41. color: #000000;
  42. }
  43. /* fullscreen */
  44. html {
  45. height:100%;
  46. }
  47. body {
  48. height:100%;
  49. margin: 0px;
  50. overflow:hidden; /* disable scrollbars */
  51. }
  52. body {
  53. font-size: 10pt;
  54. background : #ffffff;
  55. }
  56. table,tr,td {
  57. font-size: 10pt;
  58. border-color : #777777;
  59. background : #dddddd;
  60. color: #000000;
  61. border-style : solid;
  62. border-width : 2px;
  63. padding: 5px;
  64. border-collapse:collapse;
  65. }
  66. h1 {
  67. font-size: 18pt;
  68. }
  69. h2 {
  70. font-size: 14pt;
  71. }
  72. .warning {
  73. font-weight: bold;
  74. }
  75. </style>
  76. </head>
  77. <body onorientationchange="hideUrlBar();">
  78.  
  79. <div class="prezentacja" style="margin-top: 100px;float: left; width: 100%; height: 40px; top: 40px;">
  80. <input type="hidden" id="name" value="test" />
  81. <input type="hidden" id="name_2" value="test2" />
  82. <input type="hidden" id="folder" value="folder2" />
  83. </div>
  84.  
  85.  
  86. <script type="text/javascript" src="panoramy/1/pano2vr_player.js">
  87. </script>
  88. <script type="text/javascript" src="panoramy/1/skin.js">
  89. </script>
  90. <div id="container" style="width:100%;height:100%;margin-top: 300px">
  91. This content requires HTML5/CSS3, WebGL, or Adobe Flash Player Version 9 or higher.
  92. </div>
  93.  
  94.  
  95.  
  96. <script type="text/javascript">
  97.  
  98. // check for CSS3 3D transformations and WebGL
  99. if (ggHasHtml5Css3D() || ggHasWebGL()) {
  100. // use HTML5 panorama
  101.  
  102. // create the panorama player with the container
  103. pano=new pano2vrPlayer("container");
  104. // add the skin object
  105. skin=new pano2vrSkin(pano);
  106. // load the configuration
  107.  
  108. pano.readConfigUrl("panoramy/" + folder + "/" + name);
  109.  
  110.  
  111. // hide the URL bar on the iPhone
  112. hideUrlBar();
  113.  
  114. } else
  115. if (swfobject.hasFlashPlayerVersion("9.0.0")) {
  116.  
  117.  
  118. var flashvars = {};
  119. var params = {};
  120. params.quality = "high";
  121. params.bgcolor = "#ffffff";
  122. params.allowscriptaccess = "sameDomain";
  123. params.allowfullscreen = "true";
  124. var attributes = {};
  125. attributes.id = "pano";
  126. attributes.name = "pano";
  127. attributes.align = "middle";
  128. swfobject.embedSWF(
  129. "panoramy/1/" + name_2, "container",
  130. "100%", "100%",
  131. "9.0.0", "expressInstall.swf",
  132. flashvars, params, attributes);
  133.  
  134. }
  135. </script>
  136.  
  137.  
  138. <p><b>Please enable Javascript!</b></p>
  139.  
  140. </body>
  141. </html>
erix
A gdzie wstawiasz ten nie działający kod?
ostrylg
Zmienne

  1. var folder = $("#folder").val();
  2. var name = $("#name").val();
  3. var name_2 = $("#name_2").val();


przypisuje przed

  1. // check for CSS3 3D transformations and WebGL
  2. if (ggHasHtml5Css3D() || ggHasWebGL()) {
  3. // use HTML5 panorama
erix
Google: DOMContentLoaded.
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.