[jQuery] populate selectbox with json feed...partially working, need help to finish.
i have this json feed: { "channel": { "title": "History", "id": "12", "subtopics": [ {"title": "Roman History", "ID","13"}, {"title": "Greek History", "ID", "1"}, {"title": "French History", "ID", "1"} ] // subtopics } } and i want to populate a select box to result as follows: <option>History> <optgroup> <option value="ID">Roman History</option> ... </optgroup> </option> this is the code i have so far: $.getJSON("jrss.js", function(json) { var html = '<select
[jQuery] asdf
asdf
[jQuery] how do you get a div from an ajax form return?
I'm using the jquery forms plugin for an ajax request and update. I set the target option to the desired div that I want to update. The problem that I'm running into is that it will update the div with the contents of the entire page rather than the just the contents of that div. I'd like to do this without creating another view for just the div alone. What is the proper way to do this? Return the calls results to a variable and then parse the variable for the desired div? Is there another way? Thanks
[jQuery] Selecting options programatically with change event fired
I'm making first steps using QUnit for unit testing javascript. I have a logic that based on selected option from selectbox does something. I would like to test that logic but I'm unable to select options programatically in my tests so that "change" event of the selectbox is fired. Please help.
[jQuery] Load JQuery only once
Hello, I've developped several plugins for wordpress that require JQuery. As I have packaged and distributed these plugins separately, they come all with one version of JQuery. The problem is that if someone uses two of these plugins, the HTML header will look like : <script type="text/javascript" src="http://mysite/plugin1/jquery.js"
[jQuery] How to find the first parent?
How to find very first parent of perticular element?
[jQuery] jCarousel problem in Chrome
Hi, Does this work with Google Chrome? All looks fine on page load. However, the thumbnails "overshoot" (can't think of a better way of describing it) when using the next button. In other words, when scrolling, the thumbnails are not contained within the carousel. I guess this is a CSS issue (script works fine for me in FF and IE), but wondered if anyone had come up for a fix with this. Thanks. Ade.
[jQuery] autocomplete: positioning of the select box
I am using the autocomplete plugin. Everything works fine, besides one little problem. How can I control the positioning of the select-box that contains the autocomplete suggestions? I want to lower the select box a little bit, and also want to move it a little bit to the left. This is because I am using an "image input field", and the borders of the input field in the image are a little bit wider than the regular input field borders. Any help is much appreciated.
[jQuery] How return value in jQuery ajax
i have function jQuery.ajax({ type: "GET", url: url, data: queryString + '&btnSubmit=1', success: function(msg) { if(msg=0){ if(msg) { $("#errorid").val(""); } else { $("#email").val(""); document.getElementById("email").focus(); } } } }); how to get msg in othe javascript function function() { } how can i use out of one function in other javascript function OR how can i Stop one function from the other function
[jQuery] ui sliders group
I would like to create a group of 4 ui.sliders where the total they all stay in sync so that sum values do not exceed 100. Where as you adjust 1, the other 3 automagically move to compensate for the change. IE: slider1 is moved to 50%, slider2,3,4 would all adjust in increments of slider.stepping from their current value up/down as needed so that the sum total of all 4 slider values never exceeds 100. I don't have the slightest clue where to start, I am guessing i need to use the slide callback to
[jQuery] document.getElementById shortcut?
I found myself using document.getElementById often in my coding. Is there a shortcut for it in JQuery? PS: $('#id') is not a shortcut. Since $('#myimage').src will not work. $('#myimage').attr('src') will but I think that document.getElementById is when I do not need extensive JQuery selection ability. Plus it's a) faster b) I can always convert to JQuery collection if I need to do something fancy like var myelement = document.getElementById('myimage'); $(myelement).hide('slow'); PPS: so far i am
[jQuery] setRequestHeader('Cache-Control', 'private') ... does not work in $.ajax call
I'm using $.ajax() to connect to a web service. In firebug, I notice in Firebug that the ajax request is sending the following headers: Pragma: no-cache Cache-Control: no-cache However, I want to ALLOW caching on the server side. I've tried the following, with beforeSend: $.ajax({ type: "POST", url: "/ClientWebServices/MyWebService.asmx/WebServiceMethod", data: jsonString, contentType: "application/json; charset=utf-8", dataType: "json", beforeSend: function(xhr) { xhr.setRequestHeader('Cache-Control',
[jQuery] setInterval method call with parameters not working
HI There, I'm trying to call a method using the setInterval function that call has some parameters but I can't get it to work. Can someone give me a hand with the syntax please. Sean slideshow_interval = setInterval( 'PageMethod("getNextSlideShowItem", ["elmID", callerID, "CampaignID", hdnCampaignID], onSuccess, onFail)' , 1000); function PageMethod(fn, paramArray, onSuccess, onFail) { var pagePath = window.location.pathname; var paramList = ''; if (paramArray.length > 0) { for (var i=0; i<paramArray.length;
[jQuery] tree view layout without recursive function - insert and delete methods now available
Hi to all!!! I've realized the 0.3 version of jqtreevial plug in. The main feature added is editing the tree view nodes. You can now insert or delete nodes using insert_node() and delete_node() methods. The demo version available uses contextMenu plug in to demonstrate how to use these methods. Comments and suggestions are very welcome! download at: <a href="http://downloads.sourceforge.net/jqtreevial/jqtreevial-pack-0.3.zip">http://downloads.sourceforge.net/jqtreevial/jqtreevial-pack-0.3.zip</a>
[jQuery] How does this find the first child?
I'm working my way through understanding the Master/Detail, AJAX enabled, accordion style control presented here: http://mosesofegypt.net/post/2008/04/GridView-Grouping-Master-Detail-Drill-Down-Using-jQuery-AJAX.aspx The following code has me confused (I've only included a couple lines of the function): function showhide(master,detail,customerId) { //First child of master div is the image var src = $(master).children()[0].src; master is a div passed into the function that contains an <img> and a
[jQuery] why is the "click" event different in <a> elements?
Imagine this code: $("a").click(function () { alert("hello world"); return false; }); $("button").click(function () { $("a").click(); }); I would expect that clicking on the button would trigger the click event on the links element, but it is not the case because of the following code in jQuery: // Handle triggering native .onfoo handlers (and on links since we don't call .click() for links) if ( (!fn || (jQuery.nodeName(elem, 'a') && type == "click")) && elem["on"+type] &&
[jQuery] event delegation - great, but how does one trigger the handlers through code?
During event delegation, handlers are registered higher in the DOM tree and then filtered when the event is triggered. This is great if you have 2000 td/th cells, you can attach a listener to tbody and filter down. But would i trigger the event programatically? Since the handler isnt actually registered on the td cells, i cant figure out a way to do this except maybe construct a fake event with the source element by hand and pass it into the handler somehow?? this is the biggest drawback to delegation
[jQuery] Closing XHR
Hey there, I will try and explain this as clearly as possible. I am building a CMS and i have a list of data, when you click on the "delete" button next to an item in the list it loads up this function: function xhrRequest(type, url, data){ $.ajax({ type: type, url: url, data: data, cache: false, success: function(msg){ $("#xhr").append(msg); animation(); } }) } and the function is called like this: onclick="xhrRequest('GET',
[jQuery] xhr.responseText isn't showing up when expected
Am I misunderstanding how $.ajax( { ..., asynch: false } is supposed to work? I'm not seeing a responseText value immediately on returning from the ajax call as I would expect. Here's the relevant code: -------------------------------------------------------------------------- var xhr = $.ajax( { url:' getFontInfo.php', data: 'font=' + fontFileName, asynch: false } ); var fontName = xhr.responseText; --------------------------------------------------------------------------
[jQuery] form plugin and file upload problem in Internet Explorer
Hi there, I have the following problem: I'm creating a multi-step insertion process using jQuery. The pattern I'm using is the following : I have one content (main) page which holds all the jquery script references, css styles and an accordion plugin control.There are separate aspx pages that hold the logic for each step of the proccess , and I load them dinamically (with ajax .get and .post methods) into the main page as they are needed. This pattern works fine on all pages (steps), except on one
[jQuery] form plugin and file upload problem in Internet Explorer
Hi there, I have the following problem: I'm creating a multi-step insertion process using jQuery. The pattern I'm using is the following : I have one content (main) page which holds all the jquery script references, css styles and an accordion plugin control.There are separate aspx pages that hold the logic for each step of the proccess , and I load them dinamically (with ajax .get and .post methods) into the main page as they are needed. This pattern works fine on all pages (steps), except on one
[Resolved] Pass Arguments to toggle()?
Hey everyone, I have a little jQuery snippet that allows me to swap an image in and out of a specified div. See the code: $("button#buttonID").toggle(function(){ $('img#imageID').attr('src','images/oneImageToSwap.jpg'); }, function(){ $('img#imageID').attr('src','images/otherImageToSwap.jpg'); }); This works fine. However, I'm going to have a bunch of images to swap in and out of different divs, and I'd love to be able to reuse this function so that I could just pass the names of the divs
click function on div to open page
Hi, I'm wondering how to solve this problem: I have a <div id="test">some stuff</div> Now I want to add a link (onclick="index.php) to this div. Whats best practice? thx TC
[jQuery] smoother .animate()?
Hi, kids -- there's a nice Flash site ... marcecko dot com ( especially, the window-content-movement, mouse.x/y) ... ported to html/jQ, but couldn't find a way to realise the "smooth sliding" part while moving; it's f'd, scratchy. any solutions? or, a Flash-only thing? thanks! -B now, have a look: (tested on FF3, IE7 -- XP) ----------------------------------------------------------------- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http:// www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
[jQuery] How to correctly set a dblclick(..) on a dynamically added table row ?
Below is a demo of the problem i have. Reduced to the minimal HTML I think. I start with a row in a table, but on load, I remove it and store it. Then i dynamically insert some row based on a clone of the original. As I add each row i add a double-click to a popup form (via blockUI). The first time you double click a row it works. The second time everything freezes during the popup. There must be some rules around row removal and re-adding, or dynamically attaching a dblclick(..) event that I'm unaware
[jQuery] Tablesorter pager and ajax
I've noted that tablesorter and the pager don't work in ajax response such as the content returned in the jquery load(), with or without previous Table tags How can i fix this . See this demo of the problem in http://realferias.com/pager.asp
Control contents of iframe
Hi! I'll try not to go into too much detail, but basically I need some code to make the contents (specifically images) of an iframe expand by 10 pixels when the iframe is loaded. The code I have below will expand all the images on my main HTML page, but not the images included in the iframe. Would somebody please let me know what I need to do to get the images in the iframe to expand by 10 pixels too? Thanks in advance. The iframe is being pulled in from another domain. Is there some type of xss
[jQuery] Cascade Plugin IE6 bug
Hi all, the "First Option" demo doesn't work on IE6. It never selects the first option, and it displays a Javascript error message : "Impossible to define the selected property. Index not valid" It seems the target select list is not loaded, but I don't understand why ? Any idea ? Thank you, Bernard
[jQuery] Slider bugs
Hi, i recently installed another slider on a site and tried something new by having the slider span the entire width of the window instead of being contained in a box with no overflow. There seems to be some weird bugs now and I was hoping one of the gurus out there could give me a hand in identifying what the problem is. My test site is here: http://www.folkphotography.com/test/dogs/index.html It seems to work ok in IE7, however when I try it in Firefox, once you get to the 10th panel the slider
i suck; problems with contextMenu
i have testing the contextMenu plugin from jQuery, but it dont work how i want. $('*').contextMenu('contextMenu' , { onShowMenu: function(e, menu) { if ($(e.target).attr('class') == 'icon') { //all }else{ $('#downloaden, #delete, #copy, #cut', menu).remove(); } return menu; }, bindings: { 'delete': function(t) { }, 'paste': function(t) { }, 'copy': function(t) { } } });
[jQuery] When an embedded object ready
I'm using SVG with jQuery and I'm aware of jQuery SVG plugin and Marvin's discussion at http://marvin.elte.hu/balu/content/jquery-svg. For developmental reasons, I'm trying to embed SVG as an object to my DOM. For example: var mysvg= $('<object id="object" data="ellipse.svg" type="image/svg +xml" width="160" height="100" style="position:absolute;top:0px;left: 0px;z-index:100"></object>'); mycontainer.append(mysvg); //append it to the container My aim is to update SVG parameters when it is ready.
[jQuery] Multiple Autocomplete
Hey, I got this setup going on where the user can add multiple autocomplete boxes onto the page. I got a problem though, I need to return the ID of the selected user so I can use it with the PHP backend, but when a new row is made, all the ID values are changed to the latest autocomplete field. Does anyone know any way around this? === START === function addFormField() { var id = document.getElementById("id").value; $("#lesson-student-array").append("<tr id='row" + id + "'><td style='width:16px;'>
[jQuery] Submitting the submit input value
I noticed that when I use the .ajaxSubmit button to post a form, it doesn't send the value of the submit button in the form data. For example: <form name="form1"> <input type="text" name="foo" value="bar" /> <input type="submit" name="button" value="click" /> </form> If I call jQuery('form1').ajaxSubmit(); The value sent to the server is foo=bar and not foo=bar&button=click. Is there an easy way to get this to work? It's needed by my backend server.
[jQuery] Remove comma
Hello, I have the following code: $levels = $('input[name="Levels"]:checked + label'); levels = $levels.map(function() { return $(this).text(); }).get(); $theme.append(levels.join(", ")).append('<br />'); How can I replace the last comma in levels by " and "? I tried: levels.join(", ").replace(/, $/,'and ') This is not working. Could someone, please, help me? Thanks, Miguel
[jQuery] jquery in asp.net
I have a code in asp.net: <body> <form id="form1" runat="server"> <div id="container"> <div id="login"> <div class="window"> <table> <tr> <td> Login: </td> <td> <asp:TextBox ID="tbLogin" runat="server"></ asp:TextBox> <asp:RequiredFieldValidator ID="rfvLogin" runat="server" ControlToValidate="tbLogin" ErrorMessage="Musisz podać login"></asp:RequiredFieldValidator> </td> </tr> etc. I'm using firebug, and now I want to set focus on tbLogin. When I open it on the server and I write $('input#tbLogin').focus();
[jQuery] Another jQuery Quicksearch Plugin question
Hi all, Just learned about the quicksearch plugin from a couple of posts yesterday. Very cool. Thanks for writing and sharing it. I have a table which is filled in periodically from some asynchronous calls. That is, when the page initially loads, the table is empty. As search results come in, the table is populated. There may be several updates to the table. I'd like to use quicksearch with the table, and it works provided that I call $('table#table_example tbody tr').quicksearch( {...} ) after the
[jQuery] Same effect for multiple classes
Hey, I am trying to create something similar to an Accordion effect using jQuery but some some modifications. I have a <ul> with a bunch of elements inside (<li>). When you click say a link within the <li> slide a <div> down to reveal a quick description about the post. The part I am stuck at is, how do I use the selector for each. I do not want to make a section of code to animate for each one, is there a way to use each() to create each segment for each header, you can check it at the right section
[jQuery] Simple Validate if empty
Hey, I have been trying to look for a simple way to validate one field, if its empty then do X, how would I check? I have this: term = $('#term').attr('value'); Would I check if term is empty? Then don't allow the submit, my code is here: http://pastie.org/320870 Any thoughts? Thanks, Ryan
[jQuery] SFBrowser updated to 2.5.1
http://plugins.jquery.com/project/SFBrowser SFBrowser is a file browsing and upload plugin. Returns a list of objects with additional information on the selected files (filesize,date,width,height). Features: ajax file upload, localisation, sortable file table, file filtering, file renameing, file duplication, file download, file/folder context menu, folder creation, image resizing, image preview, text/ascii preview, multiple files selection, inline or overlay browsing.
[jQuery] How to memorize a "class" change?
I am removing&adding a class to a DIV. What is the best way to memorize this change for the application before it is resetting itself while going through the loop again? Thank you!
Next Page