Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Regular Coder
    Join Date
    Dec 2009
    Posts
    173
    Thanks
    24
    Thanked 1 Time in 1 Post

    "Echoing" diferent in chrome and firefox. Blogger.

    Hi guys! This is the website -> http://toplistmovies.blogspot.com/.

    Im having trouble about the posts below the slides.

    In firefox i see this ->
    http://s16.postimage.org/v4nmny4ar/fasdfalsdjf.png

    In Chrome i see this ->
    http://s16.postimage.org/uges505kz/fasdfasdfasdf.png

    This is the code ->
    Code:
    <div class='Image thumb' style='overflow:hidden;'>
    
    <b:if cond='data:post.isFirstPost'> 
    <script type='text/javascript'>
    //<![CDATA[
    function bp_thumbnail_resize(image_url,post_title)
    {
    var default_thumbnail="http://3.bp.blogspot.com/-WxjumWhIM5E/TwKvb6jtXoI/AAAAAAAAEG0/hBQHJnIO5eE/s000/default.png";
    
    if(image_url == "") image_url= default_thumbnail;
    var nova = image_url.replace('s72-c', 's400', image_url);
    image_tag='<img src="'+nova+'" style="width:260px;" alt="'+post_title+'"/>';
    
    if(image_url!="") return image_tag; else return "";
    }
    //]]>
    </script>
    </b:if>
    <a expr:href='data:post.url'><script>
    document.write(bp_thumbnail_resize(&quot;<data:post.thumbnailUrl/>&quot;,&quot;<data:post.title/>&quot;));</script>
    </a>
    </div>
    
    
    
    <div class='information'> 
    <div class='js-kit-rating' expr:path='data:post.url' expr:permalink='data:post.url' expr:title='data:post.title'>
    </div>
    </div>
    </div>
    
    <div class='postBoxMeta'>
    <div class='postDate'>
    <script type='text/javascript'>
    var timestamp = &quot;<data:post.dateHeader/>&quot;;
    if (timestamp != '') {
    var timesplit = timestamp.split(&quot;,&quot;);
    var date_yyyy = timesplit[2];
    var timesplit = timesplit[1].split(&quot; &quot;);
    var data = timesplit[2];
    var date_dd = data.replace("de", "", timesplit[2]);
    var date_mmm = timesplit[1].substring(0, 3);
    }
    </script>
    <span class='day'><script type='text/javascript'>document.write(date_dd);</script>Dia</span> <br/>
    <span class='month'><script type='text/javascript'>document.write(date_mmm);</script></span>
    </div>
    Last edited by sorlaker; 01-18-2012 at 10:38 PM.

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,020
    Thanks
    75
    Thanked 4,323 Times in 4,289 Posts
    This line
    Code:
    image_tag='<img src="'+image_url.replace('s72-c', 's400', image_url)+'" style="width:260px;" alt="'+post_title+'"/>';
    in your bp_thumbnail_resizep function is failing in FireFox.

    I would assume it is because you have an extra argument to the replace() function.

    I don't know why it doesn't fail in Chrome, as it should, but I can only guess that Chrome is more forgiving.

    The replace( ) method takes only *TWO* arguments, not three. The code in red above is thus bogus.

    *******

    p.s.: This took roughly 3 minutes to find using FireBug. Time to learn to use such debuggers.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • Users who have thanked Old Pedant for this post:

    sorlaker (01-19-2012)

  • #3
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,020
    Thanks
    75
    Thanked 4,323 Times in 4,289 Posts
    FireBug also complains about this line:
    Code:
    	var timesplit = timesplit[1].split(" ");
    I don't see what the problem is there, except possibly that because your are using a string instead of a regular expression it is misinterpreted.

    Try using split( /\s/ ) to see if the error goes away.

    By the same token, you should probably use .replace(/s72\-c/, 's400') in the other case.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • Users who have thanked Old Pedant for this post:

    sorlaker (01-19-2012)

  • #4
    Regular Coder
    Join Date
    Dec 2009
    Posts
    173
    Thanks
    24
    Thanked 1 Time in 1 Post
    Thanks! U guys helped me a lot!

  • #5
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,731
    Thanks
    202
    Thanked 2,508 Times in 2,486 Posts
    Quote Originally Posted by Old Pedant View Post
    FireBug also complains about this line:
    Code:
    	var timesplit = timesplit[1].split(" ");
    I don't see what the problem is there, except possibly that because your are using a string instead of a regular expression it is misinterpreted.

    Surely the problem is that both the arrays have same name timesplit?

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •