前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >SAP UI5应用里使用jQuery.ajax异步读取xml文档并显示在SAP UI5应用界面上

SAP UI5应用里使用jQuery.ajax异步读取xml文档并显示在SAP UI5应用界面上

作者头像
Jerry Wang
发布2021-02-20 14:49:48
3820
发布2021-02-20 14:49:48
举报
代码语言:javascript
复制
<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta charset="utf-8">
	<title>SAPUI5 Sandbox</title>
	<script
		id="sap-ui-bootstrap"
		src="https://openui5.hana.ondemand.com/resources/sap-ui-core.js"
		data-sap-ui-theme="sap_belize"
		data-sap-ui-libs="sap.m,sap.ui.layout"
		data-sap-ui-compatVersion="edge"
		data-sap-ui-preload="async">
	</script>
	<script>
		sap.ui.getCore().attachInit(function () {
			var oInput = new sap.m.Input({
				liveChange : function(oEvent) {
					console.log('live change event: ' + oEvent.getParameter('newValue'));
				}
		});
		var oVerticalLayout = new sap.ui.layout.VerticalLayout();
		oVerticalLayout.addContent(oInput);

		var oHorizontalLayout = new sap.ui.layout.HorizontalLayout();
		
		var oLabel = new sap.m.Label({
			text: 'Response:s',
			labelFor: 'result',
			design: 'Bold'
		});
		var oResult = new sap.m.Text('result');
		oHorizontalLayout.addContent(oLabel);
		oHorizontalLayout.addContent(oResult);
		//oText.setText('response');

		oVerticalLayout.addContent(oHorizontalLayout);
		oVerticalLayout.placeAt("content");

		var html = jQuery.ajax({
			url:"s5.xml",
			dataType: 'text',
			async:true, 
			success:
			(oResponse) => { 
				oResult.setText(oResponse);
			}
		});
	});
	</script>
</head>
<body class="sapUiBody" role="application">
	<div id="content"></div>
</body>
</html>

效果:

在这里插入图片描述
在这里插入图片描述
本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2019-06-30 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档