2012-09-21 58 views
0

因此,我在CodeIgniter框架中設置了Google地圖。我在地圖按鈕中有一個視圖,該按鈕將我帶到地圖,並且地圖加載正常,具有所有標記和所有內容。我試圖完成的是從該頁面獲取基本地圖,並將其帶入另一頁面並使其變小。聽起來很簡單吧!那麼當我將代碼粘貼到新頁面時,我會從螢火蟲中獲得所有這些錯誤訊息。我猜測,頁面上運行的其他JavaScript會導致這些錯誤,但我不確定。我已粘貼下面的代碼...爲什麼我的地圖可以在一個頁面上工作,但不能在另一個頁面上工作

< ---------此代碼在第一頁上正常工作,所以我只想複製並粘貼到新頁面--------- - >

<div class="domtab"> 
     <?php 
     echo '<div class="large-box"; style="float:left; margin: 0.5cm 1cm 0.5cm 1cm; padding: 1em";>'; 
     ?> 
     <div class="domtab"> 
     <link href="/intelligencegraph/resources/css/style.css" rel="stylesheet" type="text/css" /> 
     <link href="/intelligencegraph/resources/css/developer.css" rel="stylesheet" type="text/css" /> 
     <link href="/intelligencegraph/resources/css/thickbox.css" rel="stylesheet" type="text/css" /> 
     <link href="/intelligencegraph/resources/css/jquery-ui.css" rel="stylesheet" type="text/css" /> 
     <script type="text/javascript" src="/intelligencegraph/resources/uploads/entity_icons" ></script> 

<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?key=AIzaSyCy38HO--LhhK-BS1WqIDrHXyFU9ljaRT4&sensor=false"></script> 
<script type="text/javascript"> 
     <script type="text/javascript">     
    // This loads the map, 
    function initialize() { 
    var myLatlng = new google.maps.LatLng(<?php echo $node_address?>); 
    var myOptions = { 
     zoom: 10, 
     center: myLatlng, 
     mapTypeId: google.maps.MapTypeId.ROADMAP 
    } 

    // Adding a marker, to map 
    var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); 
    var marker = new google.maps.Marker({ 
     position: myLatlng, 
     map: map 
     });   
    } 



</script> 
<body onload="initialize()"> 
<!-- Size Of map--> 
<div id="map_canvas" style="height: 500px; width: 100%;"></div> 
     </div> 

     </div> 
    </div> 

< ----------這就是我認爲與它interferring --------->

<br style="clear: both;" /> 
<a onclick="document.getElementById('graphdb-viz').style.display = 'block'">View Visualization</a> 

<div style="display: none" id="graphdb-viz"> 
    <iframe src="/intelligencegraph/viz/graph.jsp?nodeid=<?php echo $node_id ?>&database=<?php echo $database ?>" height="650" width="950"></iframe> 
</div> 


<a onclick="document.getElementById('graphdb-viz2').style.display = 'block'">View Alternative Visualization</a> 

<div id="graphdb-viz2" style="height: 650px; width:950px; display: none" > 
<script type="text/javascript" src="/intelligencegraph/resources/flash/swfobject.js"></script> 
     <script type="text/javascript"> 
      // For version detection, set to min. required Flash Player version, or 0 (or 0.0.0), for no version detection. 
      var swfVersionStr = "10.2.0"; 
      // To use express install, set to playerProductInstall.swf, otherwise the empty string. 
      var xiSwfUrlStr = "playerProductInstall.swf"; 
      var flashvars = {nodeid:<?php echo $node_id; ?>,database:'<?php echo $database; ?>'}; 
      var params = {}; 
      params.quality = "high"; 
      params.bgcolor = "#ffffff"; 
      params.allowscriptaccess = "sameDomain"; 
      params.allowfullscreen = "true"; 
      var attributes = {}; 
      attributes.id = "GraphDBVis"; 
      attributes.name = "GraphDBVis"; 
      attributes.align = "middle"; 
      swfobject.embedSWF(
       "/intelligencegraph/resources/flash/GraphDBVis.swf", "flashContent", 
       "100%", "100%", 
       swfVersionStr, xiSwfUrlStr, 
       flashvars, params, attributes); 
      // JavaScript enabled so display the flashContent div in case it is not replaced with a swf object. 
      swfobject.createCSS("#flashContent", "display:block;text-align:left;"); 
     </script> 
     <!-- SWFObject's dynamic embed method replaces this alternative HTML content with Flash content when enough 
      JavaScript and Flash plug-in support is available. The div is initially hidden so that it doesn't show 
      when JavaScript is disabled. 
     --> 
     <div id="flashContent" style="height: 2000px; width:2000px" > 
     </div> 


</div> 

<代碼---------這裏是所有的錯誤信息--------->

//"NetworkError: 404 Not Found - http://localhost:8091/resources/js/ckeditor/ckeditor_basic.js" 

ckeditor_basic.js 

"NetworkError: 404 Not Found - http://localhost:8091/resources/js/jquery.js" 

jquery.js 

"NetworkError: 404 Not Found - http://localhost:8091/resources/js/jquery-ui.js" 

jquery-ui.js 

"NetworkError: 404 Not Found - http://localhost:8091/resources/js/thickbox.js" 

thickbox.js 

"NetworkError: 404 Not Found - http://localhost:8091/intelligencegraph/resources/uploads/entity_icons/" 

/intel..._icons/ 

"NetworkError: 404 Not Found - http://localhost:8091/resources/js/jquery-ui.js" 

jquery-ui.js 

"NetworkError: 404 Not Found - http://localhost:8091/resources/js/thickbox.js" 

thickbox.js 

"NetworkError: 404 Not Found - http://localhost:8091/intelligencegraph/resources/uploads/entity_icons/" 

"NetworkError: 404 Not Found - http://mbostock.github.com/d3/d3.layout.js?2.6.0" 

d3.lay...s?2.6.0 

"NetworkError: 404 Not Found - http://mbostock.github.com/d3/d3.geom.js?2.6.0" 

爲什麼我會在這個頁面上找到它們,但是如果一切都一樣,我不會得到它們嗎?

+0

似乎更像是服務器問題不是JavaScript /谷歌地圖 –

回答

0

這將在任何網頁上工作,你有一個雙腳本標籤瀏覽:

<script type="text/javascript"> 
     <script type="text/javascript">//<--causes a syntax-error, remove this line     
    // This loads the map, 
+0

我必須忽視的是,當我複製成這個問題是因爲它不在我的代碼中。我有一種感覺,我必須定義類似JavaScript 1和Javascript 2的東西。 – user1639669

相關問題