谷歌分析JavaScript错误
我有这个网页,其中用于返回其他一些JavaScript错误,但似乎我固定的他们,因为系统现在抱怨不同:)谷歌分析JavaScript错误
这里是页:
http://www.comehike.com/outdoors/parks/trailhead.php
这里是JS错误我在控制台获得:
Unable to post message to http://googleads.g.doubleclick.net . Recipient has origin http://www.comehike.com .
也有这个错误,这是非常神秘:
Unsafe JavaScript attempt to access frame with URL http://googleads.g.doubleclick.net/pagead/ads?client=ca-pub-1884332214318974&output=html&h=90&slotname=6750679790&w=728&lmt=1307311140&flash=10.3.181&url=http%3A%2F%2Fwww.comehike.com%2Foutdoors%2Fparks%2Ftrailhead.php&dt=1307285940734&bpp=5&shv=r20110527&jsv=r20110506&correlator=1307285940857&frm=4&adk=540157337&ga_vid=898509444.1299013740&ga_sid=1307285941&ga_hid=824315563&ga_fc=1&u_tz=-420&u_his=10&u_java=1&u_h=768&u_w=1366&u_ah=720&u_aw=1366&u_cd=32&u_nplug=14&u_nmime=51&biw=1345&bih=149&ref=http%3A%2F%2Fwww.comehike.com%2F&fu=0&ifi=1&dtd=291&xpc=egJ5ygbjaM&p=http%3A//www.comehike.com from frame with URL http://googleads.g.doubleclick.net/pagead/ads?client=ca-pub-1884332214318974&output=html&h=90&slotname=6750679790&w=728&lmt=1307311140&flash=10.3.181&url=http%3A%2F%2Fwww.comehike.com%2Foutdoors%2Fparks%2Ftrailhead.php&dt=1307285940734&bpp=5&shv=r20110527&jsv=r20110506&correlator=1307285940857&frm=4&adk=540157337&ga_vid=898509444.1299013740&ga_sid=1307285941&ga_hid=824315563&ga_fc=1&u_tz=-420&u_his=10&u_java=1&u_h=768&u_w=1366&u_ah=720&u_aw=1366&u_cd=32&u_nplug=14&u_nmime=51&biw=1345&bih=149&ref=http%3A%2F%2Fwww.comehike.com%2F&fu=0&ifi=1&dtd=291&xpc=egJ5ygbjaM&p=http%3A//www.comehike.com . Domains, protocols and ports must match.
任何想法为什么他们正在发生以及如何解决它们?
这里是我尝试在AJAX返回XML:
echo '<markers>';
$str =
<<<EOD
<marker>
trail_id=$trail_id
trailhead_id=$trailhead_id
park_id=$park_id
editor_member_id=$editor_member_id
trailhead_name=$trailhead_name
trailhead_description=$trailhead_description
parking=$parking
cost_details=$cost_details
parking_spots=$parking_spots
is_free=$is_free
wheelchair_accessible=$wheelchair_accessible
bathrooms_nearby=$bathrooms_nearby
lat=$lat
lng=$lng
</marker>
EOD;
echo $str;
// End XML file
echo '</markers>';
错误很可能是别的东西在页面上正在进行的副作用。特别是与谷歌地图API的东西。 Firefox抛出的错误是Error: uncaught exception: [Exception... "An invalid or illegal string was specified" code: "12" nsresult: "0x8053000c (NS_ERROR_DOM_SYNTAX_ERR)" location: "http://maps.gstatic.com/intl/en_us/mapfiles/api-3/5/5/main.js Line: 93"]
。我会尝试从页面中删除与Google地图相关的所有内容,并查看页面是否正确加载。此外,我会尝试创建另一个空白页面,并按照其中的方式复制Google地图相关的所有内容,并查看Google地图代码是否正常运行。这将告诉我:1)与地图一起工作的代码做的事情很有趣,或2)谷歌地图代码与页面上的其他内容冲突。
P.S.我怀疑罪魁祸首是initializeTrailheads()方法。尝试从onload中删除它,看看会发生什么。
没有看到您的网页上的错误 – Ibu 2011-06-05 19:21:57
您是否试图通过ajax从不同于请求页面的域返回xml?我不相信这是浏览器允许的。 – 2011-06-05 19:25:43
@jen - 不是它在一个域内。 – Genadinik 2011-06-05 19:35:26