Unable to Invoke Inserted Javascript Fragment

前端 未结 2 475
悲&欢浪女
悲&欢浪女 2021-01-07 11:01

I am attempting to insert a Javascript fragment into a webpage and then invoke it using blue prism. The purpose of this is to analyse what elements are returned from a searc

相关标签:
2条回答
  • 2021-01-07 11:49

    To invoke function by action "Invoke Javascript function", in Arguments field you should put arguments in JSON syntax. If there is no argument you put "[{}]".

    On the above Marek's example the function should look:

    function sayHello(name)
    {
        alert("Hello " + name.name + "!");
    }
    

    and arguments: "[{'name':'world'}]".

    0 讨论(0)
  • 2021-01-07 12:05

    I was actually never able to get Invoke Function working reliably with parameters, I always use Insert Fragment for everything, invoking included.

    If you insert this function as a fragment...

    function sayHello(name)
    {
        alert("Hello " + name + "!");
    }
    

    ...to invoke it you just insert this as another fragment:

    sayHello("World");
    

    Tadaa!

    As a side note, I am not sure which element in Application Modeler you are using for fragment insertion, but it seems like you are using the root (application) node. I had better experience with inserting the fragment to a dedicated HTML BODY element, for some reason the performance is much greater.

    0 讨论(0)
提交回复
热议问题