More in this section

Forums / Developing with Sitefinity / How to enable javascript?

How to enable javascript?

13 posts, 0 answered
  1. Daniel
    Daniel avatar
    5 posts
    Registered:
    27 Jul 2008
    20 Jan 2009
    Link to this post
    Hello,

    I am sorry if this has been covered before but I have searched the forum pages and haven't found out how exactly to enable javascript on a website through Sitefinity in layman's terms.

    When I add the code and click I'm Done, the script gets erased.  I am trying to add a Flash music player which will be used for voice talent on my site.

    Is there a tutorial on how to enable javascript?

    Here is the code that I am trying to use:

    <script type="text/javascript" src="swfobject.js"></script>
            
    <div id="flashPlayer">
      This text will be replaced by the flash music player.
    </div>

    <script type="text/javascript">
       var so = new SWFObject("playerMultipleList.swf", "mymovie", "295", "200", "7", "#FFFFFF");  
       so.addVariable("autoPlay","no")
       so.addVariable("playlistPath","playlist.xml")
       so.write("flashPlayer");
    </script>

    Thanks!
  2. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    20 Jan 2009
    Link to this post
    Hi Daniel,

    Please refer to the forum thread Generic Content control -- RadEditor -- script tags. There is a solution posted for this issue in that thread.

    All the best,
    Georgi
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. Daniel
    Daniel avatar
    5 posts
    Registered:
    27 Jul 2008
    20 Jan 2009
    Link to this post
    Georgi,

    Thank you for the reply!  That seemed to have done the trick.

    Thanks again,
    Daniel
  4. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    20 Jan 2009
    Link to this post
    Hello Daniel,

    I am glad that you have it working now.
    Don't hesitate to contact us if you have other questions.

    Greetings,
    Georgi
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  5. Daniel
    Daniel avatar
    5 posts
    Registered:
    27 Jul 2008
    20 Jan 2009
    Link to this post
    Sorry... the template overview is visible but where do my files go?

    I have the following to use:
    playlist.xml
    playerMultipleList.swf
    song.mp3
    swfobject.js

    Thanks.
  6. Daniel
    Daniel avatar
    5 posts
    Registered:
    27 Jul 2008
    23 Jan 2009
    Link to this post
    Gorgi or anyone have any thoughts on where in the folder structure I need to upload my files?

    Thanks.
  7. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    27 Jan 2009
    Link to this post
    Hello Daniel,

    How do you set up the path? It really doesn't matter where you upload your files, but you should set the full path to them.
    If you still have problems with this, please send me everything that should be included in the RadEditor's content, with the files. I will do it locally then tell you the steps.

    All the best,
    Georgi
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  8. Daniel
    Daniel avatar
    5 posts
    Registered:
    27 Jul 2008
    28 Jan 2009
    Link to this post
    Gorgi,

    I have gotten it working 100% this time!  I forgot to link where the files are... embarrassing.  Here is what I forgot to do in case another person comes across this thread with the same problem.

    Here is the script I used: (changes/additions are in bold & red)
    <script type="text/javascript" src="swfobject.js"></script>
            
    <div id="flashPlayer">
      This text will be replaced by the flash music player.
    </div>

    <script type="text/javascript">
       var so = new SWFObject("http://www.website.com/folder/playerMultipleList.swf", "mymovie", "295", "200", "7", "#FFFFFF");  
       so.addVariable("autoPlay","no")
       so.addVariable("playlistPath","http://www.website.com/folder/playlist.xml")
       so.write("flashPlayer");
    </script>
  9. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    28 Jan 2009
    Link to this post
    Hello Daniel,

    I am glad you have it working!
    You can also try using dynamic links with ~/path_to_the_files.

    Don't hesitate to contact us if you have other questions.

    Best wishes,
    Georgi
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  10. Zahid Ali
    Zahid Ali avatar
    47 posts
    Registered:
    16 Nov 2009
    07 Dec 2009
    Link to this post
    hi Georgi,

    with regards to your suggestion: 'You can also try using dynamic links with ~/path_to_the_files.'

    this doesn't work if 'runat="server"' is not present. And when i put the runat, the scripts throws up an error.

    also, I don't think so if I could use (~) for the SWFObject method.

    Whats the alternative to resolve root path?

    thanks.
  11. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    07 Dec 2009
    Link to this post
    Hello Zahid Ali,

    Unfortunatelly you will have to use the full path because JavaScript does not have built in file handling. There is only ../ for finding parent direcotry and ./ for the current directory.


    Best wishes,
    Radoslav Georgiev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  12. Zahid Ali
    Zahid Ali avatar
    47 posts
    Registered:
    16 Nov 2009
    07 Dec 2009
    Link to this post
    Thanks Radoslav,

    I've managed to get one of suggestions ( by ivan ) to work for root paths which can be found here: http://www.sitefinity.com/support/forums/sitefinity-3-x/developing-with-sitefinity/error-in-editing-master-page.aspx

    Since, this is on the master document, to update one variable isn't a great deal. However, what i want to know is, if this approach has any set back / drawback(s).

    thanks!
  13. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    07 Dec 2009
    Link to this post
    Hi Zahid Ali,

    You should just note that when you move from local to production environment that the correct setting is applied to the root variable in the master page. Otherwise there should not be any other drawbacks to using this approach.


    Sincerely yours,
    Radoslav Georgiev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Register for webinar
13 posts, 0 answered