RC: google ads broken

Last post 02-01-2007 6:26 PM by lkempe. 12 replies.

Sort Posts:

  • RC: google ads broken

    12-16-2006, 3:31 PM
    • Loading...
    • dblock
    • Joined on 12-06-2005, 5:33 PM
    • New York
    • Posts 90

    Switched from Beta to RC, google ads are now broken.

    Stack:

      A JScript
      C JScript
      Date$_parse JScript
    > Date$parse JScript
      E JScript
      JScript anonymous function JScript
      JScript global code JScript
     

    Looks like it's trying to parse a date among other things, but it may be a red herring: b.google_last_modified_time=Date.parse(a.lastModified)/1000. The value of a.lastModified is "12/16/2006 15:27:28" and trying to evaluate Date.parse in the debugger throws a Sys.FormatException - the string is not recognized as a valid date.

    You can run by google ads to test:

    <script type="text/javascript"><!--
    google_ad_client = "pub-9729078709462697";
    google_ad_width = 120;
    google_ad_height = 600;
    google_ad_format = "120x600_as";
    google_ad_type = "text_image";
    google_ad_channel ="";
    google_color_border = "AACCEE";
    google_color_bg = "AACCEE";
    google_color_link = "000000";
    google_color_url = "666666";
    google_color_text = "333333";
    //--></script>
    <br><br>
    <script type="text/javascript"
    src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
    </script>

    Ideas?

    Thx
    dB.

    dB. - www.dblock.org / www.foodcandy.com
  • Re: RC: google ads broken

    12-17-2006, 3:37 AM
    • Loading...
    • lkempe
    • Joined on 10-03-2002, 3:59 AM
    • Illzach, France
    • Posts 24
    • TrustedFriends-MVPs

    I have exactly the same issue!!! And currently not found any solution.

    If I remove the google ads script then I don't have any issue. With it I have an issue like you are describing!

     

    Best Regards,
    ---
    Laurent Kempé - laurent.kempe@techheadbrothers.com
    Tech Head Brothers - http://www.TechHeadBrothers.com
    Blog - http://weblogs.asp.net/lkempe
    [Microsoft ASP.NET MVP]
  • Re: RC: google ads broken

    12-17-2006, 12:30 PM
    • Loading...
    • dblock
    • Joined on 12-06-2005, 5:33 PM
    • New York
    • Posts 90

    I did some more research. The undefined error comes from the error handler itself (the "C" function). The error handler is called because Date.parse fails - that's the real issue. Date.parse looks busted to me, but I don't think we have the source for this - it's embedded in System.Web.Extensions.dll (?).

    Try:

     Date.parse(new Date().toGMTString())

    Throws a Sys.FormatException.

    This looks like a bug to me. Anyone from the MS.AJAX team could please look at this?

    dB. - www.dblock.org / www.foodcandy.com
  • Re: RC: google ads broken

    12-17-2006, 1:01 PM
    Answer
    • Loading...
    • CyrilCS
    • Joined on 08-16-2006, 9:48 PM
    • DURAND
    • Posts 21

    Hum, Effectively I thinks there is a bug here.

    Try to add the following code before adding the google script.

                Date.__cyril_parse = Date.parse; 
                Date.parse = function(s){
                    try {
                        return Date.__cyril_parse(s);
                    } catch (e){
                        var d = new Date(s); 
                        if (s) {
                            return s; 
                        } else {
                            throw e;
                        } 
                    }
                }
    
     

    I think google use the parse functions but internally Atlas overrides this methods and use theses templates.

     -  formats {...} Object
      [0] "MMMM dd" String
      [1] "yyyy MMMM" String
      [2] "MM/dd/yyyy" String
      [3] "HH:mm" String
      [4] "dddd, dd MMMM yyyy" String
      [5] "HH:mm:ss" String
      [6] "dddd, dd MMMM yyyy HH:mm:ss" String
      [7] "ddd, dd MMM yyyy HH':'mm':'ss 'GMT'" String
      [8] "yyyy'-'MM'-'dd'T'HH':'mm':'ss" String
      [9] "yyyy'-'MM'-'dd HH':'mm':'ss'Z'" String

    My code snippets save the Atlas Date.parse methods override the Date.parse methods, call the saved Date.parse methods in a try catch block and if there is an error call the constructor of the Date object. It works for your sample but I don't know if google overrides this methods to.

  • Re: RC: google ads broken

    12-17-2006, 1:37 PM
    • Loading...
    • dblock
    • Joined on 12-06-2005, 5:33 PM
    • New York
    • Posts 90

    Merci Cyril,

    This works. The bug definitely needs a fix for RTM, a lot of people will get upset if their google ads stop working. And I got to learn JavaScript for real! Maybe I can then do more exciting things with atlas ajax.

    -dB.

     

    dB. - www.dblock.org / www.foodcandy.com
  • Re: RC: google ads broken

    12-17-2006, 4:28 PM
    • Loading...
    • lkempe
    • Joined on 10-03-2002, 3:59 AM
    • Illzach, France
    • Posts 24
    • TrustedFriends-MVPs
    Merci Cyril!!! It is perfect now. Thanks
    Best Regards,
    ---
    Laurent Kempé - laurent.kempe@techheadbrothers.com
    Tech Head Brothers - http://www.TechHeadBrothers.com
    Blog - http://weblogs.asp.net/lkempe
    [Microsoft ASP.NET MVP]
  • Re: RC: google ads broken

    12-17-2006, 5:56 PM
    • Loading...
    • CyrilCS
    • Joined on 08-16-2006, 9:48 PM
    • DURAND
    • Posts 21

    oups my solution was a little bugged and when I blogged this issue I found a new solution. The Atlas has saved the old Date.parse method in Date._jsParse why don't use it ?

    Date.__cyril_parse = Date.parse; 
    Date.parse = function(s){
        try {
            return Date.__cyril_parse(s);
        } catch (e){
            var d = Date._jsParse;
            if (d) {
                return d; 
            } else {
                throw e;
            } 
        }
    }

    This snippet is better than the first one and it would works in all cases.

    For a little more explanation you can have a look at this : Atlas et Google Adsense : bug avec la méthode Date.parse (in French) 

  • Re: RC: google ads broken

    12-17-2006, 6:35 PM
    • Loading...
    • dblock
    • Joined on 12-06-2005, 5:33 PM
    • New York
    • Posts 90
    CyrilCS:

    oups my solution was a little bugged and when I blogged this issue I found a new solution. The Atlas has saved the old Date.parse method in Date._jsParse why don't use it ?

    Date.__cyril_parse = Date.parse; 
    Date.parse = function(s){
        try {
            return Date.__cyril_parse(s);
        } catch (e){
            var d = Date._jsParse;
            if (d) {
                return d; 
            } else {
                throw e;
            } 
        }
    }

    This snippet is better than the first one and it would works in all cases.

    Wait, isn't this returning the function, shouldn't it return d(s) instead?

     

    dB. - www.dblock.org / www.foodcandy.com
  • Re: RC: google ads broken

    12-17-2006, 7:45 PM
    • Loading...
    • CyrilCS
    • Joined on 08-16-2006, 9:48 PM
    • DURAND
    • Posts 21
  • Re: RC: google ads broken

    12-17-2006, 7:47 PM
    • Loading...
    • CyrilCS
    • Joined on 08-16-2006, 9:48 PM
    • DURAND
    • Posts 21

    Exact, here is the code I wrote in my blog post

    Date.__cyril_parse = Date.parse; 
    Date.parse = function(s){
        try {
            return Date.__cyril_parse(s);
        } catch (e){
            var d = Date._jsParse(s);
            if (d) {
                return d; 
            } else {
                throw e;
            } 
        }
    }
    don't understand why it's not one I copy here.
    Thnks for your correction Stick out tongue
  • Re: RC: google ads broken

    12-18-2006, 5:43 PM
    • Loading...
    • fmarguerie
    • Joined on 10-23-2003, 3:05 PM
    • Posts 42

    Merci Cyril !

    It's an important problem and I'm sure Microsoft will realize that it needs to be fixed quickly.

  • Re: RC: google ads broken

    02-01-2007, 6:18 PM

    Hi,

    Is it still an issue?

    I'm developing http://AdSenseASP.NET/ - web controls to display Google AdSense ad units e.g. AdUnit, LinkUnit, ReferralUnit and wonder do I need include this code to my output JScript or it's already fixed?

    --
    More about me at http://sharp-developer.net/CV/

  • Re: RC: google ads broken

    02-01-2007, 6:26 PM
    • Loading...
    • lkempe
    • Joined on 10-03-2002, 3:59 AM
    • Illzach, France
    • Posts 24
    • TrustedFriends-MVPs

    Hi

     No it is not an issue with the RTM so you don't need to include.

    Best Regards,
    ---
    Laurent Kempé - laurent.kempe@techheadbrothers.com
    Tech Head Brothers - http://www.TechHeadBrothers.com
    Blog - http://weblogs.asp.net/lkempe
    [Microsoft ASP.NET MVP]
Page 1 of 1 (13 items)
Microsoft Communities