将js和html文件上传到Sharepoint Site的样式库时出现问题 [英] Issue in uploading js and html files to style library of Sharepoint Site

查看:93
本文介绍了将js和html文件上传到Sharepoint Site的样式库时出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我们正在SP 2013内部共享点网站上进行角度1.x版本的开发。


it我们正在开发js和html文件,然后将它们上传到样式库并将它们链接到sharepoint页面和内容编辑器webpart。


今天我们在上传html时遇到了问题和shares网站样式库中的js文件。


在进一步调查中我们发现......


1。当我包含< div ng-app =" app"时,html文件无法上传NG-控制器= QUOT;&的TestController QUOT;>在主div中,这是第一个使用角度的要求。


2。在js文件中,它不允许多个下面的关键字。


console.log()

.toString()

.text()


.open()



请说明服务器或IT团队可能出现的问题应用任何特定规则来阻止文件,如果这些文字在文件中?



谢谢,


Deepak

解决方案

您好Deepak,


1。我在一个html中使用Angular 1.x,ng-app测试,然后使用下面的代码演示引用内容编辑器Web部件中的html文件,它按预期工作:

<!DOCTYPE html> 

< html lang =" en"的xmlns = QUOT; HTTP://www.w3.org/1999/xhtml">
< head>
< meta charset =" utf-8" />
< title> AngularTest< / title>
< script src =" https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js">< / script>
< / head>
< body>
< div ng-app =" myApp" NG-控制器= QUOT; myCtrl">
{{firstName +" " + lastName}}
< / div>

< script>
var app = angular.module(" myApp",[]);
app.controller(" myCtrl",function(


scope){


scope.firstName =" Jerry";

Hi,

We are doing development in angular 1.x version in the SP 2013 on premise sharepoint sites.

it was working fine till date we were developing js and html files and uploading them to style library and linking them in sharepoint pages with content editor webpart.

Today we are experiencing a problem in uploading the html and js files in style library of sharepoint site.

in further investigation we found that...

1. html file not uploading when I include <div ng-app="app" ng-controller="TestController"> in main div but this is first requirement to work with angular.

2. in js files its not allowing multiple below keywords.

console.log()
.toString()
.text()

.open()

Please suggest what might gone wrong with the server or if IT team applied any specific rule to block the files if these words are in the files?

Thanks,

Deepak

解决方案

Hi Deepak,

1. I tested with Angular 1.x, ng-app in a html and then reference the html file in Content Editor Web Part with the code demo below and it works as expected:

<!DOCTYPE html>

<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8" />
    <title>AngularTest</title>
    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script>
</head>
<body>
    <div ng-app="myApp" ng-controller="myCtrl">
        {{ firstName + " " + lastName }}
    </div>

    <script>
var app = angular.module("myApp", []);
app.controller("myCtrl", function (


scope) {


scope.firstName = "Jerry";


这篇关于将js和html文件上传到Sharepoint Site的样式库时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