I am trying to use some ajax in a chrome extension.
I have a script content that should add some html to an existing page.
I tried JQuery.get , JQuery.load and ng-include .
And they all show a warning in the console saying that synchronous XHR are out of date (aren't these asynchronous in nature ???). And then the page shows this strange behavior, tells me that some Pusher not defined, then it refreshes the page and kills my inserted div.
What could be wrong?
Sample code. If I include the first var txt , it works fine. If instead I include the second var txt (commented out), it fails.
//this first line works perfectly var txt = '<div id="myNewDiv" ng-controller="myController">{{testing}}</div>'; //this shows the warning and a really weird behavior //var txt = '<div id="myNewDiv" ng-controller="myController">{{testing}}<div ng-include="' + "'myhtml.html'" + '"></div></div>'; $('#a-certain-div-in-the-page').after(txt) var app = angular.module('myApp', []) .controller('myController', function($scope) { $scope.testing = 'Welcome!'; }); angular.bootstrap(document, ['myApp']);
source share