How can I call javascript from another site? I recently started working in collaboration with another drupal website, and we are trying to figure out how to get some of their content embedded into my site. They sent my some embed code for a widget, which is below (with some pieces changed for privacy: 

&lt;script type="text/javascript"&gt;
  widgetContext = { "url": "http://theirsite.com/mysite/[nid]", "width": "600", "height": 200, "widgetid": "web_widget_iframe_hash" };
&lt;/script&gt;
&lt;script id="web_widget_iframe_hash" src="http://theirsite.com/sites/all/modules/web_widgets/iframe/web_widgets_iframe.js"&gt;
&lt;/script&gt;


The problem is that I cannot figure out how to get this embedded into my site. The widget generates calendars for venues, so the content is going to change based on which node is being viewed on my site. So, in my nodes, I added a field that stores the NID of the corresponding node on the other site so that the correct calendar is generated. 

I'm trying to create a view, in order to dynamically call the above script for each page on my site. The view uses a token to take the NID field and place it into the first part of the script. However, when I place this code into a Custom Field, views strips the script tags and displays the rest of it as text. When I try to place it into a PHP field, it doesn't display at all.

Does anybody have a suggestion for how I can use the above code on my site? I'm at a bit of a loss.
You could add the JS in code.

e.g:

/**
 * Implements hook_init
 */
function mymodule_init(){
  if ($node = menu_get_object('node')) {
    if ($node-&gt;type == 'my_type') {
      $items = field_get_items('node', $node, 'field_my_nid_field');
      if (!empty($items[0]['value'])) {
        $nid = filter_xss($items[0]['value']);
        drupal_add_js('
        widgetContext = { "url": "http://theirsite.com/mysite/'.(int)$nid.'", "width": "600", "height": 200, "widgetid": "web_widget_iframe_hash" };
        ', array('type' =&gt; 'inline', 'scope' =&gt; 'header'));
      }
    }
  }
}


The other static script tag can be added in a custom Full HTML block / content pane or similar, where you want the content to display.