2013-06-11 3 views
0

다음 코드를 사용하여 (몇 줄만 포함) 애플리케이션에 RSS 피드를 포함합니다.Google AJAX 피드 API : 정의되지 않은 'LINK_TARGET_BLANK'속성을 읽을 수 없습니다.

GFdynamicFeedControl.prototype.parseOptions_ = function(options){ 
..... 
.... 
    this.options = { 
     .... 
     .... 
     feedCycleTime : GFdynamicFeedControl.DEFAULT_FEED_CYCLE_TIME, 
     linkTarget : google.feeds.LINK_TARGET_BLANK, 
     ....... 
     ....... 
    } 

} 
FdynamicFeedControl.prototype.setup_ = function(container) { 
    if (container == null) return; 
    this.nodes.container = container; 

    // Browser determination code. 
    .... 
    .... 
    // The feedControl instance for generating entry HTML. 
    this.feedControl = new google.feeds.FeedControl(); 
    this.feedControl.setLinkTarget(this.options.linkTarget); 

    // The feeds 
    this.expected = this.feeds.length; 
    this.errors = 0; 

    for (var i = 0; i < this.feeds.length; i++) { 
    var feed = new google.feeds.Feed(this.feeds[i].url); 
    feed.setResultFormat(google.feeds.Feed.JSON_FORMAT); 
    feed.setNumEntries(this.options.numResults); 
    feed.load(this.bind_(this.feedLoaded_, i)); 
    } 
}; 

코드 내 응용 프로그램의 JSP에 기능 이상 사용 :

<script> 
function LoadDynamicFeedControl() { 
     var feeds = new Array(); 

     feeds [feeds.length] = 
    {title: 'RSS feeds', 
    url: 'hard-coded URL' 

    }; 

    } 
     var options = { 
     stacked : false, 
     horizontal : false, 
     title : "" 
     } 

     new GFdynamicFeedControl(feeds, 'feed-control', options); 
    } 
    // Load the feeds API and set the onload callback. 
    google.load('feeds', '1'); 

    google.setOnLoadCallback(LoadDynamicFeedControl); 
</script> 

코드의 조각 파이어 폭스에서 잘 작동하지만 크롬에서 오류 제공 : 상기

"Cannot read property 'LINK_TARGET_BLANK' of undefined" 

을 라인 linkTarget : google.feeds.LINK_TARGET_BLANK,

r ead this 링크가 있지만 솔루션이 작동하지 않았습니다. (새 API를 물건을 Google에) JavaScript Callback Functions and Google Feed API

하지만 내 경우에이 시나리오를 구현하는 방법을 모른다 :

그런 다음이 게시물을 가로 질러왔다.

크롬에서 코드가 작동하도록 변경해야 할 사항을 제안 해주십시오.

답변

0

솔루션을 발견했습니다.

나는이 나를 위해 일

google.load('feeds', '1', {"callback": LoadDynamicFeedControl}); 

으로 문을

google.load('feeds', '1'); 
google.setOnLoadCallback(LoadDynamicFeedControl); 

를 교체했다.

그러나이 오류는 경고 "blocked"로 대체되었습니다. https : //.jsp의 페이지가 http://www.google.com/uds/?file=feeds&v=1&async=2의 안전하지 않은 콘텐츠를 실행했습니다. "

RSS 피드는 여전히 표시되지 않았습니다.

"C

에 :

그래서 나는

"\\ 응용 프로그램 데이터 \ 구글 \ 크롬 \ 응용 프로그램 \의 chrome.exe의 C "에서, 크롬 아이콘 수정 대상을 마우스 오른쪽 버튼으로 클릭 : \\ Application Data \ Google \ Chrome \ Application \ chrome.exe "- 허용 안 함 - 안전하지 않은 콘텐츠

그리고 마침내 나를 위해 일했습니다.