This is a migrated thread and some comments may be shown as answers.

snippet for Javascript

3 Answers 54 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Aslam
Top achievements
Rank 1
Aslam asked on 30 Nov 2011, 01:57 PM
Hi there,

I have read "code snippets" as chunk of HTML.

My project needs me to add snippet that has chunk of JavaScript, such as twitter search widget.
Does not need to show on Editor Design though(as <script> etc).
How can we achieve this?

regards
ami

3 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 02 Dec 2011, 12:48 PM
Hello Ami,

RadEditor automatically strips the <script> tags and to allow them you should disable the RemoveScripts filter.

Best regards,
Rumen
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
Aslam
Top achievements
Rank 1
answered on 02 Dec 2011, 05:33 PM
Thanks for  reply.
But my issue is adding a snippet that contains javascript
something below as snippet

<script src="http://widgets.twimg.com/j/2/widget.js"></script>
<script>
new TWTR.Widget({
  version: 2,
  type: 'search',
  search: 'rainbow',
  interval: 30000,
  title: 'It\'s a double rainbow',
  subject: 'Across the sky',
  width: 250,
  height: 300,
  theme: {
    shell: {
      background: '#8ec1da',
      color: '#ffffff'
    },
    tweets: {
      background: '#ffffff',
      color: '#444444',
      links: '#1985b5'
    }
  },
  features: {
    scrollbar: false,
    loop: true,
    live: true,
    behavior: 'default'
  }
}).render().start();
</script>

----------------------------------------

Does snippet allow Javascript?
0
Rumen
Telerik team
answered on 02 Dec 2011, 09:03 PM
Hello Aslam,

Put some content for example a &nbsp; before the <script> tag, because in other case IE will strip it, e.g.

&nbsp;
<script>...

Kind regards,
Rumen
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Tags
Editor
Asked by
Aslam
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Aslam
Top achievements
Rank 1
Share this question
or