Angularjs意外结束表达

时间:2017-07-06 04:51:38

标签: javascript php angularjs facebook

当我在fb,gg和tw中创建按钮共享时。但我不知道为什么angularjs在这里不起作用,这是我的代码

<a href="https://www.facebook.com/sharer/sharer.php?u=http://app.soosky.co{$item.link_play}?campaign_id={$item.campaign_id}%26v={$item.campaign_version}" onclick="javascript:window.open(this.href,'','menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600'); return false;" target="_blank" style="color: #fff">
  <button class="btn btn-facebook fb-share" id="fb-share">
    <i class="fa fa-facebook"></i>
    <span class="hidden-xs">Share in Facebook </span>
  </button>
</a>
  

意外结束:www.facebook.com/sharer/sharer.php?u = http:

请帮帮我。

1 个答案:

答案 0 :(得分:0)

试试这个,只需将此代码粘贴到您的html文件并运行即可。此编辑器阻止了错误in a new window because the request was made in a sandboxed frame whose 'allow-popups' permission is not set.

&#13;
&#13;
<!DOCTYPE html>
<html>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script>

	var myApp = angular.module('myApp', []);
	myApp.controller('languageCtrl', ['$scope', function ($scope) {
		
	}]);
</script>

<body ng-app="myApp" ng-controller="languageCtrl"> 
	<a href="https://www.facebook.com/sharer/sharer.php?u=http://app.soosky.co{$item.link_play}?campaign_id={$item.campaign_id}%26v={$item.campaign_version}" onclick="javascript:window.open(this.href,'','menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600'); return false;" target="_blank" style="color: #fff">
		<button class="btn btn-facebook fb-share" id="fb-share">
			<i class="fa fa-facebook"></i>
			<span class="hidden-xs">Share in Facebook </span>
		</button>
	</a>
</body>

</html>
&#13;
&#13;
&#13;