Have you tried skipping Invoke, and just call your function directly?

HtmlPage.Window.myTestFunction("Test");


Caleb Jenkins | m: 469-867-552

Sent from Windows Phone 7
------------------------------
From: Greg Keogh
Sent: 11/29/2011 7:21 AM
To: ozSilverlight
Subject: RE: RE: Failed to invoke: Javascript function

HtmlPage.Window.Alert("Test");

as per this thread http://forums.silverlight.net/t/211409.aspx/1



Alert works. I have spent another two hours trying to get the Invoke
working.



I looked back to June 2010 in version control to see who I did a similar
testing technique then. I used GetProperty() to get a ScriptObject and then
InvokeSelf. That code no longer works and I get null back from GetProperty.



I have tried dozens of script functions signatures and nothing changes.



I have moved the script to different places but nothing changes.



I tried calling OnSilverlightError (the function generated by the wizard)
and I get a different error “Object doesn't support property or method
'getHost'”, but that gives me no clues. I also tried renaming my function
to OnSilverlightError but I get no clues.



So after 4 man-hours of trying to get any JavaScript function work (even an
empty one) I only get the “Failed to Invoke” error and I have no clues. I
only know that a fresh wizard generated SL4 app does Invoke okay and my
real one doesn’t.



So here we are well into the 21st century in the age of science fiction and
I’m still spending half of my working life trying to get hello world
scripts to run. Even on mainframes I had core dumps to analyse, now I
usually have nothing but “sorry for the inconvenience”. Silverlight, WPF,
WCF and security blocks are fucking killing me, I’m wasting time, losing
money and going mad and losing sleep, and this has been going on for years
now with absolutely no sign that anything will improve.



Oh well, now I will waste another hour up until 1:30am trying to get script
debugging working in VS2010 (as John just suggested), but I’m sure if I do
get it working (I thought it already was?!) then I will learn nothing and
be right back where I started two days ago.



Greg
_______________________________________________
ozsilverlight mailing list
ozsilverlight@ozsilverlight.com
http://prdlxvm0001.codify.net/mailman/listinfo/ozsilverlight

Reply via email to