Sharepoint 2013 include javascript on homepage with CustomAction - sharepoint

I deploy a sandboxed solution to a Sharepoint 2013 site with an CustomAction setting to include my javascript file on every page like this:
<CustomAction ScriptSrc="MyScriptUrl.js" Location="ScriptLink" Sequence="10000">
This works fine on all pages the page is rendered like this and my script link is included:
...
<script type="text/javascript" src="/_layouts/15/1033/initstrings.js?rev=uNmvBiHdrBzcPQzXRpm%2FnQ%3D%3D"></script>
<script type="text/javascript" src="/_layouts/15/clienttemplates.js?rev=vtrc0n3sjgxKB4WQrCEeaA%3D%3D"></script>
<script type="text/javascript" src="/_layouts/MyApp/MyScriptUrl.js"></script>
...
But on the home page (start.aspx) my link is missing and the js includes are quite different:
...
<script type="text/javascript" src="/_layouts/15/init.js?rev=zwpf9CD1m7am6imImmQglQ%3D%3D"></script>
<script type="text/javascript" src="/ScriptResource.axd?d=nnhGXhlC0O1qfk6HXinkGyT_1TJisFpYK2ABJoGzI-IJfbkEQ8O-FNAr_1TgMft0D4TC2OewVZXiRooP_-SU74hHHu0AiGA4sSA3rrm1cvMqv3QRvFv8PafLyLDxWfN1O4qPFJXWfAf3avBHVS0HiXP55em_jNSsNMvRj1GJO4rjzyxg1vBi7IfXVHSWNBK60&t=6119e399"></script>
<script type="text/javascript" src="/_layouts/15/blank.js?rev=ZaOXZEobVwykPO9g8hq%2F8A%3D%3D"></script>
...
(Note: Of course there are more JS files but I just wanted to show that there are different includes)
What am I doing wrong?

Related

Additional resource/ js files added by Kentico?

I view sourced a site I built with Kentico (v9) and noticed there're many js files added (sample list below) that I've never used or added myself in any of my templates. Is there a place/file where I can manage this listing? One of the resource file returns a 404, and the jquery-core is redundant (because I used and linked to a different jquery file in the master template)
Edit: To clarify, I've created the site from scratch myself using Portal Engine, so I know which files are in use/needed, but the system was set up by a different team, so I'm not sure about those resources and how they got in there.
<script src="/WebResource.axd?d=tOC6-8tIvm-6k-UeWp5sUWPuNRu5mtP3WV2AZEfL9nI2sRmgKd5MnlDVvBjdzVe9wwB392nFnls5rAu3Ry5vq1yWL8h_-l2ltMTIVb8BU3E1&t=637346642097037378" type="text/javascript"></script>
<script src="/CMSPages/GetResource.ashx?scriptfile=%7e%2fCMSScripts%2fWebServiceCall.js" type="text/javascript"></script>
<script src="/CMSPages/GetResource.ashx?scriptfile=%7e%2fCMSScripts%2fRequireJS%2frequire.js" type="text/javascript"></script>
<script src="/CMSPages/GetResource.ashx?scriptfile=%7e%2fCMSScripts%2fRequireJS%2fconfig.js&resolvemacros=1" type="text/javascript"></script>
<script src="/CMSPages/GetResource.ashx?scriptfile=%7e%2fCMSScripts%2fcms.js" type="text/javascript"></script>
<script src="/CMSPages/GetResource.ashx?scriptfile=%7e%2fCMSScripts%2fjquery%2fjquery-core.js" type="text/javascript"></script>
Most of these are things added by various Controls (webparts), not much you can do about it, it's the nature of WebForms that in order for certain things to work it needs to pull in the javascript this way.

How to allow cross-origin access for Outlook Web Add-In

