• Doing a user "Click" or "Select" on a ListBox by INDEX

    Hi. I want jQuery to effectively 'click' a specific <option> inside a <select> but to do so based on the <option>'s INDEX in th <select> rather than it's value or text. I am using a <select> that's a ListBox as opposd to a DropDown (if that matters).   Ideally, I'm hoping that it will really behave like a "click" in that if the item being selected is below the scroll, it will scroll it into view, but that's just a "nice to have."   Help much appreciated!
  • problem tih 'offset(coords)' in different browsers

    I have a very specific bug, and i spent a few hours trying to dig into something.so here's the bug: i have a very different behavior of setting offset top with $.fn.offset function in google chrome and mozilla firefox(ie has behavior like mozilla). the results are very different. as i watched - the inside body of the function gets the top property of element by curCSS, which is definitily giving different results(first case - about 150, other - about 4500 px). i am setting the top of the element
  • [validate] errorPlacement called only one time

    Hi all, Im trying to create one tupla, above the input where the error coming from. At the first time (for ex. "This field is required"), this works fine, but when runs another rules (like "This field must be at last 8 characters"), apparently the span tag is not created, or another thing like that.. errorPlacement: function(error, element) { $(error).html("<span style=\'display:block;text-align:left\'>"+$(error).html()+"</span>"); $(element).before(error); } Really thx for the help!
  • howto catch a value change event on input field?

    input field value is changed by a js function i can't modify so i can't trigger() an event from that function. i've tried $(element).change() but it doesn't seem to be working. any ideas?
  • sum of array works with 1 array not another

    Hello all, Once again I call on the gurus after banging my head against the wall for a few hours.  I use .clone to clone some elements then I get the various values in an array.  All that works fine.  However, I want to total up the array so I can validate the total against another value. In the code below if I put the x array in the sum such as sum(x) and alert(quantityTotal) it shows 4 as expected.  If I simply alert(quantities) I get 3,1 however, if I sum(quantities) and alert(quantityTotal) I
  • modal dialog within modal dialog

    was wondering if this is possible, I want to be able to open a modal iframe dialog within another modal iframe dialog. the challenge is that the subsequent windows should not be limited within the boundary of the opener. is this possible ?
  • JQuery UI Modale view, forum submission when pressing enter

    Hi there,  I've setup everything correctly, my modal window is working great, I'd just like to know if it's possible to automatically submit the forum within the modal window by hitting enter ? That action would start the same function as if the user clicks on the "Signup" javascript generated button at the bottom of the modal window.
  • ajax get an div outside a form

    Hello, We encounter a strange issue. Having a html response like this: <html>       <body>             <div id="mydiv">content</div>       </body> </html> Doing : alert($('#mydiv').text());gives me "content" Doing : $.get([url-to-the-page]),       {},       function(data) {             alert(data); //shows all the html (see above)             alert($(data).find('#mydiv')); // SHOWS NOTHING !!!       } );To get the correct result ("content"), i have to put the div into a form : <html>       <body>
  • This works...kinda

    I am using jquery for a user registration form that sends the the info to a PHP script to check for duplicate username's on signup.  Even when there is no entry found and the script preforms the update statement, the error will come back indicating the requested name already exists. if (isset($_POST['name'])) { #Check to see if requested name already exists $name = $_POST['name']; $siteid = $_POST['siteid']; $checkname = mysql_query("SELECT * FROM projects WHERE url = '$name'"); $founduser = mysql_num_rows($checkname);
  • div return value to parent

    I have a form, and in that form I have a div that list a table of pet owners. This table is loaded from a file called findowner.php. After clicking on the row of a pet owner I want to use the variable I got $(this).attr('rowid'). This is the owners id. In the php file I get it like this: Code: Other td elements here for name, address, etc. '<td>'.'<a id="tableid" href="#" rowid='.$rowid.' >'.$rowid.'</a>'.'</td>'. Code: $('a#tableid').click(function() { var vpetowner = $(this).attr('rowid'); alert(vpetowner);
  • accessing the element that was dragged (with sortable)

    So, I have several lists (<ol>), and I made the <li> elements sortable, within the same list, and also between the lists (they're connected). What I'm trying to do, is having a function when the <li> element is dragged in the same list, and a different one when it is dragged to other list. This is what I have: $(ol).sortable({ placeholder: 'ui-state-highlight', handle: '.liHandler', connectWith: '.list ol', opacity: 0.6, containment: listsContainer, update: function() { updateElementsOrder(ol, ol.parentNode);
  • manipulating Flash objects in IE8

    Hello, I'm trying to use jQuery to process embedded Youtube videos in a blog template. The idea is that someone posting a blog can simply paste in the auto-generated embed code, then when the page is viewed the script makes the neccessary tweaks. I've come up with the following code, which works in Firefox, Chrome and Safari: $(document).ready(function(){     // fix embedded videos     $("object").each(function(index){         //set wmode         $(this).children("param[name='wmode']").remove();
  • Problem with microsoft templating plugin

    < body> <script type="text/javascript"> var dataObject = { firstName: "<b>John</b>" }; jQuery(function () { // A template string var tmpl = '<li><a href="${url}">${this.data.firstName}</a></li>'; // Renders one LI, filled with data, then appends it into the UL $.tmpl(tmpl, dataObject) .appendTo( "ul"); }); </ script> <ul> </ul> </body> The output is <u><b>John</b></u> I would like to convert it to John how would i do this?
  • TreeView plugin - cookie-based persistance

    Hi, I'm a real novice, but I have started to use the JQuery plugin and I think they are fantastic, particularly the TreeView menu. My question is how do I place this Menu on a number of pages, so that the persistence works? It is perhaps a little understatement to say that I do not understand how the menu can persist over page changes! I've tried the parameters $(document).ready(function(){ $("#browser").treeview({ animated:"fast",         collapsed: true, persist: "cookie" }); }); But that doesn't
  • delegate() issue

    I had a issue with live() with change event in IE ,that is drop down do not invoke the function on change ,to solve this issue i used delegate().it was working fine with both IE and mozilla.now the another problem i am facing is when i add multiple drop down for the purpose of search criteria(in all drop down contents are same and all are loaded from the same config file) the delegate function not invoking the function.but drop down has different id and same class name.any one knows alternative solution
  • Select items with one class, but not second class

    Hi, <input type="text" class="class1"> <input type="text" class="class3"> <input type="text" class="class2"> <input type="text" class="class2 class1"> <input type="text" class="class1 class3"> <input type="text" class="class1">Given the above, how would I select those that HAVE class1, but NOT class2, don't care about class3 So what I want are the items on lines 1,5 & 6 How could the below be modified to achieve what I want, or do I need something completely different? $("input:text.class1")Cheers,
  • Disable href link

    is it possible to disable several href links, as I could do with having several href tags but with out them trying to load what ever is within the href, as I want manipulate the href content myself if you see what I mean For example something like <a href ="content" data-role="disable" >sdasdsa</a> so if this link is click it does nothing, so that I can then manipulate it in my code further down: $('#idname a').bind('click',function(e){ //do some code }); Many Thanks
  • Final build jQuery lib version

    Hey, I'm in the process of starting up with jQuery Mobile to work with the Lift framework. My question is, is there a defined point release of jQuery that will be required for jQuery Mobile to work? Is it certain to be a 1.4.x build? Thanks
  • Replace JS and reload flash with jquery?

    Hi! I am forced to use a traditional flash player for my client's project. Since flash is outdated (not supported by Apple iOs) I am not into flash and used the LongTail Player. The problem is the website designer told me to use a gallery with roll over. So I roll with the mouse over thumbnails (<a>) and the video box source is replaced. Code of the box looks like this: <div id="mediaspace">This text will be replaced</div> <script type="text/javascript"> var so = new SWFObject("videoplayer.swf","mp4","384","288","9");
  • Form get() URL management

    I am trying to find out how to do a standard http form get and NOT include any ajax/jquery navigation. In my project divided into two parts (1) jquerymobile form <hands over to> (2) non-jquerymobile (same domain) webpage.  The mobile form makes a standard get() request to the non-jquerymobile page.  On form submit however I constantly get the following: TypeError: Result of expression 'k.data("page")' [undefined] is not an object.   jquery.mobile-1.0a2.min.js:88 If on the non-jquerymobile page I
  • clone(true) launches error

    Hi, I'm stuck into a curious problem. I have a function linked to a click event in an HTML button. Inside this function, another method is called, which uses an array with a prototype method for removing elements from an array (Array Remove - By John Resig (MIT Licensed)).   When I make a clone(true) of the HTML section where the button is contained, I get following error in FF 3.6.12: "this.slice is not a function". In Chrome 7 I get: "Uncaught TypeError: Object #<an HTMLDivElement> has no method
  • Tabs & Autocomplete

    I am building an application and using tabs to load the content thru ajax requests. On one page I have content that is dynamicly loaded but I want to add an autocomplete option to the field. The data I get back from my request is HTML. Is there any way to hook a autocomplete to an input field in the HTML on the fly? This what i do:     $("a.manage").live("click", function(event,ui) {                                                 $.ajax({             get the data from a PHP file and get HTML code
  • Growfield events

    Trying to get the growfield plugin onHeightChange event to trigger with the following script but it wont work $(document).ready(function(){ $("#chat_message_post").growfield({ restore:true, events:{onHeightChange: function(){ alert('hi'); } } }); }); I dont get any errors, but it doesnt alert the message like I expect Taken from the growfield API (http://kuindji.com/jquery/growfield/growfield.xml) events The following events can be bound to by specifying them as options or just binding to a jquery
  • I don't want movie to open in new page

    Hi I'm new to jQuery, and have never used a plugin before.  I am trying to use embedquicktime to put a QT movie into a web page.  As a trial, I have set up a very simple page with eqt, and used the code generator at http://www.solitude.dk/archives/embedquicktime/#codegenerator to do the donkey work. I get a jpg thumbnail as expected, and when I click on it, the .mov starts to play.  The only trouble is that this happens on a new blank page, rather than on the original page, which was my intention.
  • Dialog position not honored within an iFrame in Chrome.

    I am using jQuery UI dialog widget to show notices in an application that is running within an iFrame (a Facebook application to be precise). It works fine in Firefox, but in Chrome, the dialog shows up on extreme left-bottom inside the iFrame, even though I have specified the position as 'center'. I am using jQuery core version 1.4.3 and jQuery UI version 1.8.6 My code is as follows: $(function() {   $("<div id='flash-notice' title='Done!'><p>Your edits were successfully saved!</p></div>").dialog({position:'center'});
  • Problem in UI Modal Dialog in IE not display properly (see attached image)

    Hi All, I encounter this issue any help? Thanks
  • JQuery Menu Not Working in IE8

    Anyone know why my jQuery IE8 menu isn't working? Works in FF: HTML: <html>   <head>     <link href="stylesheets/screen.css" media="screen, projection" rel="stylesheet" type="text/css" />     <link href="stylesheets/print.css" media="print" rel="stylesheet" type="text/css" />     <script langugage="javascript" src="javascripts/jquery.js"></script>     <script langugage="javascript" src="javascripts/page.js"></script>   </head>   <body>           <div id="menu">             <ul>               <li><a
  • Datalinking against properties in two ViewModels?

    I can not seem to get it right with datalinking and create a different type of datalinking. Any idea to get it to work? # Csharp     [Serializable]     public class BokingViewModel     {         public AccountViewModel AccountViewModel { get; set; }         public TravelViewModel TravelViewModel { get; set; }         public int Ordernr{ get; set; }     } # Javascript       var customer = {         // Kunduppgifter       $("#form1").each(function (i) {            $("fieldset.contact input", this)
  • After swipe, first blank screen

    Hello, I am having a problem with jQuery Mobile. When i add a swipeleft to a page it works but first it loads a blank screen, just the body. When you click on the screen it works. Why does the blank screen first appear? Code: $("#page1").live("swipeleft", function() {    $.mobile.changePage("#page2", "slide", false, true); }); Any Ideas?
  • Portlets draggability: Titlebar only

    Is it possible to make portlets only draggable when clicking the title bar, and not when clicking the content. At the moment it's not possible to select the text of the portlet, I'm still searching for a solution, but maybe someone over here knows a good solution for me.
  • How to achieve this effect in jquery (fadein a div on pageload)

    Hi, Here is a perfect example of what I'm after: if you were to choose from any of the select menus, when the page is loading you'll see you get a fade effect indicating something is going on. http://www.carsrus.ns.ca/used-inventory/index.htm?reset=InventoryListing Can someone throw me a bone how I may be able to do the same thing? Many thanks.
  • Google Images style Image Zoom

    Hi guys, I'm just wondering if there is a Google Images style image zoom?? So when you roll over it, the image zooms to about twice the size for an easier preview. (http://goo.gl/CUWGb) I don't need all the extra information and captions - just a larger image zoom. It's quite similar to this plug in here: http://www.sohtanaka.com/web-design/examples/image-zoom/ Except, I want to do it for single images, rather than a list of images. Does anyone have an adaption that I could use? Cheers in advance,
  • Draggable problem in Chrome and Safari

    I have a problem with Chrome and Safari... tried this in IE, FF and it works fine but in Chrome and Safari, dragging the element causes it to highlight the contents, start dragging the top image inside of the element and when I release mouse click the element follows my mouse around until i click again my code: <style type="text/css"> #container { position: absolute; top: 0; left: 0; width: 600px; height: 800px; margin-left: -150px; } #item { position: absolute; width: 300px; height: 400px; } #item
  • Getting started with jQuery Mobile

    How does one get started with jQuery Mobile? I've seen articles on getting started with jQuery Mobile in Rails and in asp.NET, but this requires learning those frameworks. Is there any simpler way to develop with jQuery Mobile? Thanks.
  • $.ajax is not working in safari why?

    Why my below code not working in safari? below code does not call my page method, but its working on IE, as well as in FireFox my method is calling but alert message does not show. Why? var options = {           type: "POST",           url: "Test.aspx/SendMessage",           data: "{'toMailAddress':'" + val + "','rno':'" + rno+ "', 'nonrno':'" + nonrno+ "'}",           contentType: "application/json; charset=utf-8",           dataType: "json",           success: function (response) {            
  • Reordering jquery group

    Is there a best way to reorder a jquery group/array, eg bring one item to the first position? Should you do it with a normal array.sort() or splice(), or is it possible with an internal function map()?
  • Optimisation by grouping/buffering DOM touching

    I was interested by Paul Irish's presentation on best practices where he mentions building document fragments off-DOM: http://www.slideshare.net/paul.irish/perfcompression (page 8) I was wondering about the possibility of having some kind of buffering capability in jQuery, eg: var $buffer = $.buffer(); $bigGroupOfFrags.each(function(){  $buffer.add( $('body').append(this) ); // any DOM touches get buffered }); $.buffer().flush(); // write to DOM I know you can manage this manually as Paul states
  • Pagination with data tables

    This page works except for one thing. With the pages in the footer. I don't want them to go to a different link I just want it to display that pages data in the table not have to have the page refresh, go to a different link. Anyone see a problem with me wanting to do something like that or how would that be accomplished. I'm a beginner at jquery. <?php // Include the database page include ('../inc/dbconfig.php'); // Number of records to show per page $display = 4; if (isset($_GET['p']) && is_numeric($_GET['p']))
  • Please help me tweak my code! (Trying to dynamically add <a> tag)

    I am creating breadcrumbs using XML with the following code: // <![CDATA[ var root = null; $(document).ready( function(){         $.get( "/_assets/xml/sitemap.xml",         function( data ) {             root = data;             var pathname = window.location.pathname;                         var local_url = "*[url=" + pathname + "]";             var currpage = $(root).find(local_url).attr("name");             var parentEls = $(root).find(local_url).parents();             var mapped = $(parentEls).map(function
  • callback chaining

    I'm trying to make the fancybox method to call when the xml ajax is loaded.  I've done callbacks on simpler statements, but I can't seem to find the right spot to put it.  Any help would be appreciated! <script type="text/javascript"> $(function () {        $.ajax({                 type: "GET",                 url: "http://drmartinplasticsurgery.mindbox360.com/images/BeforeAfter/face/PhotoGallery.xml", // replace with absolute URL of your gallery's xml file                 dataType: "xml",                
  • Next Page

  • Announcements

  • The Basics of jQuery AJAX

    A step-by-step tutorial for those new to jQuery and wanting to use AJAX in their projects. Includes valuable information about troubleshooting using the console and understanding the request / response. http://jayblanchard.net/basics_of_jquery_ajax.html
  • jQuery Conference 2010: Boston Announcement

      The jQuery Project is very excited to announce the jQuery Conference 2010: Boston on October 16-17, 2010.  The conference will be held at the Hilton Boston Logan in Boston, Massachusetts.  The best part of this announcement is that Tickets are on sale now!  This venue is the largest that the project has worked with to date (Harvard Law School in ‘07, the MIT Stata Center in ‘08 and Microsoft New England Research Center in ‘09) and we expect to sell out very quickly. A brief synopsis of some of