...

View Full Version : "Echoing" diferent in chrome and firefox. Blogger.



sorlaker
01-18-2012, 10:46 PM
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 ->

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

Old Pedant
01-19-2012, 01:34 AM
This line


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.

Old Pedant
01-19-2012, 01:41 AM
FireBug also complains about this line:


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.

sorlaker
01-19-2012, 10:36 AM
Thanks! U guys helped me a lot!

Philip M
01-19-2012, 12:22 PM
FireBug also complains about this line:


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?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum