I'm sure I already added the correct files, but I'll confirm at work tomorrow.
Thank You,
Michael Williams
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hello All,
I found an example to solve my issue, but the problem is that the Line below isn't working. Essentially the SPGetQueryString() isn't working in SharePoint 2016
var queryStringVals = $().SPServices.SPGetQueryString();
$(document).ready(function() {
//Gets the supplierID from the URL
var queryStringVals = $().SPServices.SPGetQueryString();
var supplierID = queryStringVals["FilterValue1"];
//replaces the onlick attribute of the add new item link with a NewForm.aspx and my query string variable
var incidentHrefandSupplierID = "http://sp2010/sites/MySite/Lists/MyList/NewForm.aspx?SupplierID=" + supplierID;
//console.log(incidentHrefandSupplierID);
$('#WebPartWPQ10 #idHomePageNewItem').attr('href', '#');
$('#WebPartWPQ10 #idHomePageNewItem').attr('onclick', function () {
return "javascript:showDialog('" + incidentHrefandSupplierID + "');"
//console.log(this.onclick); });
});
I'm sure I already added the correct files, but I'll confirm at work tomorrow.
Thank You,
Michael Williams
Thank you RaytheonXie-MSFT, I will try the solution later next week and get back with you.
Michael
Hi @Michael Williams ,
Please try to add jquery.min.js and jquery.SPServices-2014.02.min.js into a document library, then reference the files.
And add try...catch into your code.
try {
adddlert("Welcome guest!");
}
catch(err) {
document.getElementById("demo").innerHTML = err.message;
}
For sharepoint 2016, I will recommend REST API to achieve your requirement
https://social.technet.microsoft.com/wiki/contents/articles/31995.sharepoint-2013-working-with-rest-api-using-jquery-ajax.aspx
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.