jquery

How to gracefully handle iframe breaker?

Hi, I understand that there is no way to kill the iframe breaker... However, I was wondering, is there a way to gracefully handling it. So far, I managed to detect it before exiting, using <body onunload="function();">. I was wondering whether it is possible to prevent it from loading the iframe or force it to open in the new window, ...

How to pass a variable into regex in jQuery/Javascript

Is there a way to pass a variable into a regex in jQuery/Javascript? I wanna do something like: var variable_regex = "bar"; var some_string = "foobar"; some_string.match(/variable_regex/); In Ruby you would be able to do: some_string.match(/#{variable_regex}/) Found a useful post: http://stackoverflow.com/questions/185510/how-can...

preventing div jumping on fadein

I use jQuery to fade in a caption on a icon mouseover. $("#v1").mouseover(function() { $("#vc1").fadeIn("slow"); }); Here is the html <div class="preview_item" id="p1"> <div class="view_site_caption" id="vc1">View Site...</div> <div class="view_site" id="v1"><a href="http://www.delicious.com" target="_blank"><img src="appl...

How to toggle number of rows with jquery?

I want to add Toggle show-rows like Google analytics top content. At the bottom of Google analytics top content, there is a dropdown option to select 20, 50 etc to toggle number of top content. I want to add this javascript to my dynamically generated product list. It seems like it uses onCharge in select tag. I want to use jquery fo...

showing a element on mouseover and hiding it on mouseout

I have this small script that shows a caption for a img when it is moused over. $("#v1").mouseover(function() { $("#vc1").fadeIn("slow"); }); How can I expand on this so that the caption #vc1 fades back out when the icon #v1 is not moused over? ...

Debugging jQuery AJAX response: what I'm doing wrong

$.ajax({ type: 'POST', url: 'place/add', data: { lat: lat, lng: lng, name: name, address: address, phone: phone, review: review, category: category }, success: function(data) { alert(data); alert(data.id); // ...... }); The first alert gives: {"id":...

Getting some weird results with jQuery / PHP / MySQL

I'm having trouble getting the expected result. I have the following jQuery script: // obj is the return result of another query jQuery.post("mypath/include/jquery_bll.php", { instance: 'controllAccess', brandID: obj.id }, function(data) { if (jQuery('#brand_selectList').length == 0) { if (data == "Locked") ...

Does the iPhone has AJAX and jQuery support?

Does the iPhone has AJAX and jQuery support? I am developing a chatbox for iPhone with these two. Are they supported on MobileSafari? ...

Jquery animating percentage width wrong

I've got a simple snippet I use to animate polls. I'm using the snippet in Drupal, but drupal uses an inline percent width and the script goes all wacky. It animates way past the maximum length of the poll bars. I have tried the same code with pixel widths and it works fine. Any ideas? Here's the code. $(".poll .bar .foreground").wid...

jQuery's load() doesn't display images

Good evening everyone, I am using a JavaScript to load/override content from an HTML-File into specified divs. You can watch a demo. The javascript that does the load job looks like the following: function loadScreenie(elementSelector, sourceURL) { $(""+elementSelector+"").load("img/screenies/"+sourceURL+""); } and gets invoked ...

Sort not compatible with IE?

The code below works fine for dynamically reordering links in firefox, but for some reason not in IE (version 7). Any ideas what part of the code is causing problems? Thanks. var parent = $('#itemHolder'); var children = $('a', parent); var children = $('a', parent).sort(function(a, b) { return parseInt($(b).attr('amount')) ...

jQuery closest();

Hi There! I'm trying to animate an image which is partly hidden (via overflow: hidden) inside a list item. I want this to happen when a user hovers over an A tag inside the same list item. I have the following markup: <div id="projects" class="section"> <ul> <li> <img src="assets/img/projects/pf6.jpg" width="980" height="5...

Question regarding select and option value="" using JQuery

Hi all, let's say i have list looking like this: <select name="name" id="id"> <option value="10176232332">David</option> <option value="10187232332">Sven</option> <option value="10202232332">Ololf</option> <option value="10219232323">Jan</option> <option value="10230232323">Gustaf</option> </select> Using JQuery, ...

Content within Floating Window using jQuery SimpleModal plugin cannot be replaced after opening twice in IE8

Hi all I am using SimpleModal plugin for showing dynamic content within a floating window. On this floating window a Javascript function call has been included (on a click event), which is changing some content on this floating window. This works all very well with FF. But there is an issue with IE (I have tested with IE8 only): Only a...

Forms Issue Cross-Domain Posting to MVC Controller using JQuery

I have a very strange issue on my hands. I have two IIS websites using host headers. I have some simple code using JQuery and JQuery.forms to post a simple form to a controller. The controller returns JSON. It works great as long as the client code is present on the web site that has the controller code. The moment I move the form...

jquery select unique item

I am having issues with selecting a certain element in my html When I click on the link with class "event_rsvp", I want to effect the HTML of the span in the next li with the class of "interested-status" I have tried closest, tried going out to the parents, how do I tell one to talk to the other. <li rel="101590"><span class="rsvp-stat...

add id to li a using jquery

Hi all, I'm looking for something that will allow me to add an id tag to the 9th li a tag in my list.. I'm not even sure if it's possible? Here's the code: <ul id="p7menubar"> <li><a href="#" class="trigger">Home</a></li> <li><a href="#" class="trigger">About Us</a></li> <li><a href="#" class="trigger">Collections</a></li> <l...

jQuery element index in array

I have several images loaded into the DOM via jQuery. Each image has 'display: none' aside from one which is 'display: block'. It's this image which I need to find the index of once selecting the img array from the DOM. The trouble is, img[style="display: block"] doesn't seem to be working as 'display' isn't the only style set on the el...

How to I make jqGrid show its edit window in a specified container, not its own modal dialog?

I'm trying to use jqGrid's editing functionality, as demonstrated under row editing in its demos and docs. However, instead of having jqGrid open a javascript modal dialog box, I would like the edit window to appear in an another page element alongside the table. In essence, I want code that reads like: jQuery("#table").jqGrid({ .....

jQuery cycle plugin customizing

I'm using the jQuery Cycle plugin to start a slidshow of images when hovering over the initial image. This works fine. What I want after that is to have the slideshow stop when hovered off, and have a manual slideshow (next/prev buttons) start. This currently works, but the slideshow starts from the beginning each time it's initialized. ...