Answered Where is best place to copy the generated javascript?

  • Wednesday, March 03, 2010 2:11 AM
     
     
    I apologize if this has been previously posted, I didn't see it was.

    I've already set up the widget on one of my SharePoint pages using a "content editor web part", but I need it available for every page in the site. The instructions are, to me anyway, quite vague. "copy the code anywhere in your site". Uh huh that's pretty useful. 

    So, where do most people place this javascript to make it a available site wide, not just page wide?

    The master page for example?

    Thanks in advance

Answers

  • Wednesday, March 17, 2010 6:53 AM
    Owner
     
     Answered
    Hi Carl,

    the best place to place the widget is in an element of your chrome - a piece of HTML that shows up on every page of your site.
    If you do not want to give up the real estate for the widget, you can call the AJAX API directly from your chrome, for instance a language list or a tiny set of flags you place somewhere to invoke the JScript methods.

    Let us know if this doesn't help,
    Chris Wendt
    Microsoft Translator

All Replies

  • Wednesday, March 17, 2010 6:53 AM
    Owner
     
     Answered
    Hi Carl,

    the best place to place the widget is in an element of your chrome - a piece of HTML that shows up on every page of your site.
    If you do not want to give up the real estate for the widget, you can call the AJAX API directly from your chrome, for instance a language list or a tiny set of flags you place somewhere to invoke the JScript methods.

    Let us know if this doesn't help,
    Chris Wendt
    Microsoft Translator
  • Tuesday, June 08, 2010 6:58 AM
     
     
    Thanks for Chris' answer. But what I am interested in is that why the best place to place the widget is in an element of your chrome - a piece of HTML that shows up on every page of your site?
  • Tuesday, June 08, 2010 3:02 PM
    Owner
     
     

    Hi William,

    the widget can only act on documents it is a part of. The script needs to parse the document object model to find all the translatable elements, and it can do this only if it is a part of the document. Browser security prohibits access to pages the script is not a part of.

    If you want translator functionality for the whole site, the script needs to be part of every page on the site. Of course you can also choose any subset of the site you want translation abilities for.

    Hope this helps,
    Chris Wendt
    Microsoft Translator