[SOLVED] Any\All jQuery causes Non-Translatable Function Exception: The function 'xxx' could not be translated.
Posted: Mon Sep 18, 2017 8:31 am
jQuery works in Simulator, does not work in .js output. Unable to use any jQuery in CSHTML5.Interop.ExecuteJavascript.
Works in Simulator, NonTranslatable function Exception in JS output.
Tried setting noConflict:
Works in Simulator, NonTranslatable function Exception in JS output.
Tried just using jQuery noConflict without declaring it:
Error jQuery is not defined.
Here is the exception from the output when I try to execute a jQuery function:
Code: Select all
await Interop.LoadJavascriptFile(urlToHostedjQueryDOTjs);
Interop.ExecuteJavascript("$('#myElementID').show();");
Works in Simulator, NonTranslatable function Exception in JS output.
Tried setting noConflict:
Code: Select all
Interop.ExecuteJavascript(@"
var jQuery = $.noConflict();
jQuery('#myElementID').show();");
Works in Simulator, NonTranslatable function Exception in JS output.
Tried just using jQuery noConflict without declaring it:
Code: Select all
jQuery('#myElementID').show();
Error jQuery is not defined.
Here is the exception from the output when I try to execute a jQuery function:
JSIL.Browser.js?20179180925:201 Error: The function 'System.Void HTMLButtonTest.KendoUIButton::OnJSLoaded()' could not be translated.
at HTMLButtonTest_KendoUIButton.UntranslatableFunctionInvoked (JSIL.Core.js?20179180925:1228)
at CSHTML5_INTERNAL_InteropImplementation_$l$gc__DisplayClass7.Delegate_Invoke [as onCompleted] (JSIL.Core.js?20179180925:9344)
at Object.INTERNAL_InteropImplementation_LoadJavaScriptFiles (CSharpXamlForHtml5.js?20179180925:7548)
at CSHTML5_INTERNAL_InteropImplementation_$l$gc__DisplayClass7.$l$gc__DisplayClass7_$lLoadJavaScriptFiles$gb__5 (CSharpXamlForHtml5.js?20179180925:7614)
at HTMLScriptElement.Delegate_Invoke (JSIL.Core.js?20179180925:9344)
JSIL.Browser.WarningService.write @ JSIL.Browser.js?20179180925:201
JSIL.Browser.js?20179180925:199 Error: The function 'System.Void HTMLButtonTest.KendoUIButton::OnJSLoaded()' could not be translated.
at HTMLButtonTest_KendoUIButton.UntranslatableFunctionInvoked (JSIL.Core.js?20179180925:1228)
at CSHTML5_INTERNAL_InteropImplementation_$l$gc__DisplayClass7.Delegate_Invoke [as onCompleted] (JSIL.Core.js?20179180925:9344)
at Object.INTERNAL_InteropImplementation_LoadJavaScriptFiles (CSharpXamlForHtml5.js?20179180925:7548)
at CSHTML5_INTERNAL_InteropImplementation_$l$gc__DisplayClass7.$l$gc__DisplayClass7_$lLoadJavaScriptFiles$gb__5 (CSharpXamlForHtml5.js?20179180925:7614)
at HTMLScriptElement.Delegate_Invoke (JSIL.Core.js?20179180925:9344)
JSIL.Browser.WarningService.write @ JSIL.Browser.js?20179180925:199
JSIL.Host.js?20179180925:240 Uncaught Error: The function 'System.Void HTMLButtonTest.KendoUIButton::OnJSLoaded()' could not be translated.
at HTMLButtonTest_KendoUIButton.UntranslatableFunctionInvoked (JSIL.Core.js?20179180925:1228)
at CSHTML5_INTERNAL_InteropImplementation_$l$gc__DisplayClass7.Delegate_Invoke [as onCompleted] (JSIL.Core.js?20179180925:9344)
at Object.INTERNAL_InteropImplementation_LoadJavaScriptFiles (CSharpXamlForHtml5.js?20179180925:7548)
at CSHTML5_INTERNAL_InteropImplementation_$l$gc__DisplayClass7.$l$gc__DisplayClass7_$lLoadJavaScriptFiles$gb__5 (CSharpXamlForHtml5.js?20179180925:7614)
at HTMLScriptElement.Delegate_Invoke (JSIL.Core.js?20179180925:9344)