我正在尝试创建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>
答案 0 :(得分:0)
如果存在timelines
属性,则src
元素必须为空。您所有的JavaScript代码都必须包含在不包含<script>
<script>
标记中
替换
src
使用
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.min.js">