[Bug]JSIL.Builtins.Global[name] return null

Please report bugs here. If you are unsure whether something is a bug or an expected behavior, please post it on the "Technical Support" forum instead, and wait for a moderator to handle/move the post.
h82258652
Posts: 12
Joined: Fri Jun 12, 2015 6:23 pm

[Bug]JSIL.Builtins.Global[name] return null

Postby h82258652 » Fri Jun 12, 2015 9:22 pm

Code: Select all

var window=JSIL.Builtins.Global["window"];

after run this code, the window variable is null.

JS-Support @Userware
Site Admin
Posts: 1142
Joined: Tue Apr 08, 2014 3:42 pm

Re: [Bug]JSIL.Builtins.Global[name] return null

Postby JS-Support @Userware » Mon Jun 15, 2015 9:14 am

Thanks a lot for the bug report.

We are going to investigate this issue.

In the meantime, you can use the "JSIL.Verbatim.Expression" method to call JavaScript code from within your C# code, and thus access the "window" object. For example, the following C# code will change the current URL:

Code: Select all

JSIL.Verbatim.Expression("window.location.href = 'http://www.cshtml5.com'");


Thanks again,
Regards,
JS-Support


Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 29 guests

 

 

cron