<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://www.dotnetmafia.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Corey Roth [MVP] : jQuery</title><link>http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/jQuery/default.aspx</link><description>Tags: jQuery</description><dc:language>en</dc:language><generator>CommunityServer 2007.1 (Build: 20917.1142)</generator><item><title>A tip to remember when calling custom web services in SharePoint from JavaScript (or jQuery)</title><link>http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2010/08/03/a-tip-to-remember-when-calling-custom-web-services-in-sharepoint-from-javascript-or-jquery.aspx</link><pubDate>Tue, 03 Aug 2010 18:31:12 GMT</pubDate><guid isPermaLink="false">ceb7fe2a-c56b-4d85-99e6-8dd548580538:3876</guid><dc:creator>CoreyRoth</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.dotnetmafia.com/blogs/dotnettipoftheday/rsscomments.aspx?PostID=3876</wfw:commentRss><comments>http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2010/08/03/a-tip-to-remember-when-calling-custom-web-services-in-sharepoint-from-javascript-or-jquery.aspx#comments</comments><description>&lt;p&gt;I’ve been customizing rendering templates a lot lately using a wide variety of scripting technologies such as JavaScript, jQuery, and &lt;a href="http://spservices.codeplex.com/"&gt;SPServices&lt;/a&gt;.&amp;#160; One requirement I had with all of these rendering templates was to call a custom web service to populate a drop down list.&amp;#160; This is relatively easy to do and there are plenty of resources out there on how to deploy web services with SharePoint.&amp;#160; I thought I would make a point today though to talk about this issue since I seem to forget about it every time. :-)&amp;#160; The issue is that you build and test your pages and they work great as an administrator. However, once an end user tries the page, the script on the page doesn’t work.&amp;#160; With any scripting issue, I bust out &lt;a href="http://getfirebug.com/"&gt;FireBug&lt;/a&gt; in Firefox and take a look at the page.&amp;#160; It shows the web service call which works great for the administrator but when the user tries it, the result is 403 forbidden.&lt;/p&gt;  &lt;p&gt;Obviously, I need to grant permissions, but where?&amp;#160; Since the end user is on the SharePoint site, the identity that the JavaScript is calling with is that of the user.&amp;#160; This of course assumes, you are using NTLM or Kerberos and not doing forms authentication.&amp;#160; The place we have to grant permissions may not make sense to you at all, but the general consensus is that you grant &lt;em&gt;Read&lt;/em&gt; permission to the &lt;em&gt;Authenticated Users&lt;/em&gt; group on the bin folder of your web application.&amp;#160; This is the case at least when you are deploying your code to the bin folder (and using &lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2007/08/28/more-on-code-access-security.aspx"&gt;Code Access Security&lt;/a&gt;).&amp;#160; I don’t believe that web services with binaries deployed to the GAC should have this issue but I could be wrong.&amp;#160; Here is what the permissions look like on your bin folder.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/BinFolderSecurityAuthenticatedUsers_5E843C13.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;" title="BinFolderSecurityAuthenticatedUsers" border="0" alt="BinFolderSecurityAuthenticatedUsers" src="http://www.dotnetmafia.com/blogs/dotnettipoftheday/BinFolderSecurityAuthenticatedUsers_thumb_157E1A4D.png" width="319" height="412" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Any how, I hope this helps should you run into this issue.&amp;#160; I don’t foresee any potential security issues by granting this group access to the bin folder, but if you think there are any associated risks, I would like to hear about them.&lt;/p&gt;&lt;img src="http://www.dotnetmafia.com/aggbug.aspx?PostID=3876" width="1" height="1"&gt;</description><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/SharePoint/default.aspx">SharePoint</category><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/jQuery/default.aspx">jQuery</category></item><item><title>Quick reminder to use noConflict() with jQuery in SharePoint</title><link>http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2009/08/03/quick-reminder-to-use-noconflict-with-jquery-in-sharepoint.aspx</link><pubDate>Mon, 03 Aug 2009 14:36:59 GMT</pubDate><guid isPermaLink="false">ceb7fe2a-c56b-4d85-99e6-8dd548580538:942</guid><dc:creator>CoreyRoth</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.dotnetmafia.com/blogs/dotnettipoftheday/rsscomments.aspx?PostID=942</wfw:commentRss><comments>http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2009/08/03/quick-reminder-to-use-noconflict-with-jquery-in-sharepoint.aspx#comments</comments><description>&lt;p&gt;I’ve seen quite a few posts on jQuery and SharePoint lately. I haven’t seen too many people point this out (maybe I didn’t search well enough :) ), so I thought I would take a quick minute to remind you to use jQuery’s noConflict() method in SharePoint.&amp;#160; It appears somewhere in all of the magic JavaScript that powers SharePoint it too also makes use of the $ shortcut.&amp;#160; If you don’t simply having a reference to the jQuery script on a page can cause all number of things to break.&amp;#160; I have seen it break my own JavaScript as well as cause certain things not to display such as the Edit Web Part pane.&amp;#160; The next time you want to use jQuery with SharePoint, just add the following code and you should be good to go.&lt;/p&gt;  &lt;div style="font-family:consolas;background:black;color:white;font-size:13pt;font-weight:bold;"&gt;   &lt;p style="margin:0px;"&gt;&amp;lt;&lt;span style="color:#cc7832;"&gt;script&lt;/span&gt; &lt;span style="color:silver;"&gt;src&lt;/span&gt;=&amp;quot;&lt;span style="color:#a5c25c;"&gt;http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js&lt;/span&gt;&amp;quot; &lt;span style="color:silver;"&gt;type&lt;/span&gt;=&amp;quot;&lt;span style="color:#a5c25c;"&gt;text/javascript&lt;/span&gt;&amp;quot;&amp;gt;&amp;lt;/&lt;span style="color:#cc7832;"&gt;script&lt;/span&gt;&amp;gt;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;lt;&lt;span style="color:#cc7832;"&gt;script&lt;/span&gt; &lt;span style="color:silver;"&gt;type&lt;/span&gt;=&amp;quot;&lt;span style="color:#a5c25c;"&gt;text/javascript&lt;/span&gt;&amp;quot;&amp;gt;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160; jQuery.noConflict();&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;lt;/&lt;span style="color:#cc7832;"&gt;script&lt;/span&gt;&amp;gt;&lt;/p&gt; &lt;/div&gt;   &lt;p&gt;Instead of using the $ to use jQuery methods you will have to use jQuery instead.&amp;#160; For example: $.get() would become jQuery.get().&lt;/p&gt;&lt;img src="http://www.dotnetmafia.com/aggbug.aspx?PostID=942" width="1" height="1"&gt;</description><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/SharePoint/default.aspx">SharePoint</category><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/jQuery/default.aspx">jQuery</category></item></channel></rss>