asked on
ASKER
<script type="text/javascript" src="/_catalogs/masterpage/js/jquery/jquery-1.4.2.min.js"></script>
$(function() {
$("input[id$='usernameTxtBx']").autocomplete({
source: function (request, response){
$.ajax({
type: 'POST',
contentType: 'application/json; charset=utf-8',
url: '~/_layouts/UsernameAutoComplete.asmx/GetUsernames',
data: "{ 'partialUsername': '" + request.term + "', 'maxResults': '10' }",
dataFilter: function(data){return data;},
success: function(data) {
response($.map(data.d, function (item){
return{
label: item,
value: item
}
}))
}
});
},
minLength: 1
});
});
I know I can just take the line to import the jquery library out of my webpart, but if the web part were to get loaded on a page that did not import the library, then the webpart would also fail. What would be an appropriate way to handle this?
The successor to Active Server Pages, ASP.NET websites utilize the .NET framework to produce dynamic, data and content-driven web applications and services. ASP.NET code can be written using any .NET supported language. As of 2009, ASP.NET can also apply the Model-View-Controller (MVC) pattern to web applications
TRUSTED BY
do you have any java script in your master pages.
try it in your own machine.
clear your cache and try again and see if you can reproduce the problem