Share via

how to ake sure javascript is enabled before loading the website or page?

Shahzaib khan 6 Reputation points
2020-09-02T14:56:59.397+00:00

is there any way i can disable the site to load on client pc if client has disabled javascript? my website relies too much on javascript for validations and i don't have time for now to implement server side validation which i know i should but i can't for now so i need to make sure if client has javascript disabled then don't display my site to him

Developer technologies | Universal Windows Platform (UWP)
0 comments No comments

1 answer

Sort by: Most helpful
  1. Nico Zhu (Shanghai Wicresoft Co,.Ltd.) 12,871 Reputation points
    2020-09-03T02:20:37.777+00:00

    hello, Welcome to Microsoft Q&A,

    If you used UWP WebView control to load your website, you could make webview control disable when load the specific uri. Listen webview NavigationStarting event and get current uri, and add constraint that load a blank page.

    private async void TestWebView_NavigationStarting(WebView sender, WebViewNavigationStartingEventArgs args)
    {
     if (args.Uri !== your uri)
        {
    
        // do some stuff.
    
        }
    
    }
    

    Was this answer helpful?

    1 person found this answer helpful.

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.