c# - How to load javascript files in Windows phone 8 application? -


In my Windows Phone 8 application, I am using WebBoard control in one page. When a user clicks on a button, I am navigating an .html file on a web browser. HTML is calling some CSS and JS files in the head section. CSS files are fully loading but JS files are not working.

& lt; Phone: Web browser x: name = "Games_WebBrowser" margin = "0,0,0,0" />

Behind the code:

  Private zero left behavior categories (Object Sender, System.Windows.Input.GestureEventArgs e) {Games_WebBrowser.Navigate (New Uri ("Index.html", Urikhind.relative)); }  

The main part of the .html file

  & lt; Head & gt; & Lt; Meta charset = "UTF-8" & gt; & Lt; Link href = "style / main.css" rel = "stylesheet" type = "text / css" & gt; & Lt; Script src = "js / bind_polyfill.js" & gt; & Lt; / Script & gt; & Lt; Script src = "js / classlist_polyfill.js" & gt; & Lt; / Script & gt; & Lt; Script src = "js / animframe_polyfill.js" & gt; & Lt; / Script & gt; & Lt; Script src = "js / keyboard_input_manager.js" & gt; & Lt; / Script & gt; & Lt; Script src = "js / html_actuator.js" & gt; & Lt; / Script & gt; & Lt; Script src = "js / grid.js" & gt; & Lt; / Script & gt; & Lt; Script src = "js / tile.js" & gt; & Lt; / Script & gt; & Lt; Script src = "js / local_storage_manager.js" & gt; & Lt; / Script & gt; & Lt; Script src = "js / game_manager.js" & gt; & Lt; / Script & gt; & Lt; Script src = "js / application.js" & gt; & Lt; / Script & gt; & Lt; / Head & gt; I'm not a Windows Phone developer, but I have many Windows 8 apps and I have They had problems with them, often it has problems with the same basic policy. It mainly helps me:  
  1. src & lt; Script src = "/ js / game_manager.js" & gt; & Lt; / Script & gt;
  2. Try adding a ms-appx: // one file: //
  3. Some function-calls have been marked as unsafe . For example innerHtml () . Try it if it can be an issue by adding warning ("test") to your first JS-file, if this output is shown, then there is no problem loading the file. Instead of having problems with code

If this does not help, try creating a Javascript project instead of the XAML project


Comments