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
7 Answers, 1 is accepted
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
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 >>
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
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.
Kiril Stanoev
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
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
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 >>