Javascript 雅虎广告的麻烦警报框

Javascript 雅虎广告的麻烦警报框,javascript,jquery,yahoo,ads,Javascript,Jquery,Yahoo,Ads,我如何从yahoo ads iframe控制台/警报出{PUB_URL}和{REQUESTID}的值 <iframe frameborder="0" marginwidth="0" marginheight="0" scrolling="NO" width="300" height="250" src="http://tags1.z5x.net:5280/?ad_type=ad&amp;ad_size=300x250&amp;section=222222&amp;p

我如何从yahoo ads iframe控制台/警报出
{PUB_URL}
{REQUESTID}
的值

<iframe frameborder="0" marginwidth="0" marginheight="0" scrolling="NO" width="300" height="250" src="http://tags1.z5x.net:5280/?ad_type=ad&amp;ad_size=300x250&amp;section=222222&amp;pub_url=${PUB_URL}&amp;ord=${REQUESTID}"></iframe>

通过使用web developer工具检查元素,我只能知道
{PUB_URL}
{REQUESTID}
值。但是,在手机浏览器上无法做到这一点。因此,我想提醒
{PUB_URL}
{REQUESTID}
值。我的雅虎广告在某些广告中会弹出警告框。我想知道这些麻烦的广告细节,但不知道怎么做

Im尝试使用
$('iframe').contents().html()
,但由于跨域问题而失败。 是否有任何方法可以通过使用javascript来控制/警告
{PUB_URL}
{REQUESTID}
的值?

这样做:

var iframe, a, result;
iframe = document.getElementsByTagName('iframe')[0];
a = document.createElement('a');
result = {};
a.href = iframe.src;
a.search.split('&').forEach(function (e) { 
    var key, val;
    e = e.split('='); 
    key = e.shift().replace('?', ''); 
    val = e.shift();
    result[key] = val;
});
console.log(result);

像这样的方法应该会奏效:

var iframe = document.querySelector('iframe[width="300"]'),
    matches = iframe.src.match(/pub_url=([^&]+).*?ord=([^&]+)/);

alert("PUB_URL: " + matches[1] + "\nREQUESTID: " + matches[2]);

谢谢,达格。感谢您的帮助:)。