Note that there are some explanatory texts on larger screens.

plurals
  1. POI'm getting a blank screen when I try to load java script into a web view
    primarykey
    data
    text
    <p>Here's my code:</p> <pre><code>- (void)viewDidLoad { [super viewDidLoad]; NSString *path = [[NSBundle mainBundle] pathForResource:@"index" ofType:@"html"]; NSError *error; NSURL *baseURL = [NSURL fileURLWithPath:path]; NSString *html = [NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:&amp;error]; NSLog(@"%@", html); [webview loadHTMLString:html baseURL:baseURL]; NSLog(@"error: %@", error); } </code></pre> <p>Here's the contents of the html:</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;script src="jquerymin.js"&gt;&lt;/script&gt; &lt;script src="highcharts.js"&gt;&lt;/script&gt; &lt;script src="exporting.js"&gt;&lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="container" style="min-width: 400px; height: 400px; margin: 0 auto"&gt;&lt;/div&gt; &lt;script src="script.js"&gt;&lt;/script&gt; Test &lt;input type="button" id="button" /&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Script.js:</p> <pre><code>$(function () { var chart; $(document).ready(function() { chart = new Highcharts.Chart({ chart: { renderTo: 'container', plotBackgroundColor: null, plotBorderWidth: null, plotShadow: false }, title: { text: 'Therapist productivity by Region' }, tooltip: { formatter: function() { return '&lt;b&gt;'+ this.point.name +'&lt;/b&gt;: '+ this.percentage +' %'; } }, plotOptions: { pie: { allowPointSelect: true, cursor: 'pointer', dataLabels: { enabled: true, color: '#000000', connectorColor: '#000000', formatter: function() { return '&lt;b&gt;'+ this.point.name +'&lt;/b&gt;: '+ this.percentage +' %'; } } } }, series: [{ type: 'pie', name: 'Therapist Productivity', data: [ ['South Carolina', 45.0], ['Michigan', 26.8], { name: 'California', y: 12.8, sliced: true, selected: true }, ['Florida', 8.5], ['New York', 6.2], ['Maine', 0.7] ] }] }); }); }); $('#button').click(function() { $(chart.container).hide(); chart.series[0].remove(); $(chart.container).show(); }); </code></pre> <p>When I run my code, the button from the HTML and "Test" show up on the screen, but not the contents of the .js files being loaded. Am I doing this right?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload