지원되는 런타임 함수 및 객체
매쉬업에서 비보안 함수를 바꿀 때 함수 식을 검토하고 업데이트해야 합니다. 매쉬업 런타임 문제와 새 표준 함수의 예기치 않은 동작을 방지하려면 다음 표에 나열된 객체 및 함수에 대한 참조를 모두 제거해야 합니다.
더 이상 사용되지 않는 객체 및 함수
객체 또는 함수 이름
location
location.reload();
location.hostName !== ‘localhost’;
* 
이 객체는 TW.location으로 바뀝니다.
widget
widget.getProperty('DisplayName') === ‘ptcs-grid2’;
widget.mashup.rootWidget.getProperty('remoteAccessibleThing') == null; widget.mashup.rootWidget.getWidgets()[1].getProperty('SelectedText') == null;
history
history.back();
TW.Runtime.<any object>.(<any function>)
Output = TW.Runtime.Widgets.PTC_SCA_SCO_CustomFunctions.isSecure();
TW.Runtime.showHideDataFilterWidgets($(\body"), false);
Output = TW.Runtime.Widgets.PTC_SCA_SCO_CustomFunctions.getURLParameter(“mashup",url);
TW.Runtime.Widgets.AssetMonitor.refreshNeeded(isSelected,selectedTreeNode,selectedContext);
TW.Runtime.AssetMonitor.assetPropertyTitles(widget);
TW.Runtime.AssetMonitor.assetPropertyTitles(widget);
jqElement
widget.jqElement.triggerHandler('Changed');
screen
* 
이 객체는 ThingWorx 9.3.8 및 9.2.13 이상에서 TW.screen으로 대체됩니다.
screen.width
screen.height
screen.availHeight
screen.availWidth
self
const displayName = self['DisplayName'];
sessionStorage
sessionStorage.setItem('key', ‘value’);
* 
더 이상 사용되지 않는 함수 및 객체는 비보안 함수에서만 지원됩니다.
지원되는 객체 및 함수
다음 표에는 최신 표준 버전의 유효성 검사기 및 식 함수에서 지원되는 객체 및 함수가 나와 있습니다.
카테고리
객체 및 함수
위치
TW.location.hash
TW.location.host
TW.location.hostname
TW.location.href
TW.location.origin
TW.location.pathname
TW.location.port
TW.location.protocol
TW.location.search
TW.location.reload()
TW.location.reload();
TW.location.hostName !== ‘localhost’;
로컬리제이션
TW.Runtime.convertLocalizableString('[[token name]]')
Output = TW.Runtime.convertLocalizableString(“[[userName”]]);
로깅
TW.log.info()
TW.log.debug()
TW.log.warning()
TW.log.error()
TW.log.debug('Logging to mashup console');
런타임 루트 매쉬업
TW.Runtime.pageMashupName
TW.Runtime.actualMasterName
TW.Runtime.RootMashup.ConfigurationTables
TW.Runtime.RootMashup.CustomMashupCss
TW.Runtime.RootMashup.Data
TW.Runtime.RootMashup.DataBindings
TW.Runtime.RootMashup.Events
TW.Runtime.RootMashup.UI
TW.Runtime.RootMashup.mashupName
Output = TW.Runtime.RootMashup.mashupName;
Output = TW.Runtime.Workspace.Mashups.Current.UI.Widgets[0].Properties.Id;
Output = TW.Runtime.Workspace.Mashups.Current.Events[0].EventHandlerService;
Output = TW.Runtime.Workspace.Mashups.Current.Data.Session.UserExtension.Services[0].APIMethod;
Output = TW.Runtime.RootMashup.UI.Widgets[1].properties.SelectedText;
런타임 작업공간
TW.Runtime.Workspace.Mashups.CurrentMashupName
TW.Runtime.Workspace.Mashups.CurrentParameters
TW.Runtime.Workspace.Mashups.Current.ConfigurationTables
TW.Runtime.Workspace.Mashups.Current.CustomMashupCss
TW.Runtime.Workspace.Mashups.Current.Data
TW.Runtime.Workspace.Mashups.Current.DataBindings
TW.Runtime.Workspace.Mashups.Current.Events
TW.Runtime.Workspace.Mashups.Current.UI
TW.Runtime.Workspace.Mashups.Current.mashupName
Output = TW.Runtime.Workspace.Mashups.CurrentMashupName;
런타임 화면 높이 및 너비
TW.screen.width
TW.screen.height
TW.screen.availHeight
TW.screen.availWidth
Output = TW.screen.width
HTTP 요청
XMLHttpRequest
let xhr = new XMLHttpRequest(); xhr.open('GET', 'http://localhost:9000/Thingworx/Users/Administrator/Properties', true); xhr.onload = function () { console.log('the value is '+ xhr.responseText); }; xhr.send();
도움이 되셨나요?