I developed a Outlook Web Add-in using Visual Studio 2017, and so far all my testing is based on hosting the Add-in from localhost, and I had no issues with that, everything worked fine. Now, I moved my Add-in to a shared folder on my Sharepoint server, so that others can test my Add-in.
Within my manifest file, I changed the line which defines the URL of my function file to point to where it is hosted:
<FunctionFile resid="FunctionFile.Url" />
I also added in a line under
<AppDomain>https://<My URL Domain></AppDomain>
The image of my add-in icon loads find, however when I click on my add-in icon from my OWA page, I get the following error:
SEC7120: [CORS] The origin 'https://' failed to allow a cross-origin document resource at 'ms-appx-web:///assets/errorpages/forbidframingedge.htm#https:///Functions/FunctionFile.html?et='.
Is there any way to allow my add-in to run? I'm currently doing my testing on the Edge Browser.
Thanks!
Update:
Here's my function file html code:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<title></title>
<script src="../Scripts/jquery-3.3.1.min.js" type="text/javascript">
</script>
<script src="../Scripts/Office/MicrosoftAjax.js" type="text/javascript">
</script>
<script src="../Scripts/Office/1/office.js" type="text/javascript">
</script>
<script src="FunctionFile.js" type="text/javascript"></script>
</head>
<body>
<!-- NOTE: The body is empty on purpose. Since this is invoked via a button, there is no UI to render. -->
</body>
</html>

bootstrap full year calendar setup

I'm trying to get this package http://www.bootstrap-year-calendar.com up and running. I've got nodeJS installed, have grabbed the package with npm and have setup an html page as per the usage instructions, but I cannot actually get the calendar to render. This is my first foray into nodejs, so I suspect I'm missing something straightforward. Any ideas on what the problem might be?
Thanks as always. My html/js currently looks like this:
<html>
<head></head>
<body>
<script src="./jquery/dist/jquery.js"></script>
<script src="./bootstrap/dist/js/bootstrap.js"></script>
<script src="./bootstrap-year-calendar/js/bootstrap-year-calendar.min.js"></script>
<script>
$('.calendar').calendar()
</script>
</body>
</html>

IE9 HTTPS security is compromised by http://v.zilionfast.in

I have a problem with https security in IE9 only... the message talk about an url that doesn't exist in my code "http://v.zilionfast.in/257344370/?t=vrt".
The issue was detected in different pc (in different networks) with IE9, some of them show the error message, others doesn't show anything.
I have no clue about what script is calling this url because i can't find it. Somebody have a clue about what is happening?
this is the code of the header basically:
<script type="text/javascript" src="#rutaIni#/swfobject.js"></script>
<script type="text/javascript" src="#rutaIni#/basicos.js"></script>
<script type="text/javascript" src="#rutaIni#/prototype-packed.js"></script>
<script type="text/javascript" src="#rutaIni#/scriptaculous.js"></script>
<script type="text/javascript" src="#rutaIni#/glider.js"></script>
<script src="#rutaIni#/modalbox.js" type="/text/javascript"></script>
<link href="#rutaIni#/modalbox.css" rel="stylesheet" type="text/css" media="screen" />
the other part of the code is just a table that is filled with a query and some html (no problem with that).
thank you!!!
It looks like this site is flagged by Vipre and other Internet Security and Antivirus programs to be malicious. It is possible that your web browser has been infected or your code contains elements associated with the site. The only way to know for sure is for you to post your code.

IIS: Configure document root per site?

I'm using ASP.NET Web Forms and have a Master page that references a view script resources:
<script type="text/javascript" src="/Resources/Scripts/jquery.placeholder.min.js"></script>
<script type="text/javascript" src="/Resources/Scripts/bootstrap.min.js"></script>
<script type="text/javascript" src="/Resources/Scripts/helper.js"></script>
The problem is that the document root "/" works totally fine the dev box but breaks the references on the IIS, because the site is not at the root level anymore.
What's the best way to fix this?
Also thought about something like this
<script type="text/javascript" src="<% Server.MapPath("~"); %>/Scripts/jquery-ui-1.9.0.min.js"></script>
or
<script type="text/javascript" runat="server" src="~/Scripts/jquery-ui-1.9.0.min.js"></script>
but both throw errors. I think this is a typical scenario and I would like to know how you guys do this?
user this
<script type="text/javascript" src='<%= ResolveUrl("~/Scripts/jquery-1.4.1.js")%>'></script>
Here is a post which may help your. ResolveUrl not working inline

Resources