透過集合功能整理內容
    
    
      
      你可以依據偏好儲存及分類內容。
    
  
  
    
  
  
  
  
  
    
    
    
  
在陰影 DOM 中顯示廣告
shadow DOM 可讓您將 DOM 樹狀結構附加至元素,並將該樹狀結構的內部與網頁的其他部分隔離。根據預設,在 shadow DOM 中建立的任何元素,都無法由主頁面上執行的 JS 和 CSS 存取。
當 Google 發布商廣告代碼 (GPT) 程式庫載入至主頁面時,如果符合下列條件,便可將廣告轉譯至 shadow DOM 中的容器:
- 影 DOM 會以開啟模式附加。
- 對 googletag.display()的呼叫會提供廣告容器元素的參照,而非 DOM ID 字串。
實作範例
  
    觀看示範影片
  
  
  
  
  
  
  
    
  
 
  
    
    
    
  
  
  
  
    
    
    
      
  
    
  
  
    
      [[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],[],[],[]]