简体   繁体   English

如何在SharePoint网址中传递多个参数?

[英]How to passing more than one parameter in SharePoint url?

This two part question 1) I used http://www.sharepointhillbilly.com/Lists/Posts/Post.aspx?ID=26 to Creating a Parent/Child List Relationship in SharePoint 2013 and pass the ID of the Parent to child and auto populate the child ID. 这两个部分的问题1)我使用http://www.sharepointhillbilly.com/Lists/Posts/Post.aspx?ID=26在SharePoint 2013中创建父/子列表关系,并将父ID传递给子自动填充子ID。 What I am looking is how can I pass more column value in addition to ID to the child to the url $(anchorElement).attr("href","javascript:NewItem2(event,'http:///Lists/Time/NewForm.aspx?IssueID=" + issueID + "');"); 我正在寻找的是如何将ID以外的更多列值传递给子代url $(anchorElement).attr(“ href”,“ javascript:NewItem2(event,'http:/// Lists / Time / NewForm.aspx?IssueID =“ + issueID +”');“);

2) check this part of the code //find the element with the "Add new item" link. 2)检查代码的这一部分,//使用“添加新项”链接查找元素。 //note that if you have more than one list on your page, this just finds the first one var anchorElement = $("a[title='Add a new item to this list or library.']"); ///请注意,如果页面上有多个列表,则只会找到第一个var anchorElement = $(“ a [title ='将新项目添加到此列表或库。']”);

how can find the second or third 'Add a new item to this list or library' if I have more than one on a page using jquery or javascript? 如果我使用jquery或javascript在页面上有多个,如何找到第二个或第三个“向此列表或库添加新项目”?

I am not sure If I understood all, but in URL You can always add other more parameters separating them with '&' symbol. 我不确定是否了解所有内容,但是可以在URL中始终添加其他更多参数,并用'&'符号将其分隔。 Like: 喜欢:

http://somehost/somepage.aspx?id=2&name=aaa&othercolumn=bbb

for the second You may try to for over each element like this (to get n-element with some jQuery selector You should use the .eq(n) method): 对于第二个,您可以尝试遍历这样的每个元素(要使用某些jQuery选择器获取n元素,应使用.eq(n)方法):

for(var i = 0; i < $("a[title='Add a new item to this list or library.']").length; i++)
{
    console.log($("a[title='Add a new item to this list or library.']").eq(i).html());
}

I hope this will help :) 我希望这个能帮上忙 :)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM