Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This's my code:</p> <pre><code> var init = function () { OpenLayers.ImgPath = "images/" var vector = new OpenLayers.Layer.Vector("Vector Layer", {}); sprintersLayer = new OpenLayers.Layer.Vector("Sprinters", { styleMap: new OpenLayers.StyleMap({ externalGraphic: "images/mobile-loc.png", graphicOpacity: 1.0, wrapDateLine : true, graphicWidth: 32, graphicHeight: 32, graphicYOffset: -26 }) }); //add locations to feature addFeature(); selectControl = new OpenLayers.Control.SelectFeature(sprintersLayer, { autoActivate:true, onSelect: onFeatureSelect, onUnselect: onFeatureUnselect }); function onPopupClose(evt) { selectControl.unselect(selectedFeature); } function onFeatureSelect(feature) { selectedFeature = feature; popup = new OpenLayers.Popup.FramedCloud("chicken", feature.geometry.getBounds().getCenterLonLat(), null,'&lt;div style="height:40px"&gt;&lt;a id="locationListView" href="location-detail.html?id='+ feature.attributes.LocationID+'&amp;masterID='+"1"+'"&gt;&lt;h1 style="color:#FF0000;font-size:16px;margin-bottom: 0px"&gt;'+feature.attributes.Name+'&lt;/h1&gt;&lt;p class="classement '+ feature.attributes.LocationRating+'"&gt;'+feature.attributes.LocationRating+ ' stars&lt;/p&gt;&lt;/a&gt;&lt;/div&gt;' , null, true, onPopupClose); popup.panMapIfOutOfView = true; popup.autoSize = true; feature.popup = popup; map.addPopup(popup); } function onFeatureUnselect(feature) { map.removePopup(feature.popup); feature.popup.destroy(); feature.popup = null; } // create map map = new OpenLayers.Map({ div: "map", theme: null, projection: sm, controls: [ new OpenLayers.Control.Attribution(), new OpenLayers.Control.TouchNavigation({ dragPanOptions: { enableKinetic: true } }), selectControl ] }); layerMapnik = new OpenLayers.Layer.OSM.Mapnik("Mapnik"); layerMapnik.setOpacity(0.4); map.addLayer(layerMapnik); map.isValidZoomLevel = function(zoomLevel) { return ( (zoomLevel != null) &amp;&amp; (zoomLevel &gt;= 12) &amp;&amp; // set min level here, could read from property (zoomLevel &lt;= 16) ); } var newLayer = new OpenLayers.Layer.OSM("Local Tiles", AppPath + "${z}/${x}/${y}.png", { numZoomLevels: 19, alpha: true, isBaseLayer: false,tileOptions: {crossOriginKeyword: null} }); map.addLayer(newLayer); map.addLayer(vector); map.addLayer(sprintersLayer); //point of center //centerPoint = new OpenLayers.LonLat(106.62230325481676,10.856649277232393).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()); //if (!map.getCenter()) { //map.setCenter(centerPoint, zoom); //} var style = { fillOpacity: 0.1, fillColor: '#000', strokeColor: '#f00', strokeOpacity: 0.6 }; }; </code></pre> <p>I append link redirect into Popup at onFeatureSelect(feature) function. After redirect to location-Detail.html success, i get error at the first line in js library where i use $ (jQuery) to get element html. This's code for location-Detail.html.</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;!-- Mirrored from ritenv.com/templates/klassio-rsv/gallery.php by HTTrack Website Copier/3.x [XR&amp;CO'2010], Sat, 30 Mar 2013 02:13:17 GMT --&gt; &lt;head&gt; &lt;/head&gt; &lt;body&gt; &lt;div data-dom-cache="false" data-role="page" class="pages" id="locationDetail" data-theme="a"&gt; &lt;div data-role="header"&gt; &lt;div class="left"&gt; &lt;a href="#" class="showMenu menu-button"&gt;&lt;img src="images/menu-button.png" width="40" /&gt;&lt;/a&gt; &lt;a href="#" class="back-button"&gt;&lt;img src="images/back-button.png" width="40" /&gt;&lt;/a&gt; &lt;/div&gt; &lt;h1&gt;&lt;p class="no-margin" id="category"&gt;&lt;/p&gt;&lt;p class="no-margin"&gt;TourGuide&lt;/p&gt;&lt;/h1&gt; &lt;/div&gt; &lt;!-- /header --&gt; &lt;div data-role="content" data-theme="a" class="minus-shadow"&gt; &lt;div class="ui-grid-a" id="places_infos"&gt; &lt;div class="ui-block-a" id="LocationImage"&gt; &lt;p id="imageMain"&gt;&lt;/p&gt; &lt;/div&gt; &lt;div class="ui-block-b"&gt; &lt;div id="LocationDescription"&gt;&lt;/div&gt; &lt;div id="starLocationRating" data-number="4"&gt;&lt;/div&gt; &lt;div id="hintLocation"&gt;&lt;/div&gt; &lt;div id="starFavorites"&gt;&lt;img class="imageFavorites" src="images/favorites_add.png"&gt;&lt;/div&gt;&lt;br&gt; &lt;div&gt;&lt;p class="distance" style="height:16px"&gt;&lt;/p&gt;&lt;/div&gt; &lt;div&gt;&lt;a href="#" class="button button9" id="locationMap"&gt;&lt;p&gt;Map&lt;/p&gt;&lt;/a&gt;&lt;/div&gt; &lt;/div&gt; &lt;/div&gt;&lt;!-- /grid-a --&gt; &lt;div id="tabs"&gt; &lt;ul class="tab-menu-ul"&gt; &lt;li&gt;&lt;a href="#tab1"&gt;Detail&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#tab2"&gt;Gallery&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#tab3"&gt;Reviews&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#tab4"&gt;Share&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;div id="tab1"&gt; &lt;div id="nearPlaces"&gt; &lt;h1&gt;Nearly Locations:&lt;/h1&gt; &lt;ul data-role="listview" data-inset="true" id="locationListView"&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; &lt;div id="tab2"&gt; &lt;a class="button button3" id="takePhoto"&gt;Take Photo&lt;/a&gt; &lt;ul id = "gallery" class="gallery photoswipe column-split four-column" style="display: inline-block;"&gt; &lt;li&gt;&lt;a data-ajax="false" href="images/content/stair-case.jpg"&gt;&lt;img src="images/content/stair-case.jpg" alt="......." /&gt;&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a data-ajax="false" href="images/content/concert.jpg"&gt;&lt;img src="images/content/concert.jpg" alt="......" /&gt;&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a data-ajax="false" href="images/content/beach.jpg"&gt;&lt;img src="images/content/beach.jpg" alt="........." /&gt;&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a data-ajax="false" href="images/content/garden.jpg"&gt;&lt;img src="images/content/garden.jpg" alt="......." /&gt;&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div id="tab3"&gt; &lt;div class="dropdown-toggle needsclick" id="starRating" data-number="4"&gt;&lt;/div&gt; &lt;div class="dropdown-toggle needsclick" id="hint"&gt;&lt;/div&gt; &lt;div id="myComment"&gt; &lt;h1&gt;Me: &lt;/h1&gt; &lt;ul id="commentList"&gt;&lt;/ul&gt; &lt;/div&gt; &lt;div class="subcontainer"&gt; &lt;form method="post" action="" id="comment_form" data-ajax="false"&gt; &lt;div&gt; &lt;label for="message" class="formsub"&gt;Your Comment:&lt;/label&gt; &lt;textarea cols="40" class="textarea" rows="8" name="message" id="comment"&gt;&lt;/textarea&gt; &lt;/div&gt; &lt;div id="loader"&gt; &lt;button type="submit" id="submit"&gt;SEND&lt;/button&gt; &lt;/div&gt; &lt;/form&gt; &lt;/div&gt; &lt;div&gt; &lt;h1&gt;Others: &lt;/h1&gt; &lt;ul id="userCommentList"&gt;&lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; &lt;div id="tab4"&gt; &lt;p&gt; Share with facebook.&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;&lt;!-- /content --&gt; &lt;div class="bread-crumb"&gt; &lt;ul id="linkPage"&gt; &lt;li&gt;&lt;a data-transition="pop" href="index.html"&gt;&lt;img src="images/bc-home.png" width="16" /&gt;&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a data-transition="pop" href="#" id="linkPage1"&gt;&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;script&gt; $(document).ready(function(){ $('#locationDetail').die().live("pageshow", function( event ) { event.preventDefault(); initLocationDetailPage(); }); }); &lt;/script&gt; &lt;script type="text/javascript"&gt; var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-34399779-4']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); &lt;/script&gt; &lt;/div&gt;&lt;!-- /page --&gt; &lt;/body&gt; &lt;!-- Mirrored from ritenv.com/templates/klassio-rsv/gallery.php by HTTrack Website Copier/3.x [XR&amp;CO'2010], Sat, 30 Mar 2013 02:13:35 GMT --&gt; &lt;/html&gt; </code></pre> <p>I put all js libraries in index.html, other cases js libraries are also loaded successful. Any idea for this error?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload