Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have read the Answer to "Dynamically Display Current Site Name in Content Editor Web Part" but i do not understand why

> <script type="text/javascript" language="javascript">   
> window.onload=func1;  function func1() { var GetSiteTitle =
> document.createElement("span");    GetSiteTitle.id = "span1";   
> GetSiteTitle.className ="dynamicSpan";    GetSiteTitle.innerHTML = 
> document.getElementsByTagName('title')[0].innerHTML;  
> document.body.appendChild(GetSiteTitle);} </script>

is not showing anything in the CEWP. How do i get the varibale GetSiteTitle to render the title? Thanks for your help.

share|improve this question
    
Could you clarify your question? Is the script not loading, the title not loading, is the script disappearing or are you getting an error on the javascript variable? –  Dave Wise Oct 17 '12 at 16:47
    
Try alerting in the script to see if the JavaScript code is being called? –  Falak Mahmood Oct 17 '12 at 16:48
add comment

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.