I am trying to create two script editor web parts in SharePoint 2013. Both of them should retrieve items from distinct lists and display them on a page.
In the script editors I am using JavaScript as follows:
<script type="text/javascript" src="/SiteAssets/Ventas/js/jquery.min.js"></script>
<script type="text/javascript" src="_layouts/15/sp.runtime.js"></script>
<script type="text/javascript" src="_layouts/15/sp.js"></script>
<script type="text/javascript">
...
</script>
My trouble is, if there is only one web part, I see the items of a list. But if I have another script editor like the script above, I get JavaScript errors and no items are displayed. It seems that I cannot reference sp.runtime.js
and sp.js
twice.
What is the best practice to use sp.runtime.js
and sp.js
in web parts?