Facebook share of my blogger blog shows some javascript coding

2 posts / 0 new
Last post
#1 29 November, 2011 - 11:22
Ramakrishnan
Ramakrishnan's picture

Facebook share of my blogger blog shows some javascript coding

My blogger blog shows some javascript text when I am sharing it in facebook as like below..

var mydate=new Date() var year=mydate.getYear() if (year <​ 1000) year+=1900 var day=mydate.getDay() var month=mydate.getMonth() var daym=mydate.getDate() if (daym<​10) daym="0"+daym var dayarray=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday") var montharray=new Arr…

What be the problem?

29 November, 2011 - 19:36
admin
admin's picture

Facebook sharing detects the first <p> tag in your page from the link. Then shows the text in the sharing status page.

In your case, the problem is with your template, edit your template and move the javascript block to header.

You may include it in a function and call it in body onload event. Include the below before tag:

i.e., Include the below code above the </head> tag:

Change the <body> tag

  1. <body onload="displayDate()">

Include id 'dispdate', where you want to display date.

  1. <p id="dispdate"></p>
Log in to post comments