Skip to content

Passing object containing some properties as JSObject's? #92867

Discussion options

You must be logged in to vote

This is what I ended up with after dealing with the hurdle that Arrays of JSObject's aren't supported in some scenarios:

    JQueryProxy.BindListener = function (jsObject, events, shouldConvertHtmlElement, action)
    {
        let handler = function (e) {
            // declare a javascript array called replacements, and implement JSON.stringify with a replacer that adds items which are of type HTMLElements to the array
            var replacements = [];
            var eEncoded = JSON.stringify(e, function (key, value) {
                if (this[key] instanceof HTMLElement) { 
                    
                    if (shouldConvertHtmlElement) {
                        replacements.push

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by SerratedSharp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
arch-wasm WebAssembly architecture area-System.Runtime.InteropServices.JavaScript os-browser Browser variant of arch-wasm
2 participants