国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

javascript - How to pass value to js in c#
曾經(jīng)蠟筆沒有小新
曾經(jīng)蠟筆沒有小新 2017-05-16 13:24:17
0
1
771

c# Pass a domainurl address to the front end. The code written by c# to the front end is as shown in Figure 1.
This is a self-tuning function. If my front end wants to get this domainurl, how can I directly console.log(cefRuntimeInfo. domainurl), the address can be obtained directly, but if the function setRuntimeInfo is called, the error domain.url is not defined will be reported;
c# is written as follows:

//c#輸出前端配置文件
        public static string domainurl = "http://test.edu.com.cn:8080"; 
//網(wǎng)頁加載完成時(shí)觸發(fā)事件
            LoadHandler.OnLoadEnd += (sender, args) =>
            {
                //判斷下觸發(fā)的事件是不是主框架的
                if (args.Frame.IsMain)
                {
                    //ShowDevTools();W
                    //執(zhí)行JS,將當(dāng)前的CEF運(yùn)行版本等信息通過JS加載到網(wǎng)頁上
                    var js = $"$client.setRuntimeInfo({{ domainurl:'{domainurl.ToString()}'}});";
                    ExecuteJavascript(js);
                }


            };

        }

[I am a front-end, please give me some advice on how to get the domainurl as my ajax interface address]

曾經(jīng)蠟筆沒有小新
曾經(jīng)蠟筆沒有小新

reply all(1)
phpcn_u1582

Save it in a global variable

For example:
willconsole.log(cefRuntimeInfo.domainurl);

changed to

window.domaiurl = cefRuntimeInfo.domainurl;

A better suggestion is to ask your colleagues to see how they do it. I feel this is related to the internal framework of your company.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template