ポップアップとして新しいURLを開こうとしています。それはうまくいきます。今、ポップアップからスタイルなどをカスタマイズしようとしています。それはうまくいきません。何が問題なのですか?
例外:「キャッチされていないTypeError:nullのプロパティ'style'を読み取れません」
<script>
function startGaLandingpage(url) {
params = 'width=' + screen.width;
params += ', height=' + screen.height;
params += ', top=0, left=0'
params += ', fullscreen=yes';
var url = 'https://www.google.com/analytics/web/?hl=en&pli=1#realtime/rt-overview/a29259688w55318706p63647373/'
landingpage = window.open(url, 'landingpage', params);
var landingpagescript = document.createElement('script');
landingpagescript.src = 'https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js';
landingpagescript.type = 'text/javascript';
landingpage.document.getElementsByTagName('head')[0].appendChild(landingpagescript);
var div = landingpage.document.getElementById('ID-navPanelContainer').style;
if (div)
void (div.display = (div.display == 'none') ? 'block' : 'none');
var div = landingpage.document.getElementById('ID-headerPanel').style;
if (div)
void (div.display = (div.display == 'none') ? 'block' : 'none');
var div = landingpage.document.getElementById('ID-overviewPanelTrafficSourceValueOrganicTable').style;
if (div)
void (div.display = (div.display == 'none') ? 'block' : 'none');
var div = landingpage.document.getElementById('ID-overviewPanelGeoComponent').style;
if (div)
void (div.display = (div.display == 'none') ? 'block' : 'none');
var div = landingpage.document.getElementById('ID-footerPanel').style;
if (div)
void (div.display = (div.display == 'none') ? 'block' : 'none');
var div = landingpage.document.getElementById('ID-navToggle').style;
if (div)
void (div.display = (div.display == 'none') ? 'block' : 'none');
var div = landingpage.document.getElementById('ID-overtimePanel').style;
if (div)
void (div.display = (div.display == 'none') ? 'block' : 'none');
var div = landingpage.document.getElementById('ID-contextDetailsPanel').style;
if (div)
void (div.display = (div.display == 'none') ? 'block' : 'none');
var div = landingpage.document.getElementById('ID-reportHeader').style;
if (div)
void (div.display = (div.display == 'none') ? 'block' : 'none');
var div = landingpage.document.getElementById('ID-realtimeReportFootnote').style;
if (div)
void (div.display = (div.display == 'none') ? 'block' : 'none');
}
</script>