cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

Is it possible to embed a script widget in a mashup?

sclifford
1-Newbie

Is it possible to embed a script widget in a mashup?

I want to add a <script>....</script> widget to a Mashup.

Is this possible? How can this be achieved?

For example:

<script>window.twttr = (function(d, s, id) {

  var js, fjs = d.getElementsByTagName(s)[0],

  t = window.twttr || {};

  if (d.getElementById(id)) return t;

  js = d.createElement(s);

  js.id = id;

  js.src = "https://platform.twitter.com/widgets.js";

  fjs.parentNode.insertBefore(js, fjs);

  t._e = [];

  t.ready = function(f) {

  t._e.push(f);

  };

  return t;

}(document, "script", "twitter-wjs"));</script>

I know there is a Twitter extension, but how can this be done without the extension.

Thanks,

Shane

1 ACCEPTED SOLUTION

Accepted Solutions
posipova
20-Turquoise
(To:sclifford)

At least for the security purposes, this is not part of Thingworx out of the box functionality.

View solution in original post

4 REPLIES 4
posipova
20-Turquoise
(To:sclifford)

I might not understand your requirements well, please correct me if I'm wrong. But here's one idea, if you use a textarea widget or an html widget(if you want an html script), you may create a service with a certain type of input(string, json, html, etc) and tie the textarea widget output to that service's input. Then you may manipulate it within the service as you wish.

But if you are asking about dynamically created services, through a mashup, such a function is not possible.

I think it is the dynamic case ...

If I had a simple HTML + CSS + JS webpage, I would insert my <script> widget code at the end of the source code, just inside the </body> tag. Save the change and refresh the page, and I would expect to see the widget dynamically appear.

I don't take it this cannot be done in ThingWorx?

posipova
20-Turquoise
(To:sclifford)

At least for the security purposes, this is not part of Thingworx out of the box functionality.

ankigupta
5-Regular Member
(To:sclifford)

Hi Shane Clifford​,

It would be great if you can share your usecase in more detail.

Thanks,

Ankit Gupta

Top Tags