New answers tagged jquery
3
I think the problem is src attribute of tag. Try <script src="/StyleLibrary/js/jquery-1.9.1.min.js" /> and take a look at this article
Edit If you decide to store js in _layouts folder, use <SharePoint:ScriptLink runat="server" ID="ScriptLinkJQuery" name="/Js/jquery-1.9.1.min.js" Localizable="false" />
0
It is not good practice for many reasons to modify out-of-the-box SharePoint files, the most obvious being that this type of customization is officially unsupported. For details please follow, for example this article.
In your scenario there are at least 2 ways how to provide additional client side functionality for Alert dialog:
Override NewItem2 ...
0
It may not be a pretty solution, but I did find a way to retrieve the list item ID. The first thing I had to do was pull an identifing column for that row. I was able to do this with the "Title" column, which is unique per user.
var taskDesc= $($(this).closest('tr').children(":first")).eq(0).text();
completeSelectedTask(taskDesc);
I then used CAML and ...
0
If I'm not wrong you can find this function into C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS{LCID} folder. There is the init.js and init.debug.js. Of course, you will have these files for each language that is installed to your environment.
But I do not recommend you to make changes in these files, because these ...
0
Here is a link to a same question.
Taken from the link:
In the handler:
var id = $(this).closest('tr')[0].id;
or
var id = $(this).closest('tr').attr('id');
or if by "id" you meant its index, do this:
var id = $(this).closest('tr')[0].rowIndex;
Also try:
var id = obj.parentElement.nextSibling.innerText;
0
Good way to remove handlers from dialog's close button is using $clearHandlers Method.
Check code below:
function fValidateBeforeClose(event) {
var isValid = true;
//set IsValid value
if(isValid)
{
//close dialog
SP.UI.ModalDialog.get_childDialog().close();
}
else
{
alert('Not valid');
}
}
function ...
0
I think you should remove old event handler
var js = oCloseButton.attr("onclick");
oCloseButton.attr("onclick", "");//remove sharepoint click handler...
3
If you are talking about the button on the top (X). The controls up there are part of the parent window iirc.
So try changing it to:
var closeButton = jQuery("a[id^='DlgClose']",parent.document);
1
To work with the SharePoint JS library you must have the SP.js at least:
<script type="text/javascript" src="/_layouts/SP.js"></script>
<script type="text/javascript" src="/_layouts/SP.UI.Dialog.js"></script>
<script type="text/javascript" src="/_layouts/SP.Core.js"></script>
3
The problem is likely because you are using jQuery 2.0 which does not have support for IE 6/7/8 or IE 9/10 when running in compatibility mode (which I'm guessing SP 2010 is using. You can confirm this by using the F12 developer tools).
I would recommend using jQuery 1.9.1 for use with SharePoint and so you still have support for the older browsers.
-1
If javascript works only in edit mode and after save javascript doesn't work, try add this row to oslo.master or seatle.master
SharePoint:ScriptLink ID="SPScriptLink" runat="server" LoadAfterUI="true" Localizable="false" Name="sp.js" /
This row has solved my similar problem.
0
The menu is different based on the permissions of the user. So a Site Owner will see Site Settings but a read only user will not. It could very well be permission related depending on what your script is trying to do. Could you post it so we can try to help?
1
You might want to check the selectors you are using in your jQuery as it is possible that the page being rendered when viewed as a visitor has a different enough structure to interfere with them.
0
Your syntax is a little wonky. I also added some jQuery inside your hidefields function instead of the native JS you were using.
Try this...
$(document).ready(function () {
$().SPServices({
operation: "GetGroupCollectionFromUser",
userLoginName: $().SPServices.SPGetCurrentUser(),
async: false,
completefunc: function ...
0
Use SharePoint Designer. In it, you can do all of the logic you describe. You have the ability to check the value of a column (whenever its value is changed/set by someone, for example), and depending on that value send an email to whomever you like. You can also dynamically send emails based on a Person column, so if you want to send an email to whoever ...
1
My problem solved -
Upon examining the DispForm.aspx page in SharePoint Designer, as I have mentioned before, the content of the Multiple Lines Rich Text type column is displayed using the XSLT code -
<xsl:value-of select="@Progress_x0020_Comments"/>
The solution is to include the attribute "disable-output-escaping" and set it to "yes"
So the ...
1
write javascript on page or place content editor webpart on page and linkup with your js
<script src="jquery file path" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function()
{
// do whatever operations with any element
$('#s4-workspace').hide();
$('#s4-workspace').show();
...
1
Sure you can, almost all of the elements from the masterpages has an id and / or multiple classes that can help you identify them with jQuery.
Use the Content Editor WebPart and add your scripts in the HTML window of the webpart.
To identify the ID:s for specific elements in the DOM I recommend you to just inspect the page with the developer tools in your ...
Top 50 recent answers are included

