RadHtmlPlaceholder HTML5 problem

8 posts, 0 answers
  1. Hans-Jürgen
    Hans-Jürgen avatar
    13 posts
    Member since:
    Oct 2012

    Posted 01 Dec 2011 Link to this post

    Hi ,

    in my Silverlight app I used to do the following to call a Javascript function in a html page loaded in a RadHtmlPlaceholder

    HtmlElement iframe = myradhtmlplaceholder.HtmlPresenter.Children[0] as HtmlElement;
    iframe.SetAttribute("id", "myID");
    HtmlObject myhtmlobj = HtmlPage.Document.GetElementById("myID").GetProperty("contentWindow") as HtmlObject;

    myhtmlobj.Invoke("MyFunction", new string[] { "This is a test" });


    Now I have a HTML version 5 page where I still have my 'MyFunction' javascript function defined, but
    myhtmlobj  is NULL.

    Do I need (for html5) do a different call to get a handle for the htmlwindow ?

    Hope you can help.
    Best regards
    Hans-Juergen


  2. Hans-Jürgen
    Hans-Jürgen avatar
    13 posts
    Member since:
    Oct 2012

    Posted 01 Dec 2011 Link to this post

    Hi,

    for your information
    I used FF v8 . The html 5 page I open is: http://www.proteax.dk/proteax_live/protein_editor.py/show

    The name of the function I try to call is:
    loadProtein

    Regards
    Hans-Juergen

  3. DevCraft banner
  4. Kiril Stanoev
    Admin
    Kiril Stanoev avatar
    1511 posts

    Posted 02 Dec 2011 Link to this post

    Hello Hans-Jürgen,

    Is the code you're showing working if the HTML page was not v. 5? This article explains the exact steps to calling a JS function with RadHtmlPlaceholder. 

    All the best,
    Kiril Stanoev
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  5. Hans-Jürgen
    Hans-Jürgen avatar
    13 posts
    Member since:
    Oct 2012

    Posted 04 Dec 2011 Link to this post

    Hi Kiril,

    turns out that the problem is due to crossdomain access.
    The html 5 page I specify in the sourceurl of the radhtmlplaceholder control is not in the same domain as the silverlight application.

    Since the html5 page resides in a apache webserver on a unix machine:
    How does apache/linux handle those crossdomain calls.
    In Windows (IIS) you place a clientaccesspolicy.xml in the root of the IIS webserver and this allows the sl app to access the page.
    We tried placing clientaccesspolicy.xml and crossdomain.xml in the root of the apache webserver on the linux machine, but the access fails.
    Does Apache (or Apache on Linux) handles the requests to call a javascript function in a page residing on the apache webserver DIFFERENT than IIS/Windows.

    What do I need to do to allow my SL app to access Javascript functions residing in pages hosted on Apache/Linux ??


    Hope you can help.
    Best regards
    Hans-Juergen 
     
  6. Kiril Stanoev
    Admin
    Kiril Stanoev avatar
    1511 posts

    Posted 05 Dec 2011 Link to this post

    Hello Hans-Jürgen,

     To be honest I am not really sure how an Apache server handles the requests and which are the additional steps you must perform to make crossdomain calls work. Since it is a more general question, I'd advice you to post it in either on Silverlight.NET forums or stackoverflow. Meanwhile, if you permit, it would be great if we turn this support ticket to a forum thread since there might be a member of the Telerik community who has knowledge on the subject.

    Greetings,
    Kiril Stanoev
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  7. Hans-Jürgen
    Hans-Jürgen avatar
    13 posts
    Member since:
    Oct 2012

    Posted 05 Dec 2011 Link to this post

    Hi Kiril,

    no problem to post that in the telerik forum.
    The question I need to answer is:

    What do I need to on Apache/Linux to allow a Silverlight app to do crossdomain java scripting ? The Silverlight app is hosted in IIS/Windows and the external html page (placed in RadHtmlPlaceholder) is hosted on Apache/Linux ?

    Hope the bigger audience can help.
    Best
    Hans-Juergen


  8. Kiril Stanoev
    Admin
    Kiril Stanoev avatar
    1511 posts

    Posted 06 Dec 2011 Link to this post

    Hi Hans-Jürgen,

    I have converted this support ticket to a forum thread. Let's see if anyone else can help.

    All the best,
    Kiril Stanoev
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  9. hwsoderlund
    hwsoderlund avatar
    419 posts
    Member since:
    Aug 2006

    Posted 07 Dec 2011 Link to this post

    I do not think that this can be solved with a client access policy file on the server. AFAIK, that file only regulates if the silverlight app or a flash app can make requests to pages or web services on other domains. It has nothing to do with javascript calls. You may want to check out the information on this page and see if it helps you.
Back to Top
DevCraft banner