代码没有进入脚本部分
code did not enter script part
我正在尝试创建 Salesforce VF 页面。它没有进入脚本部分,控制台中没有打印任何控制台消息。
请帮忙..我尝试更改脚本标签的位置但没有任何效果。
我尝试了很多调试,但找不到任何原因。我已经删除了大部分脚本,因为它不允许以其他方式保存。
<apex:page sidebar="false" showHeader="false" controller="quote_details_controller">
<head>
<title>Quote Details</title>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.min.js">
console.log('Hi');
var app = angular.module("QuoteDetals",[]);
app.factory("Quote_Details_Ctrl",quoteDetailsFactory);
app.controller("Quote_Details_Ctrl",Quote_Details_Ctrl);
function quoteDetailsFactory($q){
var deferred = $q.defer();
var loadData = function(quoteId){
quote_details_controller.getQuote(quoteId,
function(result,event){
if(event.status){
deferred.resolve(angular.fromJson(result));
} else {
deferred.reject(event);
}
},
{escape:false}
);
return deferred.promise;
}
return{
loadData : loadData
};
}
function Quote_Details_Ctrl($scope,Quote_Details_Ctrl){
$scope.quoteData = [];
$scope.quoteId = "{!$CurrentPage.parameters.quoteId}";
console.log('quoteId : ' +quoteId);
$scope.loadData = function(){
var promise = quoteDetailsFactory.loadData($scope.quoteId);
promise.then(function(obj){
$scope.quoteData = obj;
},[]);
console.log('quoteData : '+quoteData);
}
}
window.onload = $scope.loadData();
</script>
<style>
div.quote-detail-section-right{
float:right;
margin-top : 145px;
margin-right: 80px;
width:35%;
}
</style>
</head>
<body>
<div class="quote-rec-page">
<div class = "quote-details">
<label for = "section" class="Segment">Quote Details</label>
</div>
<div class ="btn-toolbar">
<button type="button">Edit</button>
<button type="button">Delete</button>
<button type="button">Create PDF</button>
<button type="button">Email Quote</button>
<button type="button">Start Sync</button>
</div>
<form>
<div class ="quote-detail-section-left">
<div>
<label for="quoteNum" class ="field-label">Quote Number</label>
<input type="text" class="quote-input" tabindex="1" id="quoteNumber"/>
</div>
<div>
<label for="quoteName" class ="field-label">Quote Name</label>
<input type="text" class="quote-input" tabindex="2" id="quoteName"/>
</div>
<div>
<label for="oppName" class ="field-label">Opportunity Name</label>
<input type="text" class="quote-input" tabindex="3" id="oppName"/>
</div>
<div>
<label for="accName" class ="field-label">Account Name</label>
<input type="text" class="quote-input" tabindex="4" id="accName"/>
</div>
</div>
<div class ="quote-detail-section-right">
<div>
<label for="expDate" class ="field-label">Expiration Date</label>
<input type="date" class="quote-input" tabindex="5" id="expDate"/>
</div>
<div>
<label for="sync" class ="field-label">Syncing</label>
<input type="checkbox" class="quote-input" tabindex="6" id="sync"/>
</div>
<div>
<label for="status" class ="field-label">Status</label>
<input type="text" class="quote-input" tabindex="7" id="status"/>
</div>
<div>
<label for="quoteDesc" class ="field-label">Description</label>
<input type="text" class="quote-input" tabindex="8" id="quoteDesc"/>
</div>
</div>
</form>
</div>
</body>
</apex:page>
如果存在 src
属性,则 <script>
元素必须为空。您的所有 javascript 代码必须包含在不包含 src
的 <script>
标签中
替换
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.min.js">
与
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.min.js"></script>
<script>
我正在尝试创建 Salesforce VF 页面。它没有进入脚本部分,控制台中没有打印任何控制台消息。
请帮忙..我尝试更改脚本标签的位置但没有任何效果。
我尝试了很多调试,但找不到任何原因。我已经删除了大部分脚本,因为它不允许以其他方式保存。
<apex:page sidebar="false" showHeader="false" controller="quote_details_controller">
<head>
<title>Quote Details</title>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.min.js">
console.log('Hi');
var app = angular.module("QuoteDetals",[]);
app.factory("Quote_Details_Ctrl",quoteDetailsFactory);
app.controller("Quote_Details_Ctrl",Quote_Details_Ctrl);
function quoteDetailsFactory($q){
var deferred = $q.defer();
var loadData = function(quoteId){
quote_details_controller.getQuote(quoteId,
function(result,event){
if(event.status){
deferred.resolve(angular.fromJson(result));
} else {
deferred.reject(event);
}
},
{escape:false}
);
return deferred.promise;
}
return{
loadData : loadData
};
}
function Quote_Details_Ctrl($scope,Quote_Details_Ctrl){
$scope.quoteData = [];
$scope.quoteId = "{!$CurrentPage.parameters.quoteId}";
console.log('quoteId : ' +quoteId);
$scope.loadData = function(){
var promise = quoteDetailsFactory.loadData($scope.quoteId);
promise.then(function(obj){
$scope.quoteData = obj;
},[]);
console.log('quoteData : '+quoteData);
}
}
window.onload = $scope.loadData();
</script>
<style>
div.quote-detail-section-right{
float:right;
margin-top : 145px;
margin-right: 80px;
width:35%;
}
</style>
</head>
<body>
<div class="quote-rec-page">
<div class = "quote-details">
<label for = "section" class="Segment">Quote Details</label>
</div>
<div class ="btn-toolbar">
<button type="button">Edit</button>
<button type="button">Delete</button>
<button type="button">Create PDF</button>
<button type="button">Email Quote</button>
<button type="button">Start Sync</button>
</div>
<form>
<div class ="quote-detail-section-left">
<div>
<label for="quoteNum" class ="field-label">Quote Number</label>
<input type="text" class="quote-input" tabindex="1" id="quoteNumber"/>
</div>
<div>
<label for="quoteName" class ="field-label">Quote Name</label>
<input type="text" class="quote-input" tabindex="2" id="quoteName"/>
</div>
<div>
<label for="oppName" class ="field-label">Opportunity Name</label>
<input type="text" class="quote-input" tabindex="3" id="oppName"/>
</div>
<div>
<label for="accName" class ="field-label">Account Name</label>
<input type="text" class="quote-input" tabindex="4" id="accName"/>
</div>
</div>
<div class ="quote-detail-section-right">
<div>
<label for="expDate" class ="field-label">Expiration Date</label>
<input type="date" class="quote-input" tabindex="5" id="expDate"/>
</div>
<div>
<label for="sync" class ="field-label">Syncing</label>
<input type="checkbox" class="quote-input" tabindex="6" id="sync"/>
</div>
<div>
<label for="status" class ="field-label">Status</label>
<input type="text" class="quote-input" tabindex="7" id="status"/>
</div>
<div>
<label for="quoteDesc" class ="field-label">Description</label>
<input type="text" class="quote-input" tabindex="8" id="quoteDesc"/>
</div>
</div>
</form>
</div>
</body>
</apex:page>
如果存在 src
属性,则 <script>
元素必须为空。您的所有 javascript 代码必须包含在不包含 src
<script>
标签中
替换
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.min.js">
与
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.min.js"></script>
<script>