Multiple container content loading with Ajax/JSON
I was wondering if you could be so kind to help me with a small coding problem. I have implemented external content loading using Ajax. And now I would like to add multiple container loading functionality using a Json object code I have. Could you please help me incorporate the json object code into the Ajax code. My knowledge in coding is very limited :) Here is the detailed info: Here is the json object: var json = [{'id': 'content', 'wrapper': '__content-wrapper'},{'id': 'content', 'wrapper':
How do I find if a div is outside of it's container?
Hello, Is there a way to determine if a div is outside of the containing div? ex. <div id="container" style="overflow:hidden"> <div id ="row"></div> </div> I want to know if div#row has overflown the div#container. Thanks! Randy
Changing decimal to hex on the fly
I'm gradually changing the color of some list items like this, but since i is decimal, I'm not getting the full Hex range. Is there a simple way to change i to Hex, so I go from 0 to F? Does jQuery have a function to do that? jQuery('li').each(function(i){jQuery(this).css('color','#'+i+'0f')});
Anyway to post a HTTPS over ajax or another way?
Hello, To add people to my newsletter i have to post to an HTTPS adress. Is there anyway i can do this without the user to go to this page? Thank you! Niels
Problem with links as part of header
Hello folks, Having the following issue. I have a header that has not only a link in it to open the accordion, but also a link in it to "get more info" regarding the title of the header [which is a different link to a different sub page] It is structured like so: <div class="menu"> <div class="header"> <a href="#">title</a> <a href="http://someotherlink.com"><imr src="someicon.jpg" /></a> </div> <div class="subitems"></div> <div class="subitems"></div>
Structuring a new plugin
Hey, I'm in the process of developing a new plugin but the way I have structured the codes doesn't seem quite right to me so I'm hoping someone might be able to offer a better way to do it. The plugin itself has different behaviour if called on different types of elements (images, divs etc) with a range of shared functions used across all element types. This is the basic structure I have so far: (function ($) { $.fn.editable = function (options) { var defaults = { // default value
How do I set up an element with a single click to provide output to separate <DIV's>?
The goal is to have about 16 projects, each outputting its own set of photos(div id='centerContentLeft' with about 5 photos cycling/fadIn) and one text description per project in the (div id='centerContentRight'). The content of the Right div does not change while the left one cycles. When one clicks on another project the two divs will change accordingly. This code comes close, but you must click the project1 link twice to get both div's to display. The first click gets the images cycling and
New features for jQuery.browser class
I added some new features in jQuery.browser class . I propose you to share it. I added the distinction between the browser chrome and safari and i added detection of browser language. Is this for you a good idea ? --------------------------------------------------------------------(for Jquery-1.4.js)-------------------------------------------------------- uaMatch: function( ua ) { var ret = { browser: "" }; ua = ua.toLowerCase(); if ( /chrome/.test( ua ) && !/compatible/.test( ua ) ) { ret = { browser:
jQuery 1.4 vs $.fn.livequery()
I'm noticing very flaky behavior from livequery after updating to jQuery 1.4. It's a problem across browsers (IE,FF,Safari) and platforms (PC/Mac). Sometimes it simply doesn't work. Others it seems to work, but only after another event fires. For example I have a small plugin that alternates table row classes. It works on page load, but after an ajax load of a table it doesn't...until i click a button etc on the page...then the row coloring magically appears. Anyone else seeing this? Any workarounds?
AJAX Timeout not working
Hi, First off, great job guys. I love this library. Now, I am having one problem with the .ajax() function. My problem is, the timeout value seems to be completely ignored. Here is a code snippet: function send_request(request_object) { var req_data = "request_object=" + escape(JSON.stringify(request_object)); /* Reboot never returns, so time out fast! */ var timeout = 5000; if (request_object.command == "reboot") timeout = 250; /* Used by the timeout callback */ g_ajax_cur_cmd
LivingStories partial scroll menu in jQuery?
I was wondering if anyone had already built the jQuery equivalent of the menu on Google's livingstories that scrolls with the page to the top then sits at the top until the page is scrolled back down. If you haven't seen it, here's an example page: http://livingstories.googlelabs.com/lsps/executivepay It doesn't work in IE, but in other modern browsers, the menu on the right ("Timeline of important events") starts out 450+ pixels down the page, below headers and other page chrome, but when it
IF id exists, hide other id's
looking for a bit of help here...I seem to be running in circles right now. I am trying to write a script that will search the page for a certain ID...if said ID exists, then I want to hide a few other IDs. this is what I have so far. <script type="text/javascript"> $(document).ready(function(){ if($("#articleGatingWrapper")) { $("#lxTdivRating").hide(); $("#commentWrapper").hide(); $(".bottomArticleTools").hide(); $("p.addComment").hide();
jQuery 1.4.1 in Google CDN
Hi jQuery Team Do you guys know how long is going to take jQeury 1.4.1 to be published in Google CDN? I can not access: http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js Thanks // Bractus
Want to highlight rows in a tabular report by click, shift (or ctrl), click then process those rows highlighted.
Hi, My users are wanting to highlight rows in a tabular report by click, shift (or ctrl), click - as most applications can do - and then process those rows highlighted by selecting the button. Is there any existing UI modules created? Thank you, Bill
Nested param serialization
Hi Folks, I'm experienceing some problems with jQuery 1.4(.1) with the "new" ajax param serialization. My code does basically this: var ajaxparams = { id: sid, rm: rm || 'show_table', somenode: "some data" }; var filter_obj = {enable_col_filter: []}; $('tr.listitems input:checkbox:checked').each(function(){ filter_obj.enable_col_filter.push($(this).val()); }); $.extend(ajaxparams,
Traversing or Selecting sets of tags with .wrap
I have a requirement where I need to use some jquery goodness to manipulate some mark up. Take a look at the following markup: <body> <div id="videos"> <span>Video 1</span> <span>Video 2</span> <span>Video 3</span> <span>Video 4</span> <span>Video 5</span> <span>Video 6</span> <span>Video 7</span> <span>Video 8</span> </div>The desired outcome would be to wrap a new div around every 4 sets of divs. Take a look below. <div id="videos"> <div class="videoset"> <span>Video 1</span> <span>Video 2</span>
Radio Button checked not working in IE8
I'm trying to reset a form so that no radio buttons are selected. The code works in Firefox 3.5.7, Chrome 3, and Safari 4.0.3. However, in IE 8 only the 1st radio button is correctly cleared. If I check the 2nd radio button and click the clear button, the 2nd radio button IS NOT cleared. The following HTML should reproduce the issue. Can others reproduce this? Any solutions? Thanks! --------------------- <HTML> <HEAD> <script type="text/javascript" src="/scripts/jquery-1.4.1.js"></script>
Populate select form field via jquery
I have a form where a user may select a box from above which will query the database and autofill in the fields. This works properly for all of my input text fields but I have a select box where a user selects their state that I am unable to get to properly populate. The select box is populated on page load in the following format.... <select id="state" name="state"> <option value="1">ALABAMA</option> <option value="2">ALASKA</option> </select> etc... The jquery code I utilize to populate my form
[jQuery] Hide / Show problems with IE
Hello, I am trying to use the show/hide jquery function to show and hide book descriptions by clicking on the name of the book. It seems that the script works OK in firefox but not at all in IE. (In IE the descriptions are hidden and won't show) For example, http://squarehedge.com/bastianbooks/?cat=4 I have Jquery installed as party of a jquery lightbox plugin. Here is my script: <script type='text/javascript'> $(document).ready(function() { $('div.demo-show> div').hide(); $('div.demo-show> a9').click(function()
$.ajax textStatus always == "success"
Hi All - I've got this: $.ajax({ url: "URLHERE", complete: function(a, b){ alert(a.status); alert(b); } });Problem is Firebug shows my request for the same URL as '304 Not Modified', but the ajax call is always '200 Success'. Can anyone give me any reasons as to why I wouldn't be getting 'notmodified' back for textStatus? Thanks!
jQuery ajax: How to display partial server content.
I have a webpage which handle a time-consuming backend processing on the server side. I am hoping to use ajax and display the back-end processing process on the web-front(i.e. in a DIV). .ajaxStart and .ajaxStop sound to be OK if I want to display some fixed content. Is it possible that I grab partial server-side resultset and update a DIV at the front-end without having to wait for the server-side to finish all of the processing. many thanks, Hao Below is my sample code which does NOT work for my
Is there a faster way to get and move items in array?
I have 2 arrays of objects. Now that object has Id property. Now if I have 3 array of just Ids, what is the better and faster way of finding objects from array1 and move them to array2. Thanks a lot for answering.. Sample code: Person = function(id, fn, ln) { this.id = id, this.firstName = fn, this.lastName = ln } array1 = new Array(); // add 500 new Person objects to this array array2 = new Array(); // add some other new Person objects to this array function moveArrayItems(ids)
jQuery XML AJAX looping through nested XML document and updating page elements dynamically with XML data
I have created two onClick events that i need to combine into one with jQuery. I am not sure how to do this. I have an unordered list: <ul id="coverTabs"> <li class="currentTab"><a href="#">Individual</a></li> <li><a href="#">Couple</a></li> <li><a href="#">Family</a></li> <li><a href="#">Single parent family</a></li> </ul> So the active tab is set in the HTML to Individual by default. The following jQuery sets the active depending on which one is clicked. $('ul#coverTabs > li').live('click',
Opera losing CSS after $(document).ready
I am having a problem with jQuery and Opera. I have a CSS which sets a div to be display:hidden for the benefit of users without JavaScript. I then use a $(document).ready and $('#div').show(); to make the div visible as soon as possible for users with JavaScript. The problem I have is that under rare conditions in Opera when reloading everything (forcing it to ignore files in cache) it will run the show() in .ready before applying the CSS to make the div hidden. I am testing extensively in Opera
jQuery Animate with a percentage placed Div
I have divs on a page that are placed in the center with something like width:100px;height:100px;position:fixed;top:50%;left:50%;margin:-50px, 0, 0, -50px; I want to animate this div to the bottom left (similar to minimizing effect on windows) I am trying to use .animate({ opacity: 0.25, left: '10px', bottom: '10px'; height: 'toggle' }, 5000);However when I activate this it simply jumps (or glitches) to that position, the opacity and height animate perfectly. Is there a way to make
Resizable on a new added class
I have an element that when is clicked receives a new class - foo . I've made a .resizable function on that element but it does not work: $(".foo").resizable({ aspectRatio: 1/1, autoHide: true If ad in html a <span id="foo">some text</span> that does not dinamically gets a "foo" class it works fine. How should I use .resizable for newly created DOM elements? Thanx.
IE7 problem fileupload loosing focus
Hi, i m looking for an other solution. I have a little script, which uploads a file after i select it. It works fine. There was a problem with the ie7 which looses the focus. As you see in the small javascript i have a function called fixFocus, which is called onchange. I tried to make it all with jquery without using the onchange function, but i failed. How must i change the first script, to get it work without using the onchange function in the html? I use jquery 1.4 Thanks! Frank $(document).ready(function()
Animating opacity doesn't work in Internet Explorer
I'm experimenting with jQuery plugins. I have this code to fade in a "lightbox": $('#cleverbox') .css({ opacity:0, visibility:'visible' }) .animate( {opacity:1}, 2000 ); It works fine on Firefox and Chrome, but in IE (7 and 8) and Opera the element just appears rather than being faded in. I've seen a few solutions posted online but have yet to find a solution that works. I have an example page if that helps. I'm also having a few other problems: In Internet Explorer (7 and 8), the first thumbnail
Sending 2 arrays with ajax
Hi, I'm trying to send two arrays to an asp.net mvc method using ajax. The two arrays come from the values of two lists of checkboxes. The problem I'm having is that I don't know how to send them both at the same time. Here is my code at the moment: $("#sendAjaxButton").click(function() { var array1 = $(".checkBoxList1:checked").map(function() { return this.valueOf() }); var array2 = $(".checkBoxList2:checked").map(function() { return this.valueOf() }); var d = {first: array1, second:array2};
Problem with thickbox and ckeditor
Hello all, The new version of FCKeditor is CKEditor. I want to use this on my cms but it wont work for some reason. First an explanation how my cms works. I have a page, pages.php via AJAX(JQuery) will a table with all the pages be loaded when page is ready. I got a Add button above the table and a edit button for each page. When i click Add, a thickbox will be loaded and via AJAX will the addpage.php page called. There will be set the variables and include PageForm.tpl. This is the form for
How to resize elements to full fit parent elements (table cells) using jQuery?
I want to resize first children of an element to make this element to full fit parent element (table cell). The problem... my elements are growing exponentially with table cell $('.control').each(function(index) { var maxWidth = $(this).width() - ($(this).outerWidth(true) - $(this).width()); var firstElement = $(this).children(':first'); var firstElementInput = firstElement.children(':first'); var seccondElement = $(this).children(':nth-child(2)'); var seccondElementWidth = seccondElement.outerWidth(true);
Creative Use of the JQuery Selector. Why can this even work ?
Hi, On our current project we had an very unexpierenced coworker which wroted an "a" tag as an jquery selector. to better understand what he did see the following working sample: <html> <head> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> </head> <body> <script language="javascript"> alert($('<a href="#foobar" id="foobar" rel="relfoo">').attr('id')); </script> </body> </html> This works in Firefox but not in IE (of course not :-) .
ajax load results display error in IE8
We're using jQuery ajax quite a bit without issue. Today, however, we ran into an issue where the results of a query are not displayed. fyi... the following works fine in firefox. scenario: 1. load ajax "$("#location").load( url... )" used to retrieve results 2. using fiddler, we can see the results are returned as expected 3. results not displayed. look at the updated dom in IE8 with dev tools and the results are not put into the display area Additional info... a. using $("#location").load( url,
in jQuery 1.4, $(html) fails to run scripts if html length > 511
In jQuery 1.4, if an html string (local or obtained through $.get()) contains scripts, and the length of the string is > 511, then the scripts do not fire when the html is appended to the DOM. Confirmed this on webkit engines on Safari 4.0.4, Chrome 3.0 and iPhone OS 3.1.2. Works fine on FF 3.6. Works fine with jQuery 1.3.2. I suspect some of the optimization to be the culprit. This is specially troublesome for ajax content that has *mixed* script and html. Is there a suggested alternative?
accessing methods and properties on an object of a passed element
I hope i can explain what i need better than the subject. I have an object on the document element that allows for other components to register with it, i have a custom event something along $(document).bind("register",function(thechild)..... So in the child object when they are created i call $(document).trigger("register",this); And indeed i get the DOM object. However i'm looking for the plug in object, i want to be able to call methods on the passed childobject and access it's Config. Does that
second click event
What would be the syntax to say: do xyz after this button is clicked for the SECOND time and everytime after that?
Exposing jQuery Code, is this secure?
I write the script right on the page. viewer can read my jQuery code (javascript problem). Is there a solution provided by jQuery? or it is okay to be exposed?
Two functions
I'm working on an animated menu: two rows of tabs scrolling on mouse over, as they might be wider than their container. I want the upper tab to load the content of the lower one without refreshing the browsers window. I have a following structure: one div for the upper row containing one ul (this works fine), another div for the lower row, empty when the page loads, and another hidden div containing multiple divs (each with one ul) to be loaded by one of my functions. One of my functions should clone
JQuery Ajax call
hi i tried to use a simple AJAX call using jquery. my code is: $.ajax ({ type: "GET", url: "MyMaster.Master/GeString", contentType: "application/json; charset=utf-8", data: "{}", dataType: "json", success: AjaxSucceeded, error: AjaxFailed }); and the code behind is: [WebMethod] public static string GetString() { return "hi"; }the call fails with the following error: 401 unauthorized. this code works perfectly with just a new test site. i try to include this code in a existing site. what could
disable button and swap out image
does anyone know how to disable a button on page load (not an actual submit button -- an image that's hyperlinked) and then enable it and swap out the image once the "next" button is clicked? thanks!
Next Page