jquery

How to return the result from JSONP call outside the function?

I have the following function which works great, i used JSONP to overcome cross-domain, wrote an http module to alter the content-type and didn't append a callback name in the url. function AddSecurityCode(securityCode, token) { var res=0; $.ajax({ url: "http://localhost:4000/External.asmx/AddSecurityCode", data: { securityCode: JSO...

How to add a row below the currently selected row (based on a dropdown input) using jQuery?

I have a table with a bunch of rows. In the last column of every row, there is a dropdown. When the dropdown changes, I need a new table row to appear below the row where the user selected the dropdown item. However, I also need the new row to have different data depending on what was selected in the dropdown. Is any of this possib...

How to do long-polling AJAX requests in ASP.NET MVC?

Does anyone know how to code up long-polling AJAX requests (for server PUSH notifications) in ASP.NET MVC? Whenever I do it, it seems that only the last browser to open up a window gets the notifications. As if IIS/ASP.NET were canceling the last request because it was hung or something. ...

get or post data in jquery (show url on browser line)

hey there :-) Okay, i have a job to do before tomorrow morning.. i'm working on some jquery. Where i load some external file data.. What i really want to know, is how am i going to load some data when i $.post / or $.get some data through jquery Send request into jquery <a href="javascript:;" onclick="$.view.load('prices');">hey ...

Relative links inside jquery tabs

see http://stackoverflow.com/questions/1331674/fix-broken-links-with-jquery I think this is just a chaining/find issue but if I have: tab1 - loads /rootdir/dir1/page1.htm with link "page1b.htm" tab2 - loads /rootdir/dir2/page2.htm with link "page2b.htm" and the page with the tabs on it is /rootdir/tabpage.htm" So since jquery loads al...

jquery masking/alerting problem in IE

I've got a table an input box that has a money input mask on it. I haven't had any problems with it yet, but now it doesn't seem to be working properly and I can't get anything to alert from it. All of this is an internet explorer problem. Works fine in FireFox. In firefox the mask works right as it only allows numbers and at a fixed...

What is the best way of "overriding" the .toggle() function of jquery?

I want to change the toggle function so that it changes the text of the link to say "show/hide" or "expand/collapse". The function definition and call in classic JS would be: function myToggle(expandText, collapseText, id,o){ // expandText: "expand", "show", "display" // collapseText: "collapse", "hide" // id: the id of the di...

Shadowbox loads old href and not new href

I have a code that replaces href's using Jquery, .attr({ href : newpath }); and I am using Shadowbox. After changing the href and loading shadowbox, the shadowbox loads the old href instead of the new one. For example : <a id ="shadowboxlink" href="images/firstimage.jpg" rel="shadowbox">shadowbox link</a> then the jquery would be som...

How to use JQuery AJAX with ASP.net 2.0 ?

I want to use JQuery Ajax with ASP.net 2.0, VS2005. Please help me out.???? ...

Make .cfm template accessible only via ajax call?

I have a template set up that I'm making ajax calls to via jQuery. I'm passing a URL parameter called "method" and then doing a <cfswitch> through each method to determine what block of code to execute. Problem is, I don't want this page to be accessible outside of the ajax call. In other words, I don't want the template to run if someo...

To disable a send button if fields empty by jQuery

How can you disable the send -button if there is one or more input -fields empty? My attempt in pseudo-code if ( $("input:empty") ) { $("input:disabled") } else // enable the ask_question -button I have been reading these articles without finding a right solution Official docs about empty: this is like not relevant because ...

Create an array for simpleGallery (jquery plugin)

I am using the jquery plugin simplegallery (http://www.dynamicdrive.com/dynamicindex4/simplegallery.htm). out of the box it works like their documentation says. However I want to use it in a way that gets a dynamic list of random images from the server via an ajax call so that the list is different each time the page is loaded. On the se...

Capturing distinct keypresses

Hi! When you hold down a key, the JQuery events start to pop out like crazy for this single key press: ... keydown keypress keyup keydown keypress keyup ... Is there any (even non-browser-portable) way to capture only one event for each key pressed (example: press A and hold it down, and this should yield only one function call)? Ch...

change active li when clicking a link jquery

hey I want to make a menu, and change the class when clicking. When i click on the "li" with no class="active", i want jquery to add a class on the empty <li> and remove it from the othes "li". <li class="active"><a href="javascript:;" onclick="$.data.load(1);">data</a></li> <li><a href="javascript:;" onclick="$.data.load(2);">data...

Checking Checkboxes scattered on the same page

I have 10 checkboxes that are scattered throughout a page and if any one of them is checked, then a div needs to have it's display set to block. However if they are all unchecked then the div is set back to display:none. They are in different parts of the page and I am having problems figuring out how to detect the check. Thanks, -Seth...

javascript and ajax load, then effects

Hi, I have a javascript code, whereby I'm trying to load a list from a separate page (using jQuery's load() function), slide the current list out and slide the new list in. Now, I don't want the old list to slide until after the new list has been completely loaded. Can anyone tell me how to achieve this without looking like the script i...

Nytimes-style popup when the user makes a selection

When you select text in an article on nytimes.com this little ? pops up at the end your selection: What's the best way to implement something like this on my site? Are there any pre-rolled libraries for doing this? ...

Input field filter solution for jQuery

Anyone know a good solution for filtering input using jQuery? I'd like to do something like this: $("#fieldname").InputFilter("###-###-####") I would also like the visual interface to enforce and display placeholders for ###-###-####, #####, etc. Regards. ...

jCarousel External Event Control

I have been trying to work with a jCarousel external control, but in a way I am finding no examples for. I have 2 objects on my page, a Cycle control called BackgroundContainer and a jCarousel control called mycarousel. What I would like is when the Cycle control fires a change then to have the AFTER event of the Cycle control change t...

jQuery simple pager rebinding

Hi everyone - I basically have a rebinding issue but none of the solutions I've found has specified how to remove a binding entirely (and for a plugin-based function, not like unbind("click")). For the SimplePager plugin, basically it adds a cool pager element at the bottom of the page, but I lose the AJAX binding after I perform a sep...