2014-01-13 8 views
0

Google지도 컨테이너가있는 페이지가 있는데 링크를 클릭하면지도 컨테이너가 아약스로 슬라이더로 변경됩니다.이 코드로 다시 시도하려면지도를 다시 표시하려면 다른 버튼을 클릭해야합니다.div 만들기 # map-canvas javascript

$(document).ready(function(){ 
      $('.mapCall').click(function(){ 
       $('#map_container').empty(); 
       var iDiv = document.createElement('div'); 
       iDiv.id = 'map-canvas'; 
       function refreshQuote() { 
        $("#map_container").load("mapMain.js."); 
       } 
       document.getElementById('map_container').appendChild(iDiv); 

      }); 
     }); 

는 사업부가 만들어하지만 난 문제가 무엇인지 정확히 모르겠어요지도

+1

'내가 진짜 문제는 함수'refreshQuote은()'라는지고 있지 않은지 의심하지만 $ ('#지도 캔버스')가'당신을위한 요소를 생성합니다. – Mathletics

답변

0

를 표시하지,하지만 당신은 refreshQuote이 실행을 받고 그되지 않은 생각하기 때문에 나는 그 생각된다. 이 시도 :

 $(document).ready(function(){ 
      $('.mapCall').click(function(){ 
       $('#map_container').empty(); 
       var iDiv = document.createElement('div'); 
       iDiv.id = 'map-canvas'; 

       refreshQuote(); 

       document.getElementById('map_container').appendChild(iDiv); 

      }); 
     }); 

     function refreshQuote() { 
      $("#map_container").load("mapMain.js."); 
     }