jquery

Using jQuery set parent element css based on condition of multiple children element

<tr> <td class="cat" CategoryId="8">NoChange*: </td> <td><span class="itm" CategoryId="8">A</span></td> </tr> <tr> <td class="cat" CategoryId="9">Row should be red*: </td> <td></td> </tr> <tr> <td class="cat">Comments:</td> <td><span class="itm"></span></td> </tr>​ I want to set Validation for Category which d...

Jquery: How to see if string contains substring

I have a shoppingcart that displays product options in a dropdown menu, and I want to make some other fields on the page only visible if they select "Yes" in the previous option. The problem is that the shopping cart also includes the price modifier in the text, and that can be different for each product. So if I do this it works: $(...

Event handler for when a user has added an image.

I have a form that lets users upload a image of them self. I need an jQuery event handler for when the input in uploaded. As always muchas gracias to any help. <script> $('#imageFile').someeventhander(function(){do some work son!}); </script> <input id="imageFile" type="file"> ...

Removing jQuery ajax-added js-files from document again?

Hi My site operates on an ajax "framework". Whenever a user opens a new page, that page loads in the necessary css and js files to view the page properly and adds them to the current document. The js files are loaded like this in jQuery: function getJS(jsfiles) { $.each(jsfiles, function(i, val) { $.getScript(val); }); ...

Problem lanching fancybox from within a fancybox on IE

I'm working with fancybox and I have the code below: <script type="text/javascript"> $("a#next_fancybox").fancybox(); </script> <script type="text/javascript"> $("#submit").click(function(){ $.ajax({ type: "POST", url: "/sumbit_url", data: $("#form").serialize(), success: function(msg){ $("a...

Ajax request delimiters for data to be sent

Hi All, I have such an issue var url = "index.php?id=123&sid=321"; $.ajax({ type: "POST", url: "some.php", data: "name=John&url="+url, success: function(msg){ alert( "Data Saved: " + msg ); } Now here we have url which contains an & , but & is used to delimit data variables to be sent to server and so since we have...

jQuery - How to get JSON string rather than HTML result after the form is submitted

Hello all, I am using XAMPP + WINDOWS to develop my prototype. I have designed a form that uses jQuery Form Plugin to do the form submission. When the form doesn't include FILE field, the return value looks like: {"success":false,"msg":"incorrect-captcha-sol"} which is jason string. However, after I add a FILE into the form, I alwa...

Display image on top of another image on rollover

I want to display a zoom image (on mouseover) on top of certain images to imply 'click here to zoom'. I don't want to use a cursor. I'm sure there's a good way to do this with javascript jQuery but I don't know it. Does anyone have any good ideas? ...

ajax jquery post problem--can't retrieve values

I'm trying to use form submit with jquery without a page refresh as demonstrated in this tutorial: submite a form without page refresh using jquery demo It uses the $.ajax function to post the values, which I've included below: $.ajax({ type: "POST", url: update.php, data: dataString, // dataString's value is 'id=5' success: f...

How to Show "Radial Menu" jQuery Plugin at the Page Load?!

Hi Guys, I am Not Familiar with JavaScript and i am beginner in Jqyery! I Found RadMenu Pluging from web and want to use it to show my links as a Radial Menu. it is OK but I have a Simple Problem With it. I want to khnow How Can I "Load"(better to say "Show") Radial Menu at the Page Load?! I can Show or Hide the plugin with this codes: ...

JQueryUI Accordion not using the height of the parent div when using fillSpace

I am fairly new to using jQuery and the jQueryUI libraries, and am trying to add it to a new site I am creating. However, I am running into problems with the accordion function, where it does not seem to be obeying the height of the parent div when I set a height in CSS and set fillSpace: true. The text for each accordion is much longer ...

$(doucment).ready(function(){}); and $(window).load(function() {}); confusion

Hello guys, My test product page over at http://www.marioplanet.com/product.htm has some odd behaviors which I could really use some help working out. Now, I had a problem previously with my image resizing, and someone here helped me out by saying that I should nest the image resize inside a $(window).load(function(){}); In order fo...

jQuery Linked Selectors Not Showing? - What's wrong with this snippet?

Why isn't this snippet showing "YES" in the div id = debug after each item in id=box is clicked and placed in id=que. (assigned class click2Remove) then clicked again in que? ? <script> var idcurrent = 0; $(document).ready(function() { $(".click2Select").click(function() { idcurrent = this.id; $("#" + idcurr...

If I have one nav_bar.html file that is included on other pages, how do I show which menu item is active?

Hey everyone... thanks for taking the time to read this. I have a JavaScript (jQuery) navigation bar on my main page that is simply "included" on my page. For example, I have index.shtml that "includes" the nav bar, which is "nav_bar.shtml". And this is the same for every other page. Now clearly, with the current setup, there's no wa...

jQuery param() for associative array with values assigned at runtime

I'm trying to serialize to URL string an associative array whose elements are defined at runtime in the form of arr[key]=value, where key and value are determined at runtime, but arr is predefined as a global before runtime. I can't get the param() function to work with this kind of array. Is there another function to use to serialize su...

Two level horizontal menu highlighting current page.

I've made a two level menu using CSS and HTML (ul's etc). What I want is the top level to be selected (using the 'selected' class) and the item in the second level that corresponds to the current page to have the class 'active' (which is just bold). EG when the user navigates to '/maintenance/company.aspx', I want the Maintenance menu i...

How does jQuery's synchronous AJAX request work?

Does jQuery.ajax({async: false}) still use the XMLHttpRequest object? If so, how is the request synchronous? Is there just some mechanism inside the function definition that allows the asynchronous request put out by the XHR to be wrapped in a synchronous wrapper? I ask because I want to wrap asynchronous function calls into a synchro...

Is there a way to bypass Javascript / jQuery's same origin policy for local access?

Trying to use ajax, getJSON, and functions like that to fetch an external URL from a local (non-server) development computer. Is there a way to bypass the same origin policy, so that I can test locally, instead of having to upload to a server? ...

What is the prefered method to preload images <img> and why?

What is the best method to preload images <img> and why? I want to show images on link's hover i can't use images in CSS background so i can't use CSS sprite. but i want to preload all images while page load . which are add as <img>. ...

Help with some jQuery in a Wordpress Loop

I am making a custom archive page, that will display the list of posts with their excerpt, and a button that when clicked toggles the rest of the post content. I have it working with this code, except that it toggles EVERY post content lol because in the loop they all get the class you know what I mean? Can you help me fin a way to do t...