[jQuery] Re: Simple Reference Question
$(Mobj).eq(0).append('test'); IIRC Nicola On Sun, Sep 21, 2008 at 3:00 PM, BillCompton <[EMAIL PROTECTED]> wrote: > > var Mtemp = $(Mobj)[0] > $(Mtemp).append('test') > > How would I do this on one line? I want to append to only the first > element of the wrapped set? > > Thanks, > > George >
[jQuery] Re: Question about variable declaration
$('.left_selected') returns always true, because if there's not a matching element, $('.left_selected') is an array (not null) with length = 0. hth, Nicola On Tue, Aug 19, 2008 at 10:34 AM, andrea varnier <[EMAIL PROTECTED]> wrote: > > Hi :) > in your plugins (I'm studying from the best here :))) I often find > variable assignments like this: > >options = $.extend({ >url: this.attr('action') || window.location.toString(), >type: this.attr('method') || 'GET' >}, options || {}); > > it's like url = this OR that. right? > then I try, for example: > >var $sel = $('.left_selected') || $('.right_selected'); > > meaning $sel = $('.left_selected') but if you don't find any element > with that class, $sel = $('.right_selected'). > but this WON'T work :| > where is my mistake? at first I thought those declarations were just a > matter of true or false, but the example I reported above (taken from > alsup's form plugin) is clearly something more interesting! > can anyone help me please? > thank you > andrea >
[jQuery] Re: How to check if the browser supports iframes?
Try something like: function test(){ var ghh = document.createElement("iframe"); ghh.style.display = "none"; var frms = document.frames || window.frames; var len0 = frms.length; document.body.appendChild(ghh); var len1 = frms.length; var supported = (len0 != len1); window.alert("supported: " + supported); } hth, Nicola On Wed, Jul 9, 2008 at 8:04 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > I am wondering if it's possible to check if the browser supports > iframes. > I just want to check if iframe works (true/false) and if so stat some > function. > Can anyone help? >
[jQuery] Re: "Loading" splash widget blocking UI until everything is loaded
You can try this plugin: http://plugins.jquery.com/project/splashQ hth, Nicola On Thu, May 15, 2008 at 1:04 PM, Quinode <[EMAIL PROTECTED]> wrote: > > I have a page with a lot of jquery plugins, and a Google Map > When loading the page, it's heavy for the browser so it can take 4-5 > seconds before the page is loaded and ready > > Is there a simple solution to put a loading bar and hide the page, in > the blockUI plugin manner, until we are sure everuthing is loaded ? > > Dominique > www.quinode.Fr >
[jQuery] Re: processing json object
ops! for(var i = 0; i < records.length; i++){... On Tue, May 6, 2008 at 5:16 AM, JP <[EMAIL PROTECTED]> wrote: > > thanks ! > > I only had to add: > ... i < records.length; ... > > > On May 4, 2:14 pm, "Nicola Rizzo" <[EMAIL PROTECTED]> wrote: > > success: function(json, status){ > > var records = json.Records; > > var str = ""; > > if(records){ > > for(var i = 0; i < records; records++){ > > for(var j in records[i]){ > > str += j + " --> " + records[i][j] + "\n"; > > } > > } > > window.alert(str); > > } > > > > } > > > > hth, > > Nicola > > > > > > On Sun, May 4, 2008 at 8:02 PM, JP <[EMAIL PROTECTED]> wrote: > > > > > how can I process values from json object without having to use > > > indivual reference names? > > > > > using json: > > > > > ( {"Records": [ {"firstname":"Nancy","lastname":"Davolio"} ], > > > "RecordCount":"1" } ) > > > > > instead of : > > > > > $.ajax({ .. > > > > > success: function(json, status) { > > > if(json.Records){alert("Records="+json.Records[0].firstname );} > > > ... > > > > > is there a way to numerically reference values --something like : > > > > > $.ajax({ .. > > > > > success: function(json, status) { > > > if(json.Records){alert("Records="+json.Records[0].0);} > > > ... > > > > > only it should work :) > > > > > thanks in advance >
[jQuery] Re: processing json object
success: function(json, status){ var records = json.Records; var str = ""; if(records){ for(var i = 0; i < records; records++){ for(var j in records[i]){ str += j + " --> " + records[i][j] + "\n"; } } window.alert(str); } } hth, Nicola On Sun, May 4, 2008 at 8:02 PM, JP <[EMAIL PROTECTED]> wrote: > > how can I process values from json object without having to use > indivual reference names? > > using json: > > ( {"Records": [ {"firstname":"Nancy","lastname":"Davolio"} ], > "RecordCount":"1" } ) > > instead of : > > $.ajax({ .. > > success: function(json, status) { > if(json.Records){alert("Records="+json.Records[0].firstname );} > ... > > is there a way to numerically reference values --something like : > > $.ajax({ .. > > success: function(json, status) { > if(json.Records){alert("Records="+json.Records[0].0);} > ... > > only it should work :) > > thanks in advance >