开发者

Google Analytics Javascript error

开发者 https://www.devze.com 2023-03-10 07:47 出处:网络
I have this page which used to return some other JavaScript errors, but it seems I fixed them since the system now complains differently :)

I have this page which used to return some other JavaScript errors, but it seems I fixed them since the system now complains differently :)

Here is the page:

http://www.comehike.com/outdoors/parks/trailhead.php

And here is the JS error I am getting in the console:

Unable to post message to http://googleads.g.doubleclick.net. Recipient has origin http://www.comehike.com.

Also there is this error which is very cryptic:

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&开发者_StackOverflow社区amp;p=http%3A//www.comehike.com. Domains, protocols and ports must match.

Any idea why they are happening and how to resolve them?

Here is how I try to return the XML in the AJAX:

    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>';


The error most likely is a side effect of something else going on on the page. Specifically something with the google maps API. The error Firefox throws is 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"]. I would try and remove everything Google Maps related from the page and see if the page loads without errors. Also I would try and create another blank page and copy everything Google Maps related from this page the way it is there and see if just Google Maps code runs without errors. That would show me that: 1) either the code that works with the map is doing something funky, or 2) The google maps code is conflicting with something else on the page.

P.S. i suspect the culprit is initializeTrailheads() method. Try removing it from onload and see what happens.

0

精彩评论

暂无评论...
验证码 换一张
取 消