jquery

Jsonp request using jquery to fetch bing web results

using this as a guide: http://msdn.microsoft.com/en-us/library/dd250846.aspx can someone help me with the jquery call? Do I actually pass in the javascript code for the callback, or just the name of the function? BingSearch = function($bingUrl, $bingAppID, $keyword, $callBack) { $bingUrl = $bingUrl + "?JsonType=callback&JsonC...

How can I differentiate a manual scroll (via mousewheel/scrollbar) from a Javascript/jQuery scroll?

UPDATE: Here is a jsbin example demonstrating the problem. UPDATE 2: And here is the fixed version thanks to fudgey. Basically, I have the following javascript which scrolls the window to an anchor on the page: // get anchors with href's that start with "#" $("a[href^=#]").live("click", function(){ var target = $($(this).att...

Matching a value to JSON array values in jquery

I have a JSON array that looks like this: ['Monkey','Cheetah','Elephant','Lizard','Spider'] I also have a text input. I want to test whether the value of the input upon 'blur' is also in the array and if it is do something. Knowing a bit of python I tried something like this: var existing_animals = ['Monkey','Cheetah','Elephant','Li...

Convert PHP site to Ajax-driven site

After weeks of failure, I am completely lost as to how I can covert my site to be ajax based. The main purpose is that I have a bar at the bottom that plays music and I would like it to play as the pages change. Please help me figure this out! The Ajax area includes: Google AdSense and Adbrite ads (although I can go without these in A...

Trying to add a div to an append statement via a + and getting OBJECT OBJECT (jquery)

$('#columnList').append("<li>" + $(colInProcID) + "</li>"); Obviously, Im doing something wrong...not sure how to say the above so that I dont get [object object] in my list. **Sorry, let me clarify ... the $(colInProcID) is a DIV that I want inserted into the list. (sorry) ...

What are some overlay/expose jquery plugins?

I've used Jquery Tools and Fancybox. But these plugins dont work properly in my school's template when using older browser versions like firefox 3.0.1.6 I need to try different plugins with the hopes of them working. ...

jQuery show/hide for FAQ using the next() function

Maybe it's because it's Friday but I'm stuck on a simple problem. I'm building a FAQ page where a user clicks on a question, revealing the answer beneath it. I'm trying to get the next() function to just grab the next instance of an "answer" div but, despite not getting any JS errors, the hidden div isn't showing. Here's the code: .a...

jQuery ui datepicker positioning problem when scrolling down webpage

I have a webpage that uses multiple instances of the jQuery ui datepicker. My webpage will display ~80 records which extends beyond a single screenshot. <% foreach (var record in Model) { %> <div class="recordname"><%=record.name%></div> <%=Html.TextBox("DateTimePicker", null, new { @class = "date-pick" } )%> // <-- addition...

function returns after an XMLHttpRequest

Alright, I know questions like this have probably been asked dozens of times, but I can't seem to find a working solution for my project. Recently, while using jQuery for a lot of AJAX calls, I've found myself in a form of callback hell. Whether or not jQuery is too powerful for this project is beyond the scope of this question. So ba...

Use queried json data in a function

I have a code similar to this: $.ajax({ success: function(data) { text = ''; for (var i = 0; i< data.length; i++) { text = text + '<a href="#" id="Data_'+ i +'">' + data[i].Name + "</a><br />"; } $("#SomeId").html(text); for (var i = 0; i< d...

a div where you destroy elements

$(".drop").sortable({ connectWith: 'ul', cancel: ".ui-state-highlight" }); $(".draggable").draggable({ connectToSortable: '.drop', helper: 'clone', revert: 'invalid', editable: true }); $("#test").disableSelection(); i create (clone) elements by dragging then to the the list, so i want to create a div "REMOVE HERE" so when the user dr...

Question regarding checking the state of a checkbox class

I'll try and make this question simple. Can I assign a class to a series of different checkboxes, and use Jquery to do something when any one of those checkboxes is checked? Searching around on the internet I have found documentation on grabbing the name: $('input[name=foo]').is(':checked') but when I swap out the name attribute for the ...

Find element using jQuery

Hi, I've got some HTML that looks like this. <li class="t-item t-first"> <div class="t-top"> <span class="t-icon t-plus"></span> <span class="t-in">Offshore</span> </div> <input type="hidden" value="41393" name="itemValue" class="t-input"> </li> The HTML is a single item from a treeview created by Telerik. The real data ...

Is it possible to get multiple forms to work with one ajax post function

Hey guys I have a system where there is one form for each friend you have and I used to have an ajax post function for each form, but I want to save code and was wondering if it was possible to get multiple forms to work with just one post function. If anyone has any advice on how to achieve this I would appreciate it. For example <div ...

Remove some tags in jquery

I would like to use jquery to remove some tags inside mainclass, so that this - <div class='mainclass'> <div class='inclass'> <a href='#'>Some text</a> </div> </div> Becomes this - <div class='mainclass'> Some text </div> Thanks in advance. ...

How can I ensure that JavaScript inserted via AJAX will be executed after the accompanying HTML (also received via AJAX) is ready in the DOM?

I've got portions of pages being replaced with HTML retrieved via AJAX calls. Some of the HTML coming back has JavaScript that needs to be run once in order to initialize the accompanying HTML (setting up event handlers). Since the document has already been loaded, when I replace chunks of HTML using jQuery's .html function, having jQu...

jQuery AJAX PHP JSON problem

Hi Gurus I'm facing the problem of receiving an empty array when I do an AJAX request in the following way: This is the code I'm executing in JavaScript: <script type="text/javascript" src="lib/jquery.js"></script> <script type="text/javascript" src="lib/jquery.json.js"></script> <script type="text/javascript"> $(document)...

jquery with ASP.NET MVC - calling ajax enabled web service

This is a bit of a continuation of a previous question. Now I'm trying to make a call to an AJAX enabled web service which I have defined within the ASP.NET MVC application (i.e. the MovieService.svc). But the service is never being called in my getMovies javascript function. This same technique of calling the AJAX web service works o...

Adding Css class to all <input type'text'> elements? Javascript / Css?

I want to apply a CSS class to every textbox in my site: <div class="editor-label"> <label for="FoodType">FoodType</label> </div> <div class="editor-field"> <input id="HelpText" name="FoodType" type="text" value="" /> </div> <p> <input type="submit" value="Crea...

$.(ajax) wrapper for Jquery - passing parameters to delegates

I use $.(ajax) function extensively in my app to call ASP.net web services. I would like to write a wrapper in order to centralize all the ajax calls. I found few simple solutions, but none address an issue of passing parameters to delegates, for example, if i have: $.ajax({ type: "POST", url: "http://localhost/Templat...