JavaScript for Check for Published Mode of current aspx page

<div id=”contentarea”>
<!– Start implementation for Published Mode –>
<script type=”text/javascript” >
CheckForPublishing();
function CheckForPublishing()
{
var x=document.getElementById(“Ribbon.PublishTab-title”);
if(x==null)
LoadScript();

}

function LoadScript() {
var ss = document.createElement(‘script’);
var scr = ‘alert(“Well Done Amjad!!…Its working…”);’;
ss.text = scr;
ss.setAttribute(“type”, “text/javascript”);
//ss.setAttribute(“src”, “http://Google.com“);
var hh = document.getElementsByTagName(‘head’)[0];
hh.appendChild(ss);
}

</script>

<!– End implementation for Published Mode  –>
</div>

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s