[jQuery] Re: Debug says I'm missing a paren, but all parens are matched!

2009-10-09 Thread Giovanni Battista Lenoci


hsfrey ha scritto:

function togl(b1) {
var t1 = document.getElementById(b1).getElementsByTagName(input);
var labl = t1[0].value;
t1[0].value = labl==Hide?Show:Hide;
...
}

   In addition, rather than just Match the ID, I want to match the ID
which ENDS in the string contained in b1.
A simple #+b1 won't do that, which is why I used [[id$=+b1=].

The target of the JS is the html:
div id=box1 ...
input type=button value=Hide onclick=togl('box1')/
...
/div
  
If I understood, in your markup the button will have an id like 
something_box1, right?


If you can change your markup, i suggest to you to group elements using 
a class. by the way your first code:


$(([id$=+b1+]) input).attr(value, attr(value)==Hide?Show:Hide);

should be

$([id$=+b1+] input).val($(this).val()==Hide?Show:Hide);

Bye

(i've not tested the code, but I think is right :P)


--
gianiaz.net - web solutions
via piedo, 58 - 23020 tresivio (so) - italy
+39 347 7196482 



[jQuery] Re: My code is not working for rollover

2009-10-09 Thread Jonathan Vanherpe (T T NV)


use css rollovers instead

jessie wrote:


Hi

I had it all working and now its not :(

My problem now lies with the hovering over my 2 classes
ie. .LPButton,.CatMoreBtn  its just not hovering! and i'd like to
make this work for me so i can have not only png's rollover but, gifs
and jpgs but i have no clue where to put the additional code.

Any help would be much much appreciated.

This is what i have for jquery so far.


jQuery(function($) {

function getLeaf(url) {
var splited=url.split('?');// remove all the parameter from url
url=splited[0];
return url.substring(url.lastIndexOf(/)+1);// return file name
without domain and path

}

jQuery.fn.extend({
  enter: function() {//plugins creation
  return this.each(function() {
var pth = $(this).find(img)[0];
   //alert($(this).children().attr(href));
if($(this).children().attr(href)==getLeaf
(document.location.href)){// check that the link url and document url
is same
$(pth).attr(src,pth.src.replace(/.png/g, '_active.png'));
} else{
$(this).hover(function(){
   $(pth).attr(src,pth.src.replace(/.png/g,
'_active.png'));// mouse over Image
   },function(){
   $(pth).attr(src,pth.src.replace(/_active.png/
g, '.png'));// mouse out image
   });
}
});
  }
});

$(function(){  // Document is ready

  $(.LPButton,.CatMoreBtn).enter();// call the function

});

$('input[type=image]').hover(
function () { $(this).attr(src, $(this).attr(src).split('-
off').join('-on')); },
function () { $(this).attr(src, $(this).attr(src).split('-
on').join('-off')); }
);

});

jQuery(function($) {
 $(document).pngFix();
 });

Jess




--
Jonathan Vanherpe - Tallieu  Tallieu NV - jonat...@tnt.be


[jQuery] How to union plugins in 1 file

2009-10-09 Thread furionn

Hello all.

How to union all plugins in 1 file ? Simple copy-paste do not work.


[jQuery] Re: editinplace plugin - change bakground color of loading div

2009-10-09 Thread mattastic

bump

On Oct 8, 1:20 pm, mattastic mharris...@yahoo.co.uk wrote:
 Could someone please tell me how I can reference the loading div to
 change the background color?

 Many thanks


[jQuery] Re: editinplace plugin - change bakground color of loading div

2009-10-09 Thread Mika Tuupola



On Oct 8, 2009, at 3:20 PM, mattastic wrote:


Could someone please tell me how I can reference the loading div to
change the background color?


Which in place edit plugin do you mean and what you exactly are trying  
to do?



--
Mika Tuupola
http://www.appelsiini.net/



[jQuery] Cycle Plugin not working in IE - who can help?

2009-10-09 Thread First Impression

Hi,

I am currently developing a site for a client which uses the JQuery
cycle plugin to move through a number of divs which contain pictures
and info about wedding dresses.

All works fine in Firefox, but when I test in IE6 + IE7 the divs are
all stacked on top of each other vertically and they soan right down
the screen for 1000's of pixels.

To me it seems like this is a problem with absolute/relative
positioning or the z-index, I have also used a few floats in the child
divs.
I am also using SIFR for text replacement, could this be conflicting?

Here is my code, can anyone see a problem that would cause my cycle
not to work in IE.?

--
XHTML
--
code

!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN http://
www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd
html xmlns=http://www.w3.org/1999/xhtml; xml:lang=en lang=en
head
meta http-equiv=content-type content=text/html; charset=utf-8 /
titleWedding Dresses ~ Cavendish Bridal House/title
link rel=stylesheet type=text/css media=all href=css/
reset.css /
link rel=stylesheet type=text/css media=all href=css/
text.css /
link rel=stylesheet type=text/css media=all href=css/960.css /

link rel=stylesheet type=text/css media=all href=css/
styles.css /
link rel=shortcut icon href=img/favicon.ico type=image/x-icon /

link rel=stylesheet href=css/sifr.css type=text/css
media=screen /

!--[if lte IE 6]
link rel=stylesheet type=text/css media=screen href=css/
ie6.css /
![endif]--

!--[if lt IE 7]
 script src=http://ie7-js.googlecode.com/svn/version/2.0(beta3)/
IE7.js
 type=text/javascript
 /script

 /script
![endif]--

script src=js/sifr.js type=text/javascript/script
script src=js/sifr-config.js type=text/javascript/script
script src=js/jquery-1.3.2.min.js type=text/javascript/script
script src=js/jquery.cycle.all.min.js type=text/javascript/
script
script type=text/javascript
function initMenu() {
$('#menu ul').hide();
$('#menu ul#dressessub').show();
$('#menu li a').click(
function() {
var checkElement = $(this).next();
if((checkElement.is('ul'))  (checkElement.is(':visible'))) {
return false;
}
   if((checkElement.is('ul'))  (!checkElement.is(':visible'))) {
   $('#menu ul:visible').slideUp('normal');
   checkElement.slideDown('normal');
   return false;
   }
   }
   );
   }
   $(document).ready(function() {initMenu();});
/script

script type=text/javascript
$(document).ready(function() {
$('#wedding-dresses').cycle({
fx: 'fade',
speed:  'fast',
timeout: 0,
next:   '#next',
prev:   '#prev' ,
});
});
/script



/head

body id=wedding-dress

div id=page-outer
div class=container_12 id=page

div class=grid_12 id=header

 div id=logo
a href=index.html class=logo title=Cavendish Bridal
HouseCavendish Bridal House Hayfield/a/div!--end logo--

/div!--end header--
div id=content
div id=label
  ul id=menu
   lia href=index.html id=home
title=Home Home/a/li
   lia href=georgia.html id=georgia
title=GeorgiaGeorgia/a/li
   lia href=the-shop.html id=shop
title=The ShopThe Shop/a/li
   li class=headlinka href=# id=your-
dress  title=Your DressYour Dress/a
   ul
lia href=what-to-
expect.html title=What to expect id=expectWhat to expect/a/
li
lia href=ordering-your-
dress.html title=Ordering your dress id=ordering Ordering your
dress/a/li
lia href=alterations.html
title=Alterations id=alterations Alterations/a/li
lia href=collections.html
title=Collections id=collections Collections/a/li
   /ul
   /li

   li class=headlinka href=dresses.html
id=dresses  title=DressesDresses/a
   ul id=dresses-sub
lia href=wedding-dresses.html
id=wedding  title=Wedding DressesWedding Dresses/a/li
lia href=bridesmaid-dresses.html
id=bridesmaid title= Bridesmaid DressesBridesmaid Dresses/a/
li
lia href=prom-dresses.html
id=prom  title=Prom DressesProm Dresses/a/li
 /ul
   /li
  lia href=accessories.html
id=accessories title=AccessoriesAccessories/a/li
  lia href=mens-formal-hire.html
id=formal  title=mens Formal HireMens Formal Hire/a/li
  lia href=my-brides.html id=my-brides
title=My BridesMy Brides/a/li
  lia href=events.html id=events
title=EventsEvents/a/li
  lia href=contact.php id=contact
title=ContactContact/a/li
  lia href=press.html id=press
title=PressPress/a/li

[jQuery] Select all class not keyword_type_A, please help

2009-10-09 Thread Tan

Hello.
I have a list:
a href=# id=AA/a
div id=TB_ajaxContent
/div
li class=keyword_type_Ctag
/li
li class=keyword_type_Ttag
/li
li class=keyword_type_Ptag
/li
li class=keyword_type_Ltag
/li
li class=keyword_type_Ktag
/li
li class=keyword_type_Stag
/li
li class=keyword_type_Stag
/li
li class=keyword_type_Htag
/li
li class=keyword_type_Ttag
/li
li class=keyword_type_Ttag
/li
li class=keyword_type_Ttag
/li
li class=keyword_type_Atag
/li
li class=keyword_type_Ctag
/li
li class=keyword_type_Stag
/li
li class=keyword_type_Ktag
/li
li class=keyword_type_Gtag
/li
li class=keyword_type_Etag
/li
li class=keyword_type_Qtag
/li
li class=keyword_type_Rtag
/li
li class=keyword_type_Ttag
/li
li class=keyword_type_Btag
/li
li class=keyword_type_Stag
/li
li class=keyword_type_Ttag
/li
/div
I create a code jquery show only class=keyword_type_S
$(document).ready(function() {
$('#A').click(function() {
   $('.keyword_type_A').show();
 $('^li.keyword_type_A').hide();

 // $('div:not('.keyword_type_A')').hide();

  });
});
but it's not work. Please help.


[jQuery] Re: Superfish navbar alignment question

2009-10-09 Thread VijayW


In addition, I would like to have another option to have the sub menu
bar (navbar) centrally aligned under the main navbar.

something like:
:
subalign: [left (default) | center | right ]
:

On Oct 1, 8:03 am, Charlie charlie...@gmail.com wrote:
 you could do that with out usingnavbaroption, set sub li's inline and remove 
 sub ul width, not tested but should be fairly straightforward
 Vali wrote:Hello, Actually I will repeat a message sent by some other user, 
 message which seems to have been completely ignored. I believe this is a good 
 question, I am also very interested in its answer (otherwise unfortunately I 
 will have to look to some othernavbarsystem). So, is it possible to align the 
 dropped down nav to the corresponding parent like it does in the basic mode? 
 Right now the dropped down nav stays aligned to the left for each 'current' 
 list. I think a config option could be made available for that purpose. 
 Regards, Vali


[jQuery] Re: My code is not working for rollover

2009-10-09 Thread jessie

I would if there were ways to keep my alt text so users can browse
with iimages off.

But there is no work around so i have opted to use jquery.

So is there a way to make this work using jquery?

Thanks
Jess

On Oct 9, 5:15 pm, Jonathan Vanherpe (T  T NV) jonat...@tnt.be
wrote:
 use css rollovers instead



 jessie wrote:

  Hi

  I had it all working and now its not :(

  My problem now lies with the hovering over my 2 classes
  ie. .LPButton,.CatMoreBtn  its just not hovering! and i'd like to
  make this work for me so i can have not only png's rollover but, gifs
  and jpgs but i have no clue where to put the additional code.

  Any help would be much much appreciated.

  This is what i have for jquery so far.

  jQuery(function($) {

  function getLeaf(url) {
  var splited=url.split('?');// remove all the parameter from url
  url=splited[0];
  return url.substring(url.lastIndexOf(/)+1);// return file name
  without domain and path

  }

  jQuery.fn.extend({
    enter: function() {//plugins creation
        return this.each(function() {
          var pth = $(this).find(img)[0];
         //alert($(this).children().attr(href));
          if($(this).children().attr(href)==getLeaf
  (document.location.href)){// check that the link url and document url
  is same
              $(pth).attr(src,pth.src.replace(/.png/g, '_active.png'));
          } else{
                  $(this).hover(function(){
                     $(pth).attr(src,pth.src.replace(/.png/g,
  '_active.png'));// mouse over Image
                     },function(){
                         $(pth).attr(src,pth.src.replace(/_active.png/
  g, '.png'));// mouse out image
                         });
                  }
                  });
        }
  });

  $(function(){  // Document is ready

    $(.LPButton,.CatMoreBtn).enter();// call the function

  });

     $('input[type=image]').hover(
             function () { $(this).attr(src, $(this).attr(src).split('-
  off').join('-on')); },
             function () { $(this).attr(src, $(this).attr(src).split('-
  on').join('-off')); }
     );

  });

  jQuery(function($) {
           $(document).pngFix();
       });

  Jess

 --
 Jonathan Vanherpe - Tallieu  Tallieu NV - jonat...@tnt.be


[jQuery] Re: My code is not working for rollover

2009-10-09 Thread waseem sabjee
lets start of simple - and make sure everything works on the simplest
example before adding the complicated code.1. i suggest keeping all your
classes lowerscase ( just my opinion )

$(.lpbutton).hover(function() {
 alert(onMouseOver);
}, function() {
alert(onMouseOut);
});

this should be working.

now lets looking at our image path\i suggest you ensure your path is always
going from your site root.
example
/images/myimg.jpg
notice the / at the start

so lets look at something with more code

var images = [];
images.push(/images/1.jpg);
images.push(/images/2.jpg);
var buttons = [];
buttons.push($(.lpbutton));

buttons[0].hover(function() {
buttons[0].attr({
src:images[0]
});
}, function() {
buttons[0].attr({
src:images[1]
});
});

also sometimes when i use attr() it doesnt work
so i use
attr({

});
instead :)

did this achieve what you requested ?

On Fri, Oct 9, 2009 at 11:03 AM, jessie mi...@optusnet.com.au wrote:


 I would if there were ways to keep my alt text so users can browse
 with iimages off.

 But there is no work around so i have opted to use jquery.

 So is there a way to make this work using jquery?

 Thanks
 Jess

 On Oct 9, 5:15 pm, Jonathan Vanherpe (T  T NV) jonat...@tnt.be
 wrote:
  use css rollovers instead
 
 
 
  jessie wrote:
 
   Hi
 
   I had it all working and now its not :(
 
   My problem now lies with the hovering over my 2 classes
   ie. .LPButton,.CatMoreBtn  its just not hovering! and i'd like to
   make this work for me so i can have not only png's rollover but, gifs
   and jpgs but i have no clue where to put the additional code.
 
   Any help would be much much appreciated.
 
   This is what i have for jquery so far.
 
   jQuery(function($) {
 
   function getLeaf(url) {
   var splited=url.split('?');// remove all the parameter from url
   url=splited[0];
   return url.substring(url.lastIndexOf(/)+1);// return file name
   without domain and path
 
   }
 
   jQuery.fn.extend({
 enter: function() {//plugins creation
 return this.each(function() {
   var pth = $(this).find(img)[0];
  //alert($(this).children().attr(href));
   if($(this).children().attr(href)==getLeaf
   (document.location.href)){// check that the link url and document url
   is same
   $(pth).attr(src,pth.src.replace(/.png/g, '_active.png'));
   } else{
   $(this).hover(function(){
  $(pth).attr(src,pth.src.replace(/.png/g,
   '_active.png'));// mouse over Image
  },function(){
  $(pth).attr(src,pth.src.replace(/_active.png/
   g, '.png'));// mouse out image
  });
   }
   });
 }
   });
 
   $(function(){  // Document is ready
 
 $(.LPButton,.CatMoreBtn).enter();// call the function
 
   });
 
  $('input[type=image]').hover(
  function () { $(this).attr(src,
 $(this).attr(src).split('-
   off').join('-on')); },
  function () { $(this).attr(src,
 $(this).attr(src).split('-
   on').join('-off')); }
  );
 
   });
 
   jQuery(function($) {
$(document).pngFix();
});
 
   Jess
 
  --
  Jonathan Vanherpe - Tallieu  Tallieu NV - jonat...@tnt.be


[jQuery] Re: Select all class not keyword_type_A, please help

2009-10-09 Thread Charlie Griefer
First off, I'd add a ul around those li elements.

If you do that, and give it an id attribute of 'myList', you can do the
following:

// hide all list items
$('#myList li').hide();
// show only class keyword_type_S
$('.#myList .keyword_type_S').show();

You can certainly do the same thing without the ul, but it's not
semantically correct, and it'll be a little more efficient to search within
a ul with a specified id than to search the entire document for a specific
class name.

On Fri, Oct 9, 2009 at 1:49 AM, Tan it_qn2...@yahoo.com wrote:


 Hello.
 I have a list:
 a href=# id=AA/a
 div id=TB_ajaxContent
 /div
 li class=keyword_type_Ctag
 /li
 li class=keyword_type_Ttag
 /li
 li class=keyword_type_Ptag
 /li
 li class=keyword_type_Ltag
 /li
 li class=keyword_type_Ktag
 /li
 li class=keyword_type_Stag
 /li
 li class=keyword_type_Stag
 /li
 li class=keyword_type_Htag
 /li
 li class=keyword_type_Ttag
 /li
 li class=keyword_type_Ttag
 /li
 li class=keyword_type_Ttag
 /li
 li class=keyword_type_Atag
 /li
 li class=keyword_type_Ctag
 /li
 li class=keyword_type_Stag
 /li
 li class=keyword_type_Ktag
 /li
 li class=keyword_type_Gtag
 /li
 li class=keyword_type_Etag
 /li
 li class=keyword_type_Qtag
 /li
 li class=keyword_type_Rtag
 /li
 li class=keyword_type_Ttag
 /li
 li class=keyword_type_Btag
 /li
 li class=keyword_type_Stag
 /li
 li class=keyword_type_Ttag
 /li
 /div
 I create a code jquery show only class=keyword_type_S
 $(document).ready(function() {
 $('#A').click(function() {
   $('.keyword_type_A').show();
  $('^li.keyword_type_A').hide();

  // $('div:not('.keyword_type_A')').hide();

  });
 });
 but it's not work. Please help.




-- 
Charlie Griefer
http://charlie.griefer.com/

I have failed as much as I have succeeded. But I love my life. I love my
wife. And I wish you my kind of success.


[jQuery] Re: My code is not working for rollover

2009-10-09 Thread Jonathan Vanherpe (T T NV)


This method seems to work with images off while still keeping 
replacement text (with only minimal extra markup):

http://ryanroberts.co.uk/_dev/experiments/accessible-rollovers/index.html

Jonathan

jessie wrote:


I would if there were ways to keep my alt text so users can browse
with iimages off.

But there is no work around so i have opted to use jquery.

So is there a way to make this work using jquery?

Thanks
Jess

On Oct 9, 5:15 pm, Jonathan Vanherpe (T  T NV)jonat...@tnt.be
wrote:

use css rollovers instead



jessie wrote:


Hi



I had it all working and now its not :(



My problem now lies with the hovering over my 2 classes
ie. .LPButton,.CatMoreBtnits just not hovering! and i'd like to
make this work for me so i can have not only png's rollover but, gifs
and jpgs but i have no clue where to put the additional code.



Any help would be much much appreciated.



This is what i have for jquery so far.



jQuery(function($) {



function getLeaf(url) {
var splited=url.split('?');// remove all the parameter from url
url=splited[0];
return url.substring(url.lastIndexOf(/)+1);// return file name
without domain and path



}



jQuery.fn.extend({
   enter: function() {//plugins creation
   return this.each(function() {
 var pth = $(this).find(img)[0];
//alert($(this).children().attr(href));
 if($(this).children().attr(href)==getLeaf
(document.location.href)){// check that the link url and document url
is same
 $(pth).attr(src,pth.src.replace(/.png/g, '_active.png'));
 } else{
 $(this).hover(function(){
$(pth).attr(src,pth.src.replace(/.png/g,
'_active.png'));// mouse over Image
},function(){
$(pth).attr(src,pth.src.replace(/_active.png/
g, '.png'));// mouse out image
});
 }
 });
   }
});



$(function(){  // Document is ready



   $(.LPButton,.CatMoreBtn).enter();// call the function



});



$('input[type=image]').hover(
function () { $(this).attr(src, $(this).attr(src).split('-
off').join('-on')); },
function () { $(this).attr(src, $(this).attr(src).split('-
on').join('-off')); }
);



});



jQuery(function($) {
  $(document).pngFix();
  });



Jess


--
Jonathan Vanherpe - Tallieu  Tallieu NV - jonat...@tnt.be





--
Jonathan Vanherpe - Tallieu  Tallieu NV - jonat...@tnt.be


[jQuery] Re: how to get next div with class of clear

2009-10-09 Thread webdesignamite

thanks so much karl. that worked first time.

On Oct 8, 8:41 pm, Karl Swedberg k...@englishrules.com wrote:
 On Oct 8, 2009, at 8:48 AM, webdesignamite wrote:

  SO, WHAT IM TRYING TO FIGURE OUT IS HOW DO I REFERENCE THE NEXT
  ELEMENT WITH CLASS OF .CLEAR FROM MY PARENT ELEMENT -

  this gives me the id of the next element with respect to parent (for
  trial and error purposes, ive given all of my .cleared class divs an
  id, ids will be removed)

  var parentId=dynamic;
  $(#+parentId).next().get(0).id

  so i thought i would need something along the lines of this but it
  doesnt work -

  var parentId=dynamic;
  $(#+parentId).next(.clear).get(0).id

 You're using .next(), but that assumes that the .clear div is the very  
 next sibling of the parent element. From your description of what  
 you're doing, though, it isn't clear that .clear is a sibling. If it  
 is, and if it comes after $(#+parentId), then you can  
 use .nextAll('.clear') instead of .next(.'clear') . If it isn't, maybe  
 you could paste a snippet of your html so that we can see the  
 relationship between the elements?

 --Karl

 
 Karl Swedbergwww.englishrules.comwww.learningjquery.com


[jQuery] Re: How to parse a json object?

2009-10-09 Thread Chippo

Hi Thai

you could try something like this I think...
var obj = {'title':'mytitle','etc':'etc'};
for(var a in obj){
  // a would be the key ie 'title'
  // obj[a] would get the value ie 'mytitle'
}
I think that will work I havent tried it myself though.


On Oct 9, 5:38 am, Thai Dang Vu tdan...@gmail.com wrote:
 Let me rephrase my problem.

 $.post('a.htm', $('#formId').serialize(), function(data) {
     // data is a json string
     // I don't know anything about the keys used in that json string, i.e.
 that string can be
     // '{name: James, age: 27}' or can be '{title: jQuery, year:
 2009, month: 10}'
     var jsonObject = JSON.parse(data);  // JSON is 
 fromhttp://www.json.org/json2.js
     // because the keys are unknown, I cannot write something like
 jsonObject.name, jsonObject.title ...
     // if the Prototype library is used, I can do like this
     $H(jsonObject).each(function(item) {
         log.debug(item.key + ' ' + item.value);
     });

 });

 If the server returns '{name: James, age: 27}', that block of code
 should print out
 name James
 age 27
 If the server returns '{title: jQuery, year: 2009, month: 10}', that
 block of code should print
 title jQuery
 year 2009
 month 10

 Thanks for any help.

 On Thu, Oct 8, 2009 at 8:01 PM, Michael Geary m...@mg.to wrote:
  I assume that what you mean is you have the actual JavaScript *object*, not
  a JSON string that represents the object, right?

  If you had a JSON string, you could just look at the string to see its keys
  and values. Or you could paste it intowww.jsonlint.comto pretty-print
  it.

  If you have a JavaScript object, one easy way to view it is to load your
  page in Firefox with Firebug installed, and then add this line to your code:

  console.dir( yourObject );

  -Mike

  On Thu, Oct 8, 2009 at 11:20 AM, Thai Dang Vu tdan...@gmail.com wrote:

  Hi everybody,

  Supposed that I have a json object but I don't know anything about its
  keys and values. Is there anyway to print out all the key and value pairs 
  in
  that object?

  Thanks.


[jQuery] Re: My code is not working for rollover

2009-10-09 Thread waseem sabjee
i think the OP wants to keep alt and title tags

On Fri, Oct 9, 2009 at 11:50 AM, Jonathan Vanherpe (T  T NV) 
jonat...@tnt.be wrote:


 This method seems to work with images off while still keeping replacement
 text (with only minimal extra markup):
 http://ryanroberts.co.uk/_dev/experiments/accessible-rollovers/index.html

 Jonathan


 jessie wrote:


 I would if there were ways to keep my alt text so users can browse
 with iimages off.

 But there is no work around so i have opted to use jquery.

 So is there a way to make this work using jquery?

 Thanks
 Jess

 On Oct 9, 5:15 pm, Jonathan Vanherpe (T  T NV)jonat...@tnt.be
 wrote:

 use css rollovers instead



 jessie wrote:

  Hi


  I had it all working and now its not :(


  My problem now lies with the hovering over my 2 classes
 ie. .LPButton,.CatMoreBtnits just not hovering! and i'd like to
 make this work for me so i can have not only png's rollover but, gifs
 and jpgs but i have no clue where to put the additional code.


  Any help would be much much appreciated.


  This is what i have for jquery so far.


  jQuery(function($) {


  function getLeaf(url) {
 var splited=url.split('?');// remove all the parameter from url
 url=splited[0];
 return url.substring(url.lastIndexOf(/)+1);// return file name
 without domain and path


  }


  jQuery.fn.extend({
   enter: function() {//plugins creation
   return this.each(function() {
 var pth = $(this).find(img)[0];
//alert($(this).children().attr(href));
 if($(this).children().attr(href)==getLeaf
 (document.location.href)){// check that the link url and document url
 is same
 $(pth).attr(src,pth.src.replace(/.png/g, '_active.png'));
 } else{
 $(this).hover(function(){
$(pth).attr(src,pth.src.replace(/.png/g,
 '_active.png'));// mouse over Image
},function(){
$(pth).attr(src,pth.src.replace(/_active.png/
 g, '.png'));// mouse out image
});
 }
 });
   }
 });


  $(function(){  // Document is ready


$(.LPButton,.CatMoreBtn).enter();// call the function


  });


 $('input[type=image]').hover(
function () { $(this).attr(src,
 $(this).attr(src).split('-
 off').join('-on')); },
function () { $(this).attr(src,
 $(this).attr(src).split('-
 on').join('-off')); }
);


  });


  jQuery(function($) {
  $(document).pngFix();
  });


  Jess


 --
 Jonathan Vanherpe - Tallieu  Tallieu NV - jonat...@tnt.be




 --
 Jonathan Vanherpe - Tallieu  Tallieu NV - jonat...@tnt.be



[jQuery] Re: My code is not working for rollover

2009-10-09 Thread jessie

Thanks Guys, but yes i do want to keep my alt and title tags.

I've tried everything today... but i'm very new to jquery and don't
fully comprehend how to put things together.

I have used supersleight before for IE6 and it worked a charm except
now it doesn't work because i'm using jquery.

Anyways, i have tried implementing this script also but it just
doesn't work in IE6.

http://allinthehead.com/retro/338/supersleight-jquery-plugin

I think its conflicting with my other code for input type= image

Or it could be that i have set it up incorrectly this is what i
have in my markup to call the doc's.
script type=text/javascript src=http://ajax.googleapis.com/ajax/
libs/jquery/1.3.2/jquery.min.js/script
script type=text/javascript src=skins/{VAL_SKIN}/
supersleight.plugin.js/script
script type=text/javascript src=skins/{VAL_SKIN}/effects.js/
script
script type=text/javascript src=js/prototype.js/script
script type=text/javascript src=js/jslibrary.js/script
script type=text/javascript src=js/scriptaculous.js?
load=effects,builder/script
script type=text/javascript src=js/lightbox.js/script

I'm s lost and need to get these rollovers to work on all my
links. but also have png transparencies for ie6.

Any help would be so appreciated :)

Thansk
Jess


On Oct 9, 7:03 pm, jessie mi...@optusnet.com.au wrote:
 I would if there were ways to keep my alt text so users can browse
 with iimages off.

 But there is no work around so i have opted to use jquery.

 So is there a way to make this work using jquery?

 Thanks
 Jess

 On Oct 9, 5:15 pm, Jonathan Vanherpe (T  T NV) jonat...@tnt.be
 wrote:

  use css rollovers instead

  jessie wrote:

   Hi

   I had it all working and now its not :(

   My problem now lies with the hovering over my 2 classes
   ie. .LPButton,.CatMoreBtn  its just not hovering! and i'd like to
   make this work for me so i can have not only png's rollover but, gifs
   and jpgs but i have no clue where to put the additional code.

   Any help would be much much appreciated.

   This is what i have for jquery so far.

   jQuery(function($) {

   function getLeaf(url) {
   var splited=url.split('?');// remove all the parameter from url
   url=splited[0];
   return url.substring(url.lastIndexOf(/)+1);// return file name
   without domain and path

   }

   jQuery.fn.extend({
     enter: function() {//plugins creation
         return this.each(function() {
           var pth = $(this).find(img)[0];
          //alert($(this).children().attr(href));
           if($(this).children().attr(href)==getLeaf
   (document.location.href)){// check that the link url and document url
   is same
               $(pth).attr(src,pth.src.replace(/.png/g, '_active.png'));
           } else{
                   $(this).hover(function(){
                      $(pth).attr(src,pth.src.replace(/.png/g,
   '_active.png'));// mouse over Image
                      },function(){
                          $(pth).attr(src,pth.src.replace(/_active.png/
   g, '.png'));// mouse out image
                          });
                   }
                   });
         }
   });

   $(function(){  // Document is ready

     $(.LPButton,.CatMoreBtn).enter();// call the function

   });

      $('input[type=image]').hover(
              function () { $(this).attr(src, $(this).attr(src).split('-
   off').join('-on')); },
              function () { $(this).attr(src, $(this).attr(src).split('-
   on').join('-off')); }
      );

   });

   jQuery(function($) {
            $(document).pngFix();
        });

   Jess

  --
  Jonathan Vanherpe - Tallieu  Tallieu NV - jonat...@tnt.be


[jQuery] Re: My code is not working for rollover

2009-10-09 Thread waseem sabjee
ok try this
1. i suggest you download this script and run it locally
http://ajax.googleapis.com/ajaxlibs/jquery/1.3.2/jquery.min.jshttp://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js
2. if you try a simple alert through jquery does it work
put the following code in an external file and link it to your page
$(function() {
alert(it works);
});
if the alert does not work somethings wrong.

On Fri, Oct 9, 2009 at 12:09 PM, jessie mi...@optusnet.com.au wrote:


 Thanks Guys, but yes i do want to keep my alt and title tags.

 I've tried everything today... but i'm very new to jquery and don't
 fully comprehend how to put things together.

 I have used supersleight before for IE6 and it worked a charm except
 now it doesn't work because i'm using jquery.

 Anyways, i have tried implementing this script also but it just
 doesn't work in IE6.

 http://allinthehead.com/retro/338/supersleight-jquery-plugin

 I think its conflicting with my other code for input type= image

 Or it could be that i have set it up incorrectly this is what i
 have in my markup to call the doc's.
 script type=text/javascript src=http://ajax.googleapis.com/ajax/
 libs/jquery/1.3.2/jquery.min.js/script
 script type=text/javascript src=skins/{VAL_SKIN}/
 supersleight.plugin.js/script
 script type=text/javascript src=skins/{VAL_SKIN}/effects.js/
 script
 script type=text/javascript src=js/prototype.js/script
 script type=text/javascript src=js/jslibrary.js/script
 script type=text/javascript src=js/scriptaculous.js?
 load=effects,builder/script
 script type=text/javascript src=js/lightbox.js/script

 I'm s lost and need to get these rollovers to work on all my
 links. but also have png transparencies for ie6.

 Any help would be so appreciated :)

 Thansk
 Jess


 On Oct 9, 7:03 pm, jessie mi...@optusnet.com.au wrote:
  I would if there were ways to keep my alt text so users can browse
  with iimages off.
 
  But there is no work around so i have opted to use jquery.
 
  So is there a way to make this work using jquery?
 
  Thanks
  Jess
 
  On Oct 9, 5:15 pm, Jonathan Vanherpe (T  T NV) jonat...@tnt.be
  wrote:
 
   use css rollovers instead
 
   jessie wrote:
 
Hi
 
I had it all working and now its not :(
 
My problem now lies with the hovering over my 2 classes
ie. .LPButton,.CatMoreBtn  its just not hovering! and i'd like to
make this work for me so i can have not only png's rollover but, gifs
and jpgs but i have no clue where to put the additional code.
 
Any help would be much much appreciated.
 
This is what i have for jquery so far.
 
jQuery(function($) {
 
function getLeaf(url) {
var splited=url.split('?');// remove all the parameter from url
url=splited[0];
return url.substring(url.lastIndexOf(/)+1);// return file name
without domain and path
 
}
 
jQuery.fn.extend({
  enter: function() {//plugins creation
  return this.each(function() {
var pth = $(this).find(img)[0];
   //alert($(this).children().attr(href));
if($(this).children().attr(href)==getLeaf
(document.location.href)){// check that the link url and document url
is same
$(pth).attr(src,pth.src.replace(/.png/g,
 '_active.png'));
} else{
$(this).hover(function(){
   $(pth).attr(src,pth.src.replace(/.png/g,
'_active.png'));// mouse over Image
   },function(){
   
  $(pth).attr(src,pth.src.replace(/_active.png/
g, '.png'));// mouse out image
   });
}
});
  }
});
 
$(function(){  // Document is ready
 
  $(.LPButton,.CatMoreBtn).enter();// call the function
 
});
 
   $('input[type=image]').hover(
   function () { $(this).attr(src,
 $(this).attr(src).split('-
off').join('-on')); },
   function () { $(this).attr(src,
 $(this).attr(src).split('-
on').join('-off')); }
   );
 
});
 
jQuery(function($) {
 $(document).pngFix();
 });
 
Jess
 
   --
   Jonathan Vanherpe - Tallieu  Tallieu NV - jonat...@tnt.be



[jQuery] Validate: regex that returns true elsewhere returns false inside validator method

2009-10-09 Thread w1ntermut3

Either I'm having a really dim Friday, or something strange is going
on. I'm trying to add a method to the Validator plugin, using the
following regex:

/^[a-z0-9-.,()'%$£*\s]+$/

So I've added this into the additional methods JS file:

jQuery.validator.addMethod(lettersnumberandadvancedpunc, function
(value, element) {
console.log(value +  =  + /^[a-z0-9-.,()'%$£*\s]+$/i.test
(value));
return this.optional(element) || /^[a-z0-9-.,()'%$£*\s]+$/i.test
(value);
}, Letters and punctuation only please);

Which, given a test input of, say, My £2 hat, results in the
validation error being displayed and My £2 hat = false being written
to the console.

But... unless I'm missing something, that regex is fine and should
pass that string. Certainly in a test page that I created, it seems to
work:

$(document).ready(function(){
$('#btnTest').click(function(){
console.log($('#txtWTF').val() +  =  + 
/^[a-z0-9-.,()'%$£*\s]+$/
i.test($('#txtWTF').val()));
});
});

So what's going on? Why does my regex seem to be working elsewhere,
but not within the Validator plugin?


[jQuery] Re: My code is not working for rollover

2009-10-09 Thread jessie

Thanx Waseem

My original code is working fine now.  Except i'm having issues with
my pngs'

Thank-you for taking your time to explain that to me.

Jess

On Oct 9, 7:25 pm, waseem sabjee waseemsab...@gmail.com wrote:
 lets start of simple - and make sure everything works on the simplest
 example before adding the complicated code.1. i suggest keeping all your
 classes lowerscase ( just my opinion )

 $(.lpbutton).hover(function() {
  alert(onMouseOver);}, function() {

 alert(onMouseOut);

 });

 this should be working.

 now lets looking at our image path\i suggest you ensure your path is always
 going from your site root.
 example
 /images/myimg.jpg
 notice the / at the start

 so lets look at something with more code

 var images = [];
 images.push(/images/1.jpg);
 images.push(/images/2.jpg);
 var buttons = [];
 buttons.push($(.lpbutton));

 buttons[0].hover(function() {
 buttons[0].attr({
 src:images[0]});
 }, function() {

 buttons[0].attr({
 src:images[1]

 });
 });

 also sometimes when i use attr() it doesnt work
 so i use
 attr({

 });

 instead :)

 did this achieve what you requested ?

 On Fri, Oct 9, 2009 at 11:03 AM, jessie mi...@optusnet.com.au wrote:

  I would if there were ways to keep my alt text so users can browse
  with iimages off.

  But there is no work around so i have opted to use jquery.

  So is there a way to make this work using jquery?

  Thanks
  Jess

  On Oct 9, 5:15 pm, Jonathan Vanherpe (T  T NV) jonat...@tnt.be
  wrote:
   use css rollovers instead

   jessie wrote:

Hi

I had it all working and now its not :(

My problem now lies with the hovering over my 2 classes
ie. .LPButton,.CatMoreBtn  its just not hovering! and i'd like to
make this work for me so i can have not only png's rollover but, gifs
and jpgs but i have no clue where to put the additional code.

Any help would be much much appreciated.

This is what i have for jquery so far.

jQuery(function($) {

function getLeaf(url) {
var splited=url.split('?');// remove all the parameter from url
url=splited[0];
return url.substring(url.lastIndexOf(/)+1);// return file name
without domain and path

}

jQuery.fn.extend({
  enter: function() {//plugins creation
      return this.each(function() {
        var pth = $(this).find(img)[0];
       //alert($(this).children().attr(href));
        if($(this).children().attr(href)==getLeaf
(document.location.href)){// check that the link url and document url
is same
            $(pth).attr(src,pth.src.replace(/.png/g, '_active.png'));
        } else{
                $(this).hover(function(){
                   $(pth).attr(src,pth.src.replace(/.png/g,
'_active.png'));// mouse over Image
                   },function(){
                       $(pth).attr(src,pth.src.replace(/_active.png/
g, '.png'));// mouse out image
                       });
                }
                });
      }
});

$(function(){  // Document is ready

  $(.LPButton,.CatMoreBtn).enter();// call the function

});

   $('input[type=image]').hover(
           function () { $(this).attr(src,
  $(this).attr(src).split('-
off').join('-on')); },
           function () { $(this).attr(src,
  $(this).attr(src).split('-
on').join('-off')); }
   );

});

jQuery(function($) {
         $(document).pngFix();
     });

Jess

   --
   Jonathan Vanherpe - Tallieu  Tallieu NV - jonat...@tnt.be


[jQuery] Re: Validate: regex that returns true elsewhere returns false inside validator method

2009-10-09 Thread w1ntermut3

Ok, it was me. Well, it was the encoding issue as discussed in the
comments on http://bassistance.de/jquery-plugins/jquery-plugin-validation/

Updating code to:
script type=text/javascript src=/js/jquery.validate-additional-
methods.js charset=ISO-8859-1/script
fixed it.


[jQuery] Re: My code is not working for rollover

2009-10-09 Thread jessie

Waseem

Yes i've downloaded it and now working locally.

It all works fine, i have no idea why it wasn't working before.

Now the only problem is that i would like to have all my input buttons
and all other images within links that have png's to be transparent in
IE6.

I'm yet to find a workaround!

Also i noticed that in my rollovers for images, it says png is it
possible to also add jpg, and gif? or the code will only work for png
and that's it?

Thanks for your time once again.

Jess

On Oct 9, 8:27 pm, waseem sabjee waseemsab...@gmail.com wrote:
 ok try this
 1. i suggest you download this script and run it 
 locallyhttp://ajax.googleapis.com/ajaxlibs/jquery/1.3.2/jquery.min.jshttp://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js
 2. if you try a simple alert through jquery does it work
 put the following code in an external file and link it to your page
 $(function() {
 alert(it works);});

 if the alert does not work somethings wrong.

 On Fri, Oct 9, 2009 at 12:09 PM, jessie mi...@optusnet.com.au wrote:

  Thanks Guys, but yes i do want to keep my alt and title tags.

  I've tried everything today... but i'm very new to jquery and don't
  fully comprehend how to put things together.

  I have used supersleight before for IE6 and it worked a charm except
  now it doesn't work because i'm using jquery.

  Anyways, i have tried implementing this script also but it just
  doesn't work in IE6.

 http://allinthehead.com/retro/338/supersleight-jquery-plugin

  I think its conflicting with my other code for input type= image

  Or it could be that i have set it up incorrectly this is what i
  have in my markup to call the doc's.
  script type=text/javascript src=http://ajax.googleapis.com/ajax/
  libs/jquery/1.3.2/jquery.min.js/script
  script type=text/javascript src=skins/{VAL_SKIN}/
  supersleight.plugin.js/script
  script type=text/javascript src=skins/{VAL_SKIN}/effects.js/
  script
  script type=text/javascript src=js/prototype.js/script
  script type=text/javascript src=js/jslibrary.js/script
  script type=text/javascript src=js/scriptaculous.js?
  load=effects,builder/script
  script type=text/javascript src=js/lightbox.js/script

  I'm s lost and need to get these rollovers to work on all my
  links. but also have png transparencies for ie6.

  Any help would be so appreciated :)

  Thansk
  Jess

  On Oct 9, 7:03 pm, jessie mi...@optusnet.com.au wrote:
   I would if there were ways to keep my alt text so users can browse
   with iimages off.

   But there is no work around so i have opted to use jquery.

   So is there a way to make this work using jquery?

   Thanks
   Jess

   On Oct 9, 5:15 pm, Jonathan Vanherpe (T  T NV) jonat...@tnt.be
   wrote:

use css rollovers instead

jessie wrote:

 Hi

 I had it all working and now its not :(

 My problem now lies with the hovering over my 2 classes
 ie. .LPButton,.CatMoreBtn  its just not hovering! and i'd like to
 make this work for me so i can have not only png's rollover but, gifs
 and jpgs but i have no clue where to put the additional code.

 Any help would be much much appreciated.

 This is what i have for jquery so far.

 jQuery(function($) {

 function getLeaf(url) {
 var splited=url.split('?');// remove all the parameter from url
 url=splited[0];
 return url.substring(url.lastIndexOf(/)+1);// return file name
 without domain and path

 }

 jQuery.fn.extend({
   enter: function() {//plugins creation
       return this.each(function() {
         var pth = $(this).find(img)[0];
        //alert($(this).children().attr(href));
         if($(this).children().attr(href)==getLeaf
 (document.location.href)){// check that the link url and document url
 is same
             $(pth).attr(src,pth.src.replace(/.png/g,
  '_active.png'));
         } else{
                 $(this).hover(function(){
                    $(pth).attr(src,pth.src.replace(/.png/g,
 '_active.png'));// mouse over Image
                    },function(){

   $(pth).attr(src,pth.src.replace(/_active.png/
 g, '.png'));// mouse out image
                        });
                 }
                 });
       }
 });

 $(function(){  // Document is ready

   $(.LPButton,.CatMoreBtn).enter();// call the function

 });

    $('input[type=image]').hover(
            function () { $(this).attr(src,
  $(this).attr(src).split('-
 off').join('-on')); },
            function () { $(this).attr(src,
  $(this).attr(src).split('-
 on').join('-off')); }
    );

 });

 jQuery(function($) {
          $(document).pngFix();
      });

 Jess

--
Jonathan Vanherpe - Tallieu  Tallieu NV - jonat...@tnt.be


[jQuery] css3 helper

2009-10-09 Thread Xavier.Bouhours

I write this lines to help me, but it could be good to have it inside
jQuery :

---

// webkit
document.isWebkit =  navigator.userAgent.match(/webkit/i)

// attach the new css properties to the document :

document.css = (function()
{
var
c = {},
b = 
document.defaultView.getComputedStyle(document.body, null), //
safari
d = document.createElement('div') ; // mozilla

for (i=0;ib.length;i++)
c[ b[i].replace((/^(-webKit-|-moz-|-kml-|-o-)/gi),'')
.replace( (/(-.?)/i), function(a){ return 
a.charAt(1).toUpperCase()
+a.substr(2); } )] = b[i] ;

for(k in d) c[k.replace((/^(webKit|moz|kml)/gi),'')
.replace( (/(^.?)/i), function(a){ return 
a.charAt(0).toLowerCase()
+a.substr(1); } )]=k;

return c;
})();
-
Then you can play:

if( document.isWebkit ) ...
if( document.css.boxShadow ) ...
if( document.css.transform ) ...

// get the css propertie for -moz and -webkit:
if(document.css.boxShadow) this.style[document.css.boxShadow] =
propertie;


[jQuery] Superfish Menu - Customize Cross frame

2009-10-09 Thread cazanova

Does Superfish Menu offer cross frame support?

Regards


[jQuery] Multiple textboxes with different ID's

2009-10-09 Thread Aman

I am using the time picker plugin which is basically used for getting
a time value in a textbox similar to google calendar. How can we use
with multiple textboxes. The textboxes are generating dynamically from
server side script and now i need to have a timepicker at eash
textbox,  how can this be done ?
This is the JS code,

$(document).ready( function() {

var values=$('input[name=txtTime[]]').map(function()
{
  return $(this).val()
}

).get();

$(txtTime).click(function(){
$(this).timePicker({step:15, startTime:02:00, endTime:11:00});
});
});

and this is the server side code:
for($i=1;$i=7;$i++)
{
echo tr ;
for($j=1;$j5;$j++ )
{
echo tdinput type='text' size='5' class='textbox' 
name='txtTime
[]' value='$i$j' /nbsp;;
echo /td;
}
echo /tr;
}


[jQuery] 'J.readyState' is null or not an object

2009-10-09 Thread Donf

Env : JQuery 1.3.2 , IE8 with script debugging
Trying to setup timeout on a ajax request

The error message  'J.readyState' is null or not an object  occurs
on jquery.js:

...  if(M.global){o.event.trigger(ajaxSend,[J,M])}var N=function
(X){if(J.readyState==0){if(P){clearInterval(P); ...

So I have to add  J != null  before   J.readyState==0 

Any one known this ?


[jQuery] [autocomplete] Incorrect selection on mouse click in IE7+

2009-10-09 Thread vsc

For clarity, I have modified the code in the demo application to
demonstrate the bug.
1. Please download code from 
http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/
and place attached AutosuggestBug.html in demo folder.
2. Launch AutosuggestBug.html in Internet Explorer (I used version
IE7).
2. In Multiple Cities (local) text area enter letter a (Observe
autosuggest list displayed with focus on Aberdeen)
3. Press enter (to add Aberdeen)
4. Enter letter a again (Observe autosuggest list displayed with
focus on Aberdeen)
5. Select Ada (the second entry in auto suggest list) with a mouse
click.

Expected Result:
The Multiple Cities (local) text area should be populated with
Aberdeen, Ada (as is the case with Firefox).

Actual Result:
In IE, the Multiple Cities (local) text area is populated with Ada,
a.

Additional information:
On debugging the code, the problem seems to be in the following
snippet of code:

selectCurrent() {
...
if ( options.multiple ) {
var words = trimWords($input.val());
if ( words.length  1 ) {
var seperator = options.multipleSeparator.length;
var cursorAt = $(input).selection().start;
...
if (cursorAt = progress) {
wordAt = i;
return false;
}
...
});
words[wordAt] = v;
...
v = words.join( options.multipleSeparator );
}
v += options.multipleSeparator;
}

$input.val(v);
..
}

The problem occurs primarily at:
var cursorAt = $(input).selection().start;
Here, the variable, 'cursorAt' holds an incorrect value of -1 (return
value from the selection() function) when selection happens via mouse
click in IE.

NOTE: This problem happens only in IE.

Has somebody encountered this problem and/or have a recommended
solution to this problem?
Any help will be appreciated.

Regards,
Charanya



Attachment:
AutosuggestBug.html

!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01//EN http://www.w3.org/
TR/html4/strict.dtd
html
head
titlejQuery Autocomplete Plugin/title
script type=text/javascript src=../lib/jquery.js/script
script type='text/javascript' src='../lib/jquery.bgiframe.min.js'/
script
script type='text/javascript' src='../lib/jquery.ajaxQueue.js'/
script
script type='text/javascript' src='../lib/thickbox-compressed.js'/
script
script type='text/javascript' src='../jquery.autocomplete.js'/
script
script type='text/javascript' src='localdata.js'/script

link rel=stylesheet type=text/css href=main.css /
link rel=stylesheet type=text/css href=../
jquery.autocomplete.css /
link rel=stylesheet type=text/css href=../lib/thickbox.css /

script type=text/javascript
$().ready(function() {
$(#suggest3).autocomplete(cities, {
multiple: true,
matchContains: true,
autoFill: false
});

});


/script

/head

body

div id=content
form autocomplete=off

p
labelMultiple Cities (local):/label

textarea id='suggest3' cols='40' rows='3'/textarea
input type=button value=Get Value /
/p

/form
/div
/body
/html


[jQuery] [autocomplete] from bassistance: clicking outside the autocomplete does not remove AC

2009-10-09 Thread Bernie

Hello all,
For some reason, clicking to the left or right of the autocompletion
dropdown doesn't remove the drop-down in IE7 for me, but it works on
the demo site...anyone else experience this? Is it some kind of
formatting bug I should be looking out for?
Bernie


[jQuery] Re: Cycle Plugin not working in IE - who can help?

2009-10-09 Thread Mike Alsup

Remove the comma at the end of this line:

 prev:   '#prev' ,

trailing commas at the end of an array are not allowed in IE 6/7.

Also, next time please post a link instead of all your markup if
possible.

Cheers!

Mike



On Oct 9, 4:45 am, First Impression dancollin...@googlemail.com
wrote:
 Hi,

 I am currently developing a site for a client which uses the JQuery
 cycle plugin to move through a number of divs which contain pictures
 and info about wedding dresses.

 All works fine in Firefox, but when I test in IE6 + IE7 the divs are
 all stacked on top of each other vertically and they soan right down
 the screen for 1000's of pixels.

 To me it seems like this is a problem with absolute/relative
 positioning or the z-index, I have also used a few floats in the child
 divs.
 I am also using SIFR for text replacement, could this be conflicting?

 Here is my code, can anyone see a problem that would cause my cycle
 not to work in IE.?

 --
 XHTML
 --
 code

 !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN 
 http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd;
 html xmlns=http://www.w3.org/1999/xhtml; xml:lang=en lang=en
 head
 meta http-equiv=content-type content=text/html; charset=utf-8 /
 titleWedding Dresses ~ Cavendish Bridal House/title
 link rel=stylesheet type=text/css media=all href=css/
 reset.css /
 link rel=stylesheet type=text/css media=all href=css/
 text.css /
 link rel=stylesheet type=text/css media=all href=css/960.css /

 link rel=stylesheet type=text/css media=all href=css/
 styles.css /
 link rel=shortcut icon href=img/favicon.ico type=image/x-icon /

 link rel=stylesheet href=css/sifr.css type=text/css
 media=screen /

 !--[if lte IE 6]
 link rel=stylesheet type=text/css media=screen href=css/
 ie6.css /
 ![endif]--

 !--[if lt IE 7]
  script src=http://ie7-js.googlecode.com/svn/version/2.0(beta3)/
 IE7.js
  type=text/javascript
  /script

  /script
 ![endif]--

 script src=js/sifr.js type=text/javascript/script
 script src=js/sifr-config.js type=text/javascript/script
 script src=js/jquery-1.3.2.min.js type=text/javascript/script
 script src=js/jquery.cycle.all.min.js type=text/javascript/
 script
 script type=text/javascript
     function initMenu() {
     $('#menu ul').hide();
     $('#menu ul#dressessub').show();
     $('#menu li a').click(
     function() {
     var checkElement = $(this).next();
     if((checkElement.is('ul'))  (checkElement.is(':visible'))) {
     return false;
     }
    if((checkElement.is('ul'))  (!checkElement.is(':visible'))) {
    $('#menu ul:visible').slideUp('normal');
    checkElement.slideDown('normal');
    return false;
    }
    }
    );
    }
    $(document).ready(function() {initMenu();});
 /script

 script type=text/javascript
 $(document).ready(function() {
 $('#wedding-dresses').cycle({
     fx:     'fade',
     speed:  'fast',
     timeout: 0,
     next:   '#next',
     prev:   '#prev' ,
         });
         });
 /script

 /head

 body id=wedding-dress

 div id=page-outer
 div class=container_12 id=page

 div class=grid_12 id=header

          div id=logo
             a href=index.html class=logo title=Cavendish Bridal
 HouseCavendish Bridal House Hayfield/a        /div!--end logo--

 /div!--end header--
 div id=content
 div id=label
   ul id=menu
                            lia href=index.html id=home
 title=Home Home/a/li
                            lia href=georgia.html id=georgia
 title=GeorgiaGeorgia/a/li
                            lia href=the-shop.html id=shop
 title=The ShopThe Shop/a/li
                            li class=headlinka href=# id=your-
 dress  title=Your DressYour Dress/a
                                    ul
                                         lia href=what-to-
 expect.html title=What to expect id=expectWhat to expect/a/
 li
                                         lia href=ordering-your-
 dress.html title=Ordering your dress id=ordering Ordering your
 dress/a/li
                                         lia href=alterations.html
 title=Alterations id=alterations Alterations/a/li
                                         lia href=collections.html
 title=Collections id=collections Collections/a/li
                                    /ul
                            /li

                            li class=headlinka href=dresses.html
 id=dresses  title=DressesDresses/a
                            ul id=dresses-sub
                                         lia href=wedding-dresses.html
 id=wedding  title=Wedding DressesWedding Dresses/a/li
                                 lia href=bridesmaid-dresses.html
 id=bridesmaid title= Bridesmaid DressesBridesmaid Dresses/a/
 li
                                 lia href=prom-dresses.html
 id=prom  title=Prom DressesProm Dresses/a/li
                              /ul
                            /li
                           lia href=accessories.html
 id=accessories title=AccessoriesAccessories/a/li
                           lia 

[jQuery] Re: Cycle Plugin not working in IE - who can help?

2009-10-09 Thread First Impression

:O

Thank you a thousand times Mike, you have made my life a lot easier!!!

I have learnt my lesson for future reference.

Dan

On Oct 9, 12:22 pm, Mike Alsup mal...@gmail.com wrote:
 Remove the comma at the end of this line:

  prev:   '#prev' ,

 trailing commas at the end of an array are not allowed in IE 6/7.

 Also, next time please post a link instead of all your markup if
 possible.

 Cheers!

 Mike

 On Oct 9, 4:45 am, First Impression dancollin...@googlemail.com
 wrote:

  Hi,

  I am currently developing a site for a client which uses the JQuery
  cycle plugin to move through a number of divs which contain pictures
  and info about wedding dresses.

  All works fine in Firefox, but when I test in IE6 + IE7 the divs are
  all stacked on top of each other vertically and they soan right down
  the screen for 1000's of pixels.

  To me it seems like this is a problem with absolute/relative
  positioning or the z-index, I have also used a few floats in the child
  divs.
  I am also using SIFR for text replacement, could this be conflicting?

  Here is my code, can anyone see a problem that would cause my cycle
  not to work in IE.?

  --
  XHTML
  --
  code

  !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN 
  http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd;
  html xmlns=http://www.w3.org/1999/xhtml; xml:lang=en lang=en
  head
  meta http-equiv=content-type content=text/html; charset=utf-8 /
  titleWedding Dresses ~ Cavendish Bridal House/title
  link rel=stylesheet type=text/css media=all href=css/
  reset.css /
  link rel=stylesheet type=text/css media=all href=css/
  text.css /
  link rel=stylesheet type=text/css media=all href=css/960.css /

  link rel=stylesheet type=text/css media=all href=css/
  styles.css /
  link rel=shortcut icon href=img/favicon.ico type=image/x-icon /

  link rel=stylesheet href=css/sifr.css type=text/css
  media=screen /

  !--[if lte IE 6]
  link rel=stylesheet type=text/css media=screen href=css/
  ie6.css /
  ![endif]--

  !--[if lt IE 7]
   script src=http://ie7-js.googlecode.com/svn/version/2.0(beta3)/
  IE7.js
   type=text/javascript
   /script

   /script
  ![endif]--

  script src=js/sifr.js type=text/javascript/script
  script src=js/sifr-config.js type=text/javascript/script
  script src=js/jquery-1.3.2.min.js type=text/javascript/script
  script src=js/jquery.cycle.all.min.js type=text/javascript/
  script
  script type=text/javascript
      function initMenu() {
      $('#menu ul').hide();
      $('#menu ul#dressessub').show();
      $('#menu li a').click(
      function() {
      var checkElement = $(this).next();
      if((checkElement.is('ul'))  (checkElement.is(':visible'))) {
      return false;
      }
     if((checkElement.is('ul'))  (!checkElement.is(':visible'))) {
     $('#menu ul:visible').slideUp('normal');
     checkElement.slideDown('normal');
     return false;
     }
     }
     );
     }
     $(document).ready(function() {initMenu();});
  /script

  script type=text/javascript
  $(document).ready(function() {
  $('#wedding-dresses').cycle({
      fx:     'fade',
      speed:  'fast',
      timeout: 0,
      next:   '#next',
      prev:   '#prev' ,
          });
          });
  /script

  /head

  body id=wedding-dress

  div id=page-outer
  div class=container_12 id=page

  div class=grid_12 id=header

           div id=logo
              a href=index.html class=logo title=Cavendish Bridal
  HouseCavendish Bridal House Hayfield/a        /div!--end logo--

  /div!--end header--
  div id=content
  div id=label
    ul id=menu
                             lia href=index.html id=home
  title=Home Home/a/li
                             lia href=georgia.html id=georgia
  title=GeorgiaGeorgia/a/li
                             lia href=the-shop.html id=shop
  title=The ShopThe Shop/a/li
                             li class=headlinka href=# id=your-
  dress  title=Your DressYour Dress/a
                                     ul
                                          lia href=what-to-
  expect.html title=What to expect id=expectWhat to expect/a/
  li
                                          lia href=ordering-your-
  dress.html title=Ordering your dress id=ordering Ordering your
  dress/a/li
                                          lia href=alterations.html
  title=Alterations id=alterations Alterations/a/li
                                          lia href=collections.html
  title=Collections id=collections Collections/a/li
                                     /ul
                             /li

                             li class=headlinka href=dresses.html
  id=dresses  title=DressesDresses/a
                             ul id=dresses-sub
                                          lia href=wedding-dresses.html
  id=wedding  title=Wedding DressesWedding Dresses/a/li
                                  lia href=bridesmaid-dresses.html
  id=bridesmaid title= Bridesmaid DressesBridesmaid Dresses/a/
  li
              

[jQuery] Re: How to union plugins in 1 file

2009-10-09 Thread MorningZ

Simple copy-paste do not work.

Then you are messing that part up, as that is the solution...

there's zero reason why taking myscript1.js and myscript2.js and
putting them one after another in myscript3.js that this last file
will not work on it's own


On Oct 9, 3:49 am, furionn furi...@gmail.com wrote:
 Hello all.

 How to union all plugins in 1 file ? Simple copy-paste do not work.


[jQuery] Re: png fix with jquery ui?

2009-10-09 Thread Xavier.Bouhours

Some response for your problem here :

http://developer.yahoo.com/performance/rules.html#no_filters

I only use the png with alpha for transparency. You can do that until
adobe cs3, and maybe with free softs.
So you don't need any js...

http://www.sitepoint.com/blogs/2007/09/18/png8-the-clear-winner/


[jQuery] Re: How to parse a json object?

2009-10-09 Thread Thai Dang Vu
That works and :-) thank you so much.

On Fri, Oct 9, 2009 at 6:00 AM, Chippo mathew.chap...@gmail.com wrote:


 Hi Thai

 you could try something like this I think...
 var obj = {'title':'mytitle','etc':'etc'};
 for(var a in obj){
  // a would be the key ie 'title'
  // obj[a] would get the value ie 'mytitle'
 }
 I think that will work I havent tried it myself though.


 On Oct 9, 5:38 am, Thai Dang Vu tdan...@gmail.com wrote:
  Let me rephrase my problem.
 
  $.post('a.htm', $('#formId').serialize(), function(data) {
  // data is a json string
  // I don't know anything about the keys used in that json string,
 i.e.
  that string can be
  // '{name: James, age: 27}' or can be '{title: jQuery,
 year:
  2009, month: 10}'
  var jsonObject = JSON.parse(data);  // JSON is fromhttp://
 www.json.org/json2.js
  // because the keys are unknown, I cannot write something like
  jsonObject.name, jsonObject.title ...
  // if the Prototype library is used, I can do like this
  $H(jsonObject).each(function(item) {
  log.debug(item.key + ' ' + item.value);
  });
 
  });
 
  If the server returns '{name: James, age: 27}', that block of code
  should print out
  name James
  age 27
  If the server returns '{title: jQuery, year: 2009, month: 10}',
 that
  block of code should print
  title jQuery
  year 2009
  month 10
 
  Thanks for any help.
 
  On Thu, Oct 8, 2009 at 8:01 PM, Michael Geary m...@mg.to wrote:
   I assume that what you mean is you have the actual JavaScript *object*,
 not
   a JSON string that represents the object, right?
 
   If you had a JSON string, you could just look at the string to see its
 keys
   and values. Or you could paste it intowww.jsonlint.comto pretty-print
   it.
 
   If you have a JavaScript object, one easy way to view it is to load
 your
   page in Firefox with Firebug installed, and then add this line to your
 code:
 
   console.dir( yourObject );
 
   -Mike
 
   On Thu, Oct 8, 2009 at 11:20 AM, Thai Dang Vu tdan...@gmail.com
 wrote:
 
   Hi everybody,
 
   Supposed that I have a json object but I don't know anything about its
   keys and values. Is there anyway to print out all the key and value
 pairs in
   that object?
 
   Thanks.



[jQuery] retrieve tr id

2009-10-09 Thread Chuk

Hi.  I have a table set up with multiple rows.  Once a row is
selected, the class of the row changes to clicked.  The id of the
row is the sequence number, and each td within that row has an id
of  the sequence number plus a title, such as account.  So, the id
of the first td in the first row is 1account.  I have an Edit
Selected button which I would like to create a function for that
would retrieve all of the information from the clicked row and place
it in the edit row text fields and select boxes.  This is what I have
for the edit button function right now:

$('#edit').click(function() {
  var clickedID = $('.clicked').id;
  $('#account').val() = clickedID + 'Account';
  $('#reference').val() = clickedID + 'Reference';
  $('#journalCode').val() = clickedID + 'Journal';
  ...
});

But, this doesn't work.  How could I retrieve the id of the row and
add each title to it?


[jQuery] Re: retrieve tr id

2009-10-09 Thread brian

On Fri, Oct 9, 2009 at 9:35 AM, Chuk violinssoundc...@gmail.com wrote:

 Hi.  I have a table set up with multiple rows.  Once a row is
 selected, the class of the row changes to clicked.  The id of the
 row is the sequence number, and each td within that row has an id
 of  the sequence number plus a title, such as account.  So, the id
 of the first td in the first row is 1account.  I have an Edit
 Selected button which I would like to create a function for that
 would retrieve all of the information from the clicked row and place
 it in the edit row text fields and select boxes.  This is what I have
 for the edit button function right now:

 $('#edit').click(function() {
  var clickedID = $('.clicked').id;
  $('#account').val() = clickedID + 'Account';
  $('#reference').val() = clickedID + 'Reference';
  $('#journalCode').val() = clickedID + 'Journal';
  ...
 });

 But, this doesn't work.  How could I retrieve the id of the row and
 add each title to it?

You cannot use IDs that begin with a digit for DOM elements.


[jQuery] Re: retrieve tr id

2009-10-09 Thread Chuk

Okay.  So I'll tack the digits onto the end.  So that it will be
Account1, etc.  The main thing I think I need is how to retrieve the
id of an element once I know its class.  Thanks.



[jQuery] Re: retrieve tr id

2009-10-09 Thread Chuk

Okay.  So I'll tack the digits onto the end.  So that it will be
Account1, etc.  The main thing I think I need is how to retrieve the
id of an element once I know its class.  Thanks.



[jQuery] Re: retrieve tr id

2009-10-09 Thread Chuk

Okay.  So I'll tack the digits onto the end.  So that it will be
Account1, etc.  The main thing I think I need is how to retrieve the
id of an element once I know its class.  Thanks.



[jQuery] Re: Adding Multi-Tier to Drop Menu?

2009-10-09 Thread ehime

I was injecting this into the code, it Origionally was not there.
[code]
$(this).find('ul:first:hidden').css({visibility:
visible,display: none}).show(400);
$(this).find('ul:first').css({visibility: hidden});
[/code]

I had taken a menu system that I liked and thought worked well, and
was
trying to restructure it. I am not very adept at JQuery though, my
skills are
firmly planted in PHP API dev. If I was to just use this code (below)
how
could I make it work?? I really don't want to scrap the entire idea
just to
rewrite it, it'd take me forver, lol. Thanks for taking this on,
serious
brownie  points awarded.

-jd

[code]
 $(document).ready(function(){

$(ul.subnav).parent().append(span/span); //Only shows
drop
down trigger when js is enabled - Adds empty span tag after ul.subnav

$(ul.topnav li span).hover(function() { //When trigger is
onHover...

//Following events are applied to the subnav itself
(moving subnav
up and down)
$(this).parent().find(ul.subnav).slideDown
('fast').show(); //Drop
down the subnav on click

$(this).parent().hover(function() {
}, function(){
$(this).parent().find(ul.subnav).slideUp
('slow'); //When the
mouse hovers out of the subnav, move it back up

});

//Following events are applied to the trigger (Hover
events for the
trigger)
}).hover(function() {
$(this).addClass(subhover); //On hover over,
add class subhover
}, function(){  //On Hover Out
$(this).removeClass(subhover); //On hover
out, remove class
subhover
});

});
[/code]



On Oct 8, 3:29 pm, Charlie charlie...@gmail.com wrote:
 taking a stab at this, code seems quite strange to me
 First- check your context of this , in your span.hover you have a this 
 looking for a child of the span that is a UL
 sildedown().show()  - not necessary, slidedown already takes a hidden element 
 and shows it
 the css keeps functioning on the same ul:first and is going in circles with 
 display: none ,then show, and next line on same element visibility: hidden
 I think it may be your interpretation of this  ?? In your span.hover() 
 function  this will always be the span
 Your parent hover function inside the child hover function seems strange to 
 me. Realistically I think you chose the wrong element to start your menu 
 hovers with. When you hover an li, the UL that opens is within that li, 
 therefore as you move mouse down( or sideways) into subs you haven't left the 
 hovered element
 I'd suggest scrapping everything and start over, using your li's as the 
 hovering element
 ehime wrote:I thought I could get this working with my first UL, doesn't seem 
 to be cooperating very much though. Anyone mind helping me find out how to 
 add the ability to traverse up to four tiers? Much MUCH appreciated! [code] 
 $(document).ready(function(){ 
 $(ul.subnav).parent().append(span/span); //Only shows drop down 
 trigger when js is enabled - Adds empty span tag after ul.subnav $(ul.topnav 
 li span).hover(function() { //When trigger is onHover... //Following events 
 are applied to the subnav itself (moving subnav up and down) 
 $(this).parent().find(ul.subnav).slideDown('fast').show(); //Drop down the 
 subnav on click $(this).find('ul:first:hidden').css({visibility: 
 visible,display: none}).show(400); 
 $(this).find('ul:first').css({visibility: hidden}); 
 $(this).parent().hover(function() { }, function(){ 
 $(this).parent().find(ul.subnav).slideUp('slow'); //When the mouse hovers 
 out of the subnav, move it back up }); //Following events are applied to the 
 trigger (Hover events for the trigger) }).hover(function() { 
 $(this).addClass(subhover); //On hover over, add class subhover }, 
 function(){ //On Hover Out $(this).removeClass(subhover); //On hover out, 
 remove class subhover }); }); And here's my body to body to see the syntax 
 I'm using [code] body div class=container div id=header div 
 class=disclaimer/div ul class=topnav lia href=#Lighting/a 
 ul class=subnav lia href=#PR LIGHTING/a ul class=subnav 
 lia href=http://omnisistem.com/layers/Lighting/prl- 
 ar.phpArchitectural/a/li lia 
 href=http://omnisistem.com/layers/Lighting/prl- 
 cp.phpCenterpieces/a/li lia 
 href=http://omnisistem.com/layers/Lighting/prl-dj.php;DJ Pro 
 Series/a/li lia href=http://omnisistem.com/layers/Lighting/prl- 
 fs.phpFollowspots/a/li lia 
 href=http://omnisistem.com/layers/Lighting/prl-my.php;Moving Yoke/a/li 
 /ul/li lia href=#NOVALIGHT/a ul class=subnav lia 
 href=http://omnisistem.com/layers/Lighting/nvl- 
 sl.phpSearchlights/a/li /ul/li lia href=#OMNILITE/a ul 
 class=subnav lia href=http://omnisistem.com/layers/Lighting/lit- 
 cr.phpControllers/a/li lia 
 href=http://omnisistem.com/layers/Lighting/lit-fx.php;Effect 
 Lighting/a/li lia href=http://omnisistem.com/layers/Lighting/lit- 
 

[jQuery] Re: $.post() speed

2009-10-09 Thread Adonis

ok, here is an effort to sum up the code..

*
function initialiseLegendLayerGroupEntry(a,b,c,d,e,f) {
var x;
$(#division_name).bind(click, function() {
if(this.value == sth) {
y=callFunction(a,b,c,d,e,f);
$.ajax({
type: POST,
url: /serverFunction/,
data: {project_name:d,layer_name:e,group_name:f},
success: function(msg){
$(#an entry point for html files that are
served).after(msg);
alert( $(#division where the wanted value is
stored).val() );  // this alert window pops up at the end.
x= $(#division where the wanted value is
stored).val();
 }
});
alert(x); // this pop up window is always empty. it opens while i
still receive print commands from my server script !
}
});
}

I think this code is a good example of my problem. Can you identify an
error somewhere?

thanks,

On Oct 8, 6:07 pm, MorningZ morni...@gmail.com wrote:
 You should should the specific $.post() code in detail, there's
 something you are missing because when you get back from the async
 call, everything (global variables, page objects) are fully available
 at that point... there's zero need to use setTimeout

 On Oct 8, 12:27 pm, Adonis achrysoch...@hotmail.com wrote:

  Dan,

  I used a $.ajax() call with a callback - success: function(msg) etc.
  but still it does not work the way I want to.
  from the server side i am using,

  *
  return render_to_response(blah.html,{ 'project_id':project_id },
  context_instance = RequestContext(request))
  *
  putting the project_id in a divinput id=klain value=project_id /

  /div

  and if the ajax call is successfull i do this,

  *
  alert( $(#klain).val() );
  *

  The alert window does pop up, but after the rest of the functions in
  the code have been read. I somehow need to delay the javascript
  parsing, until the input of the division in the html that is rendered
  gets the project_id value. This is why i am looking into setTimeOut
  () js function.

  cheers,

  On Oct 8, 2:08 pm, Dan G. Switzer, II dswit...@pengoworks.com
  wrote:

   Adonis,
   The $.post() function is asynchronous (by default) when your code hits a
   $.post() call, it'll keep executing code. In order to do something with 
   the
   results of your AJAX call, you'll want to use the callback option--which 
   is
   a function run when the AJAX call is completed.

   -Dan

   On Thu, Oct 8, 2009 at 7:14 AM, Adonis achrysoch...@hotmail.com wrote:

I am not entirely sure if i am using proper definitions here, but here
it goes..

I have $.post() inside javascript functions. If ajax is successfull,
it returns data from the server. I am trying to assign this data  to
javascript global variables. The problem is that my global javascript
variables end up to be empty. It seems it takes time for the ajax to
return the data and by the time the server data is returned, the
browser has comploted reading through the rest of the javascript
functions. Thus, leaving my global variables empty.

Do you have any suggestions on how this could be fixed? I am trying
setTimeOut() at the moment but i would be glad to concider other
solutions as well..

I could provide code examples on request.

Thanks in advance!


[jQuery] Re: retrieve tr id

2009-10-09 Thread brian

On Fri, Oct 9, 2009 at 11:28 AM, Chuk violinssoundc...@gmail.com wrote:

 Okay.  So I'll tack the digits onto the end.  So that it will be
 Account1, etc.  The main thing I think I need is how to retrieve the
 id of an element once I know its class.  Thanks.



I would do:

$('.clicked').parent('tr').attr('id');

But I think I'd set the 'clicked' class on the entire row, instead of
the 1st TD.

When you set the #journalCode value, you're only setting it to the
string, Journal1 (for example). Is that correct? Or, do you actually
want to set it to the contents of some TD in that row?


[jQuery] Multi File dinamically added problem...

2009-10-09 Thread angelbit

Hi, have tried to use the multi file plugin (http://www.fyneworks.com/
jquery/multiple-file-upload) on a fields dinamically generated by
jquery...but don't work...have a solution?

 var new_files_input = $('#files' + num).clone().attr('id', 'files' +
newNum).attr('name', 'files' + newNum);
new_files_input.MultiFile();

PS:the code is on my own function outside the onload of jquery, first
have tried to attach to jquery onclick event but have the same
result...


[jQuery] append()-Param containing script

2009-10-09 Thread Eric

Hey there,

I'm trying to append HTML code to a DOM element, with a string that
also contains a script tag:

input type=text id=foo
script type=text/javascript
stylizeInput($('input#foo'));
/script

It works fine, just like it should according to jQuery functionality.
The crucial thing is: The script is being processed too fast,
therefore executed before the input field is known.

How can I delay execution until the HTML part is fully loaded?
$('input#foo').ready() won't work and I don't consider setTimeout as a
solution.

Thanks for your help
Eric


[jQuery] Re: Incorrect selection on mouse click in IE7+

2009-10-09 Thread Rye

Great plugin, but I cannot believe there are not more threads on this
topic.

This issue can be clearly seen on autocomplete's demo here:
http://jquery.bassistance.de/autocomplete/demo/

Using IE (works as expected in FF) try entering values into the
Multiple Cities (local): text box. The selected option is added to the
beginning of the list in proper case as well as to the end of the list
in lowercase. Other stange things happen if you select options
beginning with the same letter. If you hold down shift when selecting
your options it appear to act as expected.

Any help would be much appreciated.

Does anyone have a fix for this in IE?

On Oct 9, 11:11 am, vsc charany...@gmail.com wrote:
 For clarity, I have modified the code in the demo application to
 demonstrate the bug.
 1. Please download code 
 fromhttp://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/
 and place attached AutosuggestBug.html in demo folder.
 2. Launch AutosuggestBug.html in Internet Explorer (I used version
 IE7).
 2. In Multiple Cities (local) text area enter letter a (Observe
 autosuggest list displayed with focus on Aberdeen)
 3. Press enter (to add Aberdeen)
 4. Enter letter a again (Observe autosuggest list displayed with
 focus on Aberdeen)
 5. Select Ada (the second entry in auto suggest list) with a mouse
 click.

 Expected Result:
 The Multiple Cities (local) text area should be populated with
 Aberdeen, Ada (as is the case with Firefox).

 Actual Result:
 In IE, the Multiple Cities (local) text area is populated with Ada,
 a.

 Additional information:
 On debugging the code, the problem seems to be in the following
 snippet of code:

 selectCurrent() {
 ...
 if ( options.multiple ) {
 var words = trimWords($input.val());
 if ( words.length  1 ) {
 var seperator = options.multipleSeparator.length;
 var cursorAt = $(input).selection().start;
 ...
 if (cursorAt = progress) {
 wordAt = i;
 return false;}
 ...
 });

 words[wordAt] = v;
 ...
 v = words.join( options.multipleSeparator );}

 v += options.multipleSeparator;

 }

 $input.val(v);
 ..

 }

 The problem occurs primarily at:
 var cursorAt = $(input).selection().start;
 Here, the variable, 'cursorAt' holds an incorrect value of -1 (return
 value from the selection() function) when selection happens via mouse
 click in IE.

 NOTE: This problem happens only in IE.

 Has somebody encountered this problem and/or have a recommended
 solution to this problem?
 Any help will be appreciated.

 Regards,
 Charanya

 Attachment:
 AutosuggestBug.html

 !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01//EN http://www.w3.org/
 TR/html4/strict.dtd
 html
 head
 titlejQuery Autocomplete Plugin/title
 script type=text/javascript src=../lib/jquery.js/script
 script type='text/javascript' src='../lib/jquery.bgiframe.min.js'/
 script
 script type='text/javascript' src='../lib/jquery.ajaxQueue.js'/
 script
 script type='text/javascript' src='../lib/thickbox-compressed.js'/
 script
 script type='text/javascript' src='../jquery.autocomplete.js'/
 script
 script type='text/javascript' src='localdata.js'/script

 link rel=stylesheet type=text/css href=main.css /
 link rel=stylesheet type=text/css href=../
 jquery.autocomplete.css /
 link rel=stylesheet type=text/css href=../lib/thickbox.css /

 script type=text/javascript
 $().ready(function() {
         $(#suggest3).autocomplete(cities, {
                 multiple: true,
                 matchContains: true,
                 autoFill: false
         });

 });

 /script

 /head

 body

 div id=content
         form autocomplete=off

                 p
                         labelMultiple Cities (local):/label

                         textarea id='suggest3' cols='40' rows='3'/textarea
                         input type=button value=Get Value /
                 /p

         /form
 /div
 /body
 /html


[jQuery] Dynamic images - how can I tell when they are ready to be viewed by the browser?

2009-10-09 Thread dowhilesomething

I'm building a slide show using jQuery and I am having sporadic issues
displaying an image before it's fully loaded.

e.g. Images are stored in a database (binary not the image path) and I
use an image handler to retrieve the images.

Because the amount of images for each slide show is not predetermined,
I load the first image and next image initially, then each time a
slide (next) is selected I fetch that slide and the next slide.  I
don't want to pre-load each image as there could be well over 50-60
images and some users might only view a handful of slides. Thus
wasting bandwidth and resources.

Is there a way I can tell when the requested image is ready to be
viewed/rendered?  The reason for this is that all images are not fixed
width/height and to place them in the middle of the stage I need to
check the height/width so I can add it to the container I am
positioning.

Any ideas/thoughts on this would be greatly appreciated.

Regards, David


[jQuery] Re: $.post() speed

2009-10-09 Thread Adonis

ok, here is an effort to sum up the code..

*
function initialiseLegendLayerGroupEntry(a,b,c,d,e,f) {
var x;
$(#division_name).bind(click, function() {
if(this.value == sth) {
y=callFunction(a,b,c,d,e,f);
$.ajax({
type: POST,
url: /serverFunction/,
data: {project_name:d,layer_name:e,group_name:f},
success: function(msg){
$(#an entry point for html files that are
served).after(msg);
alert( $(#division where the wanted value is
stored).val() );  // this alert window pops up at the end.
x= $(#division where the wanted value is
stored).val();
 }
});
alert(x); // this pop up window is always empty. it opens while i
still receive print commands from my server script !
}
});
}

I think this code is a good example of my problem. Can you identify an
error somewhere?

thanks,

On Oct 8, 6:07 pm, MorningZ morni...@gmail.com wrote:
 You should should the specific $.post() code in detail, there's
 something you are missing because when you get back from the async
 call, everything (global variables, page objects) are fully available
 at that point... there's zero need to use setTimeout

 On Oct 8, 12:27 pm, Adonis achrysoch...@hotmail.com wrote:

  Dan,

  I used a $.ajax() call with a callback - success: function(msg) etc.
  but still it does not work the way I want to.
  from the server side i am using,

  *
  return render_to_response(blah.html,{ 'project_id':project_id },
  context_instance = RequestContext(request))
  *
  putting the project_id in a divinput id=klain value=project_id /

  /div

  and if the ajax call is successfull i do this,

  *
  alert( $(#klain).val() );
  *

  The alert window does pop up, but after the rest of the functions in
  the code have been read. I somehow need to delay the javascript
  parsing, until the input of the division in the html that is rendered
  gets the project_id value. This is why i am looking into setTimeOut
  () js function.

  cheers,

  On Oct 8, 2:08 pm, Dan G. Switzer, II dswit...@pengoworks.com
  wrote:

   Adonis,
   The $.post() function is asynchronous (by default) when your code hits a
   $.post() call, it'll keep executing code. In order to do something with 
   the
   results of your AJAX call, you'll want to use the callback option--which 
   is
   a function run when the AJAX call is completed.

   -Dan

   On Thu, Oct 8, 2009 at 7:14 AM, Adonis achrysoch...@hotmail.com wrote:

I am not entirely sure if i am using proper definitions here, but here
it goes..

I have $.post() inside javascript functions. If ajax is successfull,
it returns data from the server. I am trying to assign this data  to
javascript global variables. The problem is that my global javascript
variables end up to be empty. It seems it takes time for the ajax to
return the data and by the time the server data is returned, the
browser has comploted reading through the rest of the javascript
functions. Thus, leaving my global variables empty.

Do you have any suggestions on how this could be fixed? I am trying
setTimeOut() at the moment but i would be glad to concider other
solutions as well..

I could provide code examples on request.

Thanks in advance!


[jQuery] Re: retrieve tr id

2009-10-09 Thread Chuk

I have changed things a little now.  Here is an example of my current
code:

$('#edit').click(function() {
  var clickedID = $('.clicked').id;
  transNo = ?;  //This is where I need to retrieve the row's id
  window.location = GL0002T?action=RtransBatchNo=!--%batch%--
transNo=+transNo;
});

tr id=1 class=row
  td id=Sequence1 style=width: 80px;1/td
  td id=Account1 style=width: 85px;400-04/td
  td id=Reference1 style=width: 100px;Ref2/td
  td id=Journal1 style=width: 114px;01/td
  td id=Description1 style=width: 250px; text-align: left;Desc2/
td
  td id=Debit1 style=width: 124px; text-align: right;100.00/td
  td id=Credit1 style=width: 124px; text-align: right;border-
right: none;.00/td
/tr

tr id=2 class=alt row
  td id=Sequence2 style=width: 80px;2/td
  td id=Account2 style=width: 85px;400-04/td
  td id=Reference2 style=width: 100px;Ref2/td
  td id=Journal2 style=width: 114px;01/td
  td id=Description2 style=width: 250px; text-align:
left;Desc2b/td
  td id=Debit2 style=width: 124px; text-align: right;.00/td
  td id=Credit2 style=width: 124px; text-align: right;border-
right: none;100.00/td
/tr

input type=button id=edit value=Edit Selected

When a row is clicked, I add a class of clicked to the row.  After
the row is clicked, I click on the Edit button and the .click()
function is executed.  I need to be able to retrieve the id of the
clicked row and pass it as a parameter to another program.  I hope
this clarifies things.

Thanks


[jQuery] Re: Jquery tabs load external file that uses a jquery plugin

2009-10-09 Thread dylanmac

Anyone?  No one can answer this?  Seems like this must come up all the
time.

On Oct 6, 1:17 pm, dylanmac dylan...@gmail.com wrote:
 I have a set of jqueryui tabs that, when clicked, load in their
 content dynamically. It works great, except that one of the pages uses
 a jquery plugin itself. This results in two issues:

 - The main page that holds the tabs throws an error when loaded
 because there is js that refers to elements that haven't loaded yet
 (those elements are in the external file that contains the code that
 relies on the plugin).

 - If I embed the js that triggers the plugin functionality into the
 external file, it is outside of the document.ready function from the
 main page and therefore isn't usable.

 Basically I am looking for a technique that allows me to ajax load an
 external html file into the DOM while not crapping out the main page
 itself because JS that is already there is expecting HTML which is not
 yet there.

 Thanks.


[jQuery] [autocomplete] Pressing Enter On Non-Matched Substring When firstResult:false does not hide the Autocompletion List.

2009-10-09 Thread msordo

Hi all.

My autocompletion code is:

$(#suggest).autocomplete(tags, {selectFirst: false, multiple: true,
multipleSeparator: ,,});

When I start typing in my text field, for instance Nou, the
autocompletion gives me Nouvelle, Nouveau... But what I want actually
is to search for Nou. So I press enter, my search engine returns
some results, but the autocompletion list is still there, unless I
press Esc.  Isn't there any other option to disable/hide the
autocompletion list when Enter is pressed (out of the autocompletion
list, of course)?

Thanks a lot


[jQuery] Jcarousel Add Link

2009-10-09 Thread cMantilla

I would like to use the carousel at
http://sorgalla.com/projects/jcarousel/examples/dynamic_javascript.html
My company needs a product slider and it works well with a few changes
to the CSS.
I am having trouble however adding links to the images. If someone
could show me a function or how to declare a href's in this code, it
would be greatly appreciated.

Mantilla


[jQuery] Re: Adding Multi-Tier to Drop Menu?

2009-10-09 Thread ehime

I was injecting this into the code, it Origionally was not there.
[code]
$(this).find('ul:first:hidden').css({visibility:
visible,display: none}).show(400);
$(this).find('ul:first').css({visibility: hidden});
[/code]

I had taken a menu system that I liked and thought worked well, and
was
trying to restructure it. I am not very adept at JQuery though, my
skills are
firmly planted in PHP API dev. If I was to just use this code (below)
how
could I make it work?? I really don't want to scrap the entire idea
just to
rewrite it, it'd take me forver, lol. Thanks for taking this on,
serious
brownie  points awarded.

-jd

[code]
 $(document).ready(function(){

$(ul.subnav).parent().append(span/span); //Only shows
drop
down trigger when js is enabled - Adds empty span tag after ul.subnav

$(ul.topnav li span).hover(function() { //When trigger is
onHover...

//Following events are applied to the subnav itself
(moving subnav
up and down)
$(this).parent().find(ul.subnav).slideDown
('fast').show(); //Drop
down the subnav on click

$(this).parent().hover(function() {
}, function(){
$(this).parent().find(ul.subnav).slideUp
('slow'); //When the
mouse hovers out of the subnav, move it back up

});

//Following events are applied to the trigger (Hover
events for the
trigger)
}).hover(function() {
$(this).addClass(subhover); //On hover over,
add class subhover
}, function(){  //On Hover Out
$(this).removeClass(subhover); //On hover
out, remove class
subhover
});

});
[/code]



On Oct 8, 3:29 pm, Charlie charlie...@gmail.com wrote:
 taking a stab at this, code seems quite strange to me
 First- check your context of this , in your span.hover you have a this 
 looking for a child of the span that is a UL
 sildedown().show()  - not necessary, slidedown already takes a hidden element 
 and shows it
 the css keeps functioning on the same ul:first and is going in circles with 
 display: none ,then show, and next line on same element visibility: hidden
 I think it may be your interpretation of this  ?? In your span.hover() 
 function  this will always be the span
 Your parent hover function inside the child hover function seems strange to 
 me. Realistically I think you chose the wrong element to start your menu 
 hovers with. When you hover an li, the UL that opens is within that li, 
 therefore as you move mouse down( or sideways) into subs you haven't left the 
 hovered element
 I'd suggest scrapping everything and start over, using your li's as the 
 hovering element
 ehime wrote:I thought I could get this working with my first UL, doesn't seem 
 to be cooperating very much though. Anyone mind helping me find out how to 
 add the ability to traverse up to four tiers? Much MUCH appreciated! [code] 
 $(document).ready(function(){ 
 $(ul.subnav).parent().append(span/span); //Only shows drop down 
 trigger when js is enabled - Adds empty span tag after ul.subnav $(ul.topnav 
 li span).hover(function() { //When trigger is onHover... //Following events 
 are applied to the subnav itself (moving subnav up and down) 
 $(this).parent().find(ul.subnav).slideDown('fast').show(); //Drop down the 
 subnav on click $(this).find('ul:first:hidden').css({visibility: 
 visible,display: none}).show(400); 
 $(this).find('ul:first').css({visibility: hidden}); 
 $(this).parent().hover(function() { }, function(){ 
 $(this).parent().find(ul.subnav).slideUp('slow'); //When the mouse hovers 
 out of the subnav, move it back up }); //Following events are applied to the 
 trigger (Hover events for the trigger) }).hover(function() { 
 $(this).addClass(subhover); //On hover over, add class subhover }, 
 function(){ //On Hover Out $(this).removeClass(subhover); //On hover out, 
 remove class subhover }); }); And here's my body to body to see the syntax 
 I'm using [code] body div class=container div id=header div 
 class=disclaimer/div ul class=topnav lia href=#Lighting/a 
 ul class=subnav lia href=#PR LIGHTING/a ul class=subnav 
 lia href=http://omnisistem.com/layers/Lighting/prl- 
 ar.phpArchitectural/a/li lia 
 href=http://omnisistem.com/layers/Lighting/prl- 
 cp.phpCenterpieces/a/li lia 
 href=http://omnisistem.com/layers/Lighting/prl-dj.php;DJ Pro 
 Series/a/li lia href=http://omnisistem.com/layers/Lighting/prl- 
 fs.phpFollowspots/a/li lia 
 href=http://omnisistem.com/layers/Lighting/prl-my.php;Moving Yoke/a/li 
 /ul/li lia href=#NOVALIGHT/a ul class=subnav lia 
 href=http://omnisistem.com/layers/Lighting/nvl- 
 sl.phpSearchlights/a/li /ul/li lia href=#OMNILITE/a ul 
 class=subnav lia href=http://omnisistem.com/layers/Lighting/lit- 
 cr.phpControllers/a/li lia 
 href=http://omnisistem.com/layers/Lighting/lit-fx.php;Effect 
 Lighting/a/li lia href=http://omnisistem.com/layers/Lighting/lit- 
 

[jQuery] Re: $.post() speed

2009-10-09 Thread Adonis

ok, here is an effort to sum up the code..

*
function initialiseLegendLayerGroupEntry(a,b,c,d,e,f) {
var x;
$(#division_name).bind(click, function() {
if(this.value == sth) {
y=callFunction(a,b,c,d,e,f);
$.ajax({
type: POST,
url: /serverFunction/,
data: {project_name:d,layer_name:e,group_name:f},
success: function(msg){
$(#an entry point for html files that are
served).after(msg);
alert( $(#division where the wanted value is
stored).val() );  // this alert window pops up at the end.
x= $(#division where the wanted value is
stored).val();
 }
});
alert(x); // this pop up window is always empty. it opens while i
still receive print commands from my server script !
}
});
}

I think this code is a good example of my problem. Can you identify an
error somewhere?

thanks,

On Oct 8, 6:07 pm, MorningZ morni...@gmail.com wrote:
 You should should the specific $.post() code in detail, there's
 something you are missing because when you get back from the async
 call, everything (global variables, page objects) are fully available
 at that point... there's zero need to use setTimeout

 On Oct 8, 12:27 pm, Adonis achrysoch...@hotmail.com wrote:

  Dan,

  I used a $.ajax() call with a callback - success: function(msg) etc.
  but still it does not work the way I want to.
  from the server side i am using,

  *
  return render_to_response(blah.html,{ 'project_id':project_id },
  context_instance = RequestContext(request))
  *
  putting the project_id in a divinput id=klain value=project_id /

  /div

  and if the ajax call is successfull i do this,

  *
  alert( $(#klain).val() );
  *

  The alert window does pop up, but after the rest of the functions in
  the code have been read. I somehow need to delay the javascript
  parsing, until the input of the division in the html that is rendered
  gets the project_id value. This is why i am looking into setTimeOut
  () js function.

  cheers,

  On Oct 8, 2:08 pm, Dan G. Switzer, II dswit...@pengoworks.com
  wrote:

   Adonis,
   The $.post() function is asynchronous (by default) when your code hits a
   $.post() call, it'll keep executing code. In order to do something with 
   the
   results of your AJAX call, you'll want to use the callback option--which 
   is
   a function run when the AJAX call is completed.

   -Dan

   On Thu, Oct 8, 2009 at 7:14 AM, Adonis achrysoch...@hotmail.com wrote:

I am not entirely sure if i am using proper definitions here, but here
it goes..

I have $.post() inside javascript functions. If ajax is successfull,
it returns data from the server. I am trying to assign this data  to
javascript global variables. The problem is that my global javascript
variables end up to be empty. It seems it takes time for the ajax to
return the data and by the time the server data is returned, the
browser has comploted reading through the rest of the javascript
functions. Thus, leaving my global variables empty.

Do you have any suggestions on how this could be fixed? I am trying
setTimeOut() at the moment but i would be glad to concider other
solutions as well..

I could provide code examples on request.

Thanks in advance!


[jQuery] Re: retrieve tr id

2009-10-09 Thread brian

On Fri, Oct 9, 2009 at 12:00 PM, Chuk violinssoundc...@gmail.com wrote:

 I have changed things a little now.  Here is an example of my current
 code:

 $('#edit').click(function() {
  var clickedID = $('.clicked').id;
  transNo = ?;  //This is where I need to retrieve the row's id
  window.location = GL0002T?action=RtransBatchNo=!--%batch%--
transNo=+transNo;
 });

 tr id=1 class=row
  td id=Sequence1 style=width: 80px;1/td
  td id=Account1 style=width: 85px;400-04/td
  td id=Reference1 style=width: 100px;Ref2/td
  td id=Journal1 style=width: 114px;01/td
  td id=Description1 style=width: 250px; text-align: left;Desc2/
 td
  td id=Debit1 style=width: 124px; text-align: right;100.00/td
  td id=Credit1 style=width: 124px; text-align: right;border-
 right: none;.00/td
 /tr

 tr id=2 class=alt row
  td id=Sequence2 style=width: 80px;2/td
  td id=Account2 style=width: 85px;400-04/td
  td id=Reference2 style=width: 100px;Ref2/td
  td id=Journal2 style=width: 114px;01/td
  td id=Description2 style=width: 250px; text-align:
 left;Desc2b/td
  td id=Debit2 style=width: 124px; text-align: right;.00/td
  td id=Credit2 style=width: 124px; text-align: right;border-
 right: none;100.00/td
 /tr

 input type=button id=edit value=Edit Selected

 When a row is clicked, I add a class of clicked to the row.  After
 the row is clicked, I click on the Edit button and the .click()
 function is executed.  I need to be able to retrieve the id of the
 clicked row and pass it as a parameter to another program.  I hope
 this clarifies things.

 Thanks


You're still using an ID that begins with (consists entirely of, in
this case) a digit. Change it to something like:

tr id=TransNo1 class=row
 td id=Sequence1 style=width: 80px;1/td
 td id=Account1 style=width: 85px;400-04/td
 td id=Reference1 style=width: 100px;Ref2/td
 td id=Journal1 style=width: 114px;01/td
 td id=Description1 style=width: 250px; text-align: left;Desc2/
td
 td id=Debit1 style=width: 124px; text-align: right;100.00/td
 td id=Credit1 style=width: 124px; text-align: right;border-
right: none;.00/td
/tr

Of course, if you then want to get the digit from the ID of the TR
with class clicked for use elsewhere, you'll need to parse it out of
the string.

You didn't answer my question about the actual values you want to send
to the sever. For account, reference, and journal, do you want
Account1, Reference1, and Journal1? Or, do you really want to
send 400-04, Ref2, and 01?

In any case, it'd be more secure to just send just the database
primary key and have your server-side logic fetch the data you want to
edit. And, in that case, you could append the primary key to your TR
iD (eg. TransNo_YOUR_PRIMARY_KEY_HERE). But it's difficult to say
without knowing more about the server-side logic.

Also, you could probably get rid of the class row, as all TRs are
rows by definition. You could change the CSS rule for class row to
match tr (of this particular table, perhaps) and keep the tr.alt rule.


[jQuery] Re: $.post() speed

2009-10-09 Thread MorningZ

You've got the x set inside the callback and are trying to alert it
*before* it gets back from it the $.post call, hence it's empty

so if you have

$.post( ... do ajax stuff to variable x . )
alert(x);  // ---  this gets run right away, the asynchronous call of
$.post  doesn't wait to finish before going to the next line

so another way of looking at it:

var foo = 1;
$.post(  some ajax call that takes 2 seconds to set foo to 99  );
alert(foo);

that is going to alert 1 each and every time, because JavaScript
isn't going to wait before doing the alert

does that help?




On Oct 9, 12:18 pm, Adonis achrysoch...@hotmail.com wrote:
 ok, here is an effort to sum up the code..

 *
 function initialiseLegendLayerGroupEntry(a,b,c,d,e,f) {
 var x;
     $(#division_name).bind(click, function() {
         if(this.value == sth) {
             y=callFunction(a,b,c,d,e,f);
             $.ajax({
                 type: POST,
                 url: /serverFunction/,
                 data: {project_name:d,layer_name:e,group_name:f},
                 success: function(msg){
                     $(#an entry point for html files that are
 served).after(msg);
                     alert( $(#division where the wanted value is
 stored).val() );  // this alert window pops up at the end.
                     x= $(#division where the wanted value is
 stored).val();
                      }
             });
     alert(x); // this pop up window is always empty. it opens while i
 still receive print commands from my server script !
         }
     });

 }

 I think this code is a good example of my problem. Can you identify an
 error somewhere?

 thanks,

 On Oct 8, 6:07 pm, MorningZ morni...@gmail.com wrote:

  You should should the specific $.post() code in detail, there's
  something you are missing because when you get back from the async
  call, everything (global variables, page objects) are fully available
  at that point... there's zero need to use setTimeout

  On Oct 8, 12:27 pm, Adonis achrysoch...@hotmail.com wrote:

   Dan,

   I used a $.ajax() call with a callback - success: function(msg) etc.
   but still it does not work the way I want to.
   from the server side i am using,

   *
   return render_to_response(blah.html,{ 'project_id':project_id },
   context_instance = RequestContext(request))
   *
   putting the project_id in a divinput id=klain value=project_id /

   /div

   and if the ajax call is successfull i do this,

   *
   alert( $(#klain).val() );
   *

   The alert window does pop up, but after the rest of the functions in
   the code have been read. I somehow need to delay the javascript
   parsing, until the input of the division in the html that is rendered
   gets the project_id value. This is why i am looking into setTimeOut
   () js function.

   cheers,

   On Oct 8, 2:08 pm, Dan G. Switzer, II dswit...@pengoworks.com
   wrote:

Adonis,
The $.post() function is asynchronous (by default) when your code hits a
$.post() call, it'll keep executing code. In order to do something with 
the
results of your AJAX call, you'll want to use the callback 
option--which is
a function run when the AJAX call is completed.

-Dan

On Thu, Oct 8, 2009 at 7:14 AM, Adonis achrysoch...@hotmail.com wrote:

 I am not entirely sure if i am using proper definitions here, but here
 it goes..

 I have $.post() inside javascript functions. If ajax is successfull,
 it returns data from the server. I am trying to assign this data  to
 javascript global variables. The problem is that my global javascript
 variables end up to be empty. It seems it takes time for the ajax to
 return the data and by the time the server data is returned, the
 browser has comploted reading through the rest of the javascript
 functions. Thus, leaving my global variables empty.

 Do you have any suggestions on how this could be fixed? I am trying
 setTimeOut() at the moment but i would be glad to concider other
 solutions as well..

 I could provide code examples on request.

 Thanks in advance!


[jQuery] Re: Dynamic images - how can I tell when they are ready to be viewed by the browser?

2009-10-09 Thread MorningZ

Is there a way I can tell when the requested image is ready to be
viewed/rendered?

an img tag has an onload event that you can listen for



On Oct 9, 11:08 am, dowhilesomething dowhilesometh...@gmail.com
wrote:
 I'm building a slide show using jQuery and I am having sporadic issues
 displaying an image before it's fully loaded.

 e.g. Images are stored in a database (binary not the image path) and I
 use an image handler to retrieve the images.

 Because the amount of images for each slide show is not predetermined,
 I load the first image and next image initially, then each time a
 slide (next) is selected I fetch that slide and the next slide.  I
 don't want to pre-load each image as there could be well over 50-60
 images and some users might only view a handful of slides. Thus
 wasting bandwidth and resources.

 Is there a way I can tell when the requested image is ready to be
 viewed/rendered?  The reason for this is that all images are not fixed
 width/height and to place them in the middle of the stage I need to
 check the height/width so I can add it to the container I am
 positioning.

 Any ideas/thoughts on this would be greatly appreciated.

 Regards, David


[jQuery] Re: retrieve tr id

2009-10-09 Thread MorningZ

var clickedID = $('.clicked').id;

there is no .id property of a jQuery object, that line would be an
issue as clickedID would be set to null



On Oct 9, 12:30 pm, brian bally.z...@gmail.com wrote:
 On Fri, Oct 9, 2009 at 12:00 PM, Chuk violinssoundc...@gmail.com wrote:

  I have changed things a little now.  Here is an example of my current
  code:

  $('#edit').click(function() {
   var clickedID = $('.clicked').id;
   transNo = ?;  //This is where I need to retrieve the row's id
   window.location = GL0002T?action=RtransBatchNo=!--%batch%--
 transNo=+transNo;
  });

  tr id=1 class=row
   td id=Sequence1 style=width: 80px;1/td
   td id=Account1 style=width: 85px;400-04/td
   td id=Reference1 style=width: 100px;Ref2/td
   td id=Journal1 style=width: 114px;01/td
   td id=Description1 style=width: 250px; text-align: left;Desc2/
  td
   td id=Debit1 style=width: 124px; text-align: right;100.00/td
   td id=Credit1 style=width: 124px; text-align: right;border-
  right: none;.00/td
  /tr

  tr id=2 class=alt row
   td id=Sequence2 style=width: 80px;2/td
   td id=Account2 style=width: 85px;400-04/td
   td id=Reference2 style=width: 100px;Ref2/td
   td id=Journal2 style=width: 114px;01/td
   td id=Description2 style=width: 250px; text-align:
  left;Desc2b/td
   td id=Debit2 style=width: 124px; text-align: right;.00/td
   td id=Credit2 style=width: 124px; text-align: right;border-
  right: none;100.00/td
  /tr

  input type=button id=edit value=Edit Selected

  When a row is clicked, I add a class of clicked to the row.  After
  the row is clicked, I click on the Edit button and the .click()
  function is executed.  I need to be able to retrieve the id of the
  clicked row and pass it as a parameter to another program.  I hope
  this clarifies things.

  Thanks

 You're still using an ID that begins with (consists entirely of, in
 this case) a digit. Change it to something like:

 tr id=TransNo1 class=row
  td id=Sequence1 style=width: 80px;1/td
  td id=Account1 style=width: 85px;400-04/td
  td id=Reference1 style=width: 100px;Ref2/td
  td id=Journal1 style=width: 114px;01/td
  td id=Description1 style=width: 250px; text-align: left;Desc2/
 td
  td id=Debit1 style=width: 124px; text-align: right;100.00/td
  td id=Credit1 style=width: 124px; text-align: right;border-
 right: none;.00/td
 /tr

 Of course, if you then want to get the digit from the ID of the TR
 with class clicked for use elsewhere, you'll need to parse it out of
 the string.

 You didn't answer my question about the actual values you want to send
 to the sever. For account, reference, and journal, do you want
 Account1, Reference1, and Journal1? Or, do you really want to
 send 400-04, Ref2, and 01?

 In any case, it'd be more secure to just send just the database
 primary key and have your server-side logic fetch the data you want to
 edit. And, in that case, you could append the primary key to your TR
 iD (eg. TransNo_YOUR_PRIMARY_KEY_HERE). But it's difficult to say
 without knowing more about the server-side logic.

 Also, you could probably get rid of the class row, as all TRs are
 rows by definition. You could change the CSS rule for class row to
 match tr (of this particular table, perhaps) and keep the tr.alt rule.


[jQuery] Re: retrieve tr id

2009-10-09 Thread Chuk

So, I should probably populate the name or title of the tr with the
sequence number, which is currently the id.  You're right about
getting rid of the class row.  I'll take care of that.

Perhaps there is a better way than what I've been trying.  Each row
has a distinct sequence number that I've used as the id, but could use
as other things.  When I click edit, I just want to pass that number
back to the server, whether it be the id, title, class name, value, or
whatever.  I would rather not have to parse the number back out if at
all possible even on the server side.

Thanks for your help


[jQuery] loading message shows up after page has loaded

2009-10-09 Thread sdtacoma

Hello,

I am using jQuery and BlockUI to display a Loading... message to the
user while the page is loading.

The problem is that the Loading... message seems to show up AFTER
the page has loaded, not during load. Shouldn't the document.ready
fire sooner than that?

What am I doing wrong?


script
$(document).ready(function() {
$.blockUI();
setTimeout($.unblockUI, 2000);
});
/script




[jQuery] Re: Debug says I'm missing a paren, but all parens are matched!

2009-10-09 Thread hsfrey

Giovanni:

   Thanks for the suggestion, but, unfortunately it doesn't do
anything . :-(

  However, I tried the following:

$([id$=+b1+] input).val(Hide?Show:Hide);

   This actually does switch the label to show, but not back to
hide when clicked again.
BUT - I'm as confused about why it DOES work the first time as about
why it doesn't subsequently. g

   The attribute value isn't actually the First element of the
input tag; type is. Why does .val change the Second element?
That's why I was using .attr before instead of .val)
(Remember, the target is input type=button value=Hide onclick=togl
('box1')/)

   Also - The Docs say that .val with one argument GETS the value of
the first matched element.
Why does this call with one argument SET the first element?
Or, DOES it set the element? Even though it LOOKS like it's set, it
ACTS on subsequent calls as though it hasn't been.

Harvey


On Oct 8, 11:19 pm, Giovanni Battista Lenoci gian...@gmail.com
wrote:
 hsfrey ha scritto:

  function togl(b1) {
     var t1 = document.getElementById(b1).getElementsByTagName(input);
     var labl = t1[0].value;
     t1[0].value = labl==Hide?Show:Hide;
  ...
  }

     In addition, rather than just Match the ID, I want to match the ID
  which ENDS in the string contained in b1.
  A simple #+b1 won't do that, which is why I used [[id$=+b1=].

  The target of the JS is the html:
  div id=box1 ...
  input type=button value=Hide onclick=togl('box1')/
  ...
  /div

 If I understood, in your markup the button will have an id like
 something_box1, right?

 If you can change your markup, i suggest to you to group elements using
 a class. by the way your first code:

 $(([id$=+b1+]) input).attr(value, attr(value)==Hide?Show:Hide);

 should be

 $([id$=+b1+] input).val($(this).val()==Hide?Show:Hide);

 Bye

 (i've not tested the code, but I think is right :P)

 --
 gianiaz.net - web solutions
 via piedo, 58 - 23020 tresivio (so) - italy
 +39 347 7196482


[jQuery] Re: Unexpected $(document).ready() behavior when jQuery is loaded after the page

2009-10-09 Thread Sasha Sklar

I came across this issue while looking at LAB.js. Is this known to be
fixed in latest nightly? From what I can tell document.ready still
won't fire if jQuery is loaded after DOM Ready has occurred. Here's my
test code:

// make sure dom ready has already happened by attaching an event to
old school window.onload
window.onload = function() {
console.log('window onload fires');
var url = http://code.jquery.com/jquery-nightly.js;;
var head = document.getElementsByTagName(head)[0], done = false;
var script = document.createElement(script);
script.src = url;

script.onload = script.onreadystatechange = function() {
if (!done  (!this.readyState || this.readyState == loaded ||
this.readyState == complete)) {
console.log('jquery nightly is done loading');
done = true;
$(document).ready(function() {
console.log('dom ready functions should fire 
now');
});

}
};

head.appendChild(script);
};

- Sasha

On Oct 8, 5:18 pm, Michael Geary m...@mg.to wrote:
 Failing to run the document ready functions is a bug in jQuery 1.3.2 that is
 fixed in the current svn. It now calls document.ready listeners even if you
 load jQuery and subsequent document ready functions dynamically.

 At least I *assume* that it's a bug that was fixed, and not just an
 accidental improvement! :-)

 Try your code with the nightly you can get here:

 http://docs.jquery.com/Downloading_jQuery#Nightly_Builds

 Regarding the onload for the script, the best way to handle this is to make
 a custom copy of jquery.js or jquery.min.js and add a line to the end:

 window.jQueryLoaded  jQueryLoaded();

 Then you provide a global jQueryLoaded() function before loading jQuery, and
 that has your other initialization code (using document ready if you want
 with the new jQuery code).

 Or you can add whatever initialization code you want at the end of your
 jquery.js file.

 -Mike

 p.s. Speaking of jQuery svn, are there nightly builds or the like

 On Thu, Oct 8, 2009 at 6:11 AM, Ryan Crumley crum...@gmail.com wrote:

  Rob,

  Point taken about using onLoad for a script tag possibly not being
  supported. In this case however that part of the code is working fine.
  The issue I am having is related to jQuery being added to a page after
  the page has completed loading. When this happens ready listeners are
  never executed. If jQuery is present when the page loads then ready
  listeners are executed as expected.

  Ryan

  On Oct 8, 12:45 am, RobG robg...@gmail.com wrote:
   On Oct 8, 10:04 am, Ryan Crumley crum...@gmail.com wrote:

I am experiencing unexpected behavior using $(document).ready() on a
page where I inject jQuery after the page has loaded and then attach
listeners to the ready event. The ready() event is never called using
Firefox and Safari however it is called using IE.
   [...]
                function loadjquery() {
                        var url = 
 http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/
jquery.js;
                        var head =
  document.getElementsByTagName(head)[0], done = false;
                        var script = document.createElement(script);
                        script.src = url;

                        script.onload = script.onreadystatechange =
  function() {

   There is no onload attribute for script elements defined in HTML 4.01,
   therefore you should not expect that a script element will fire a load
   event. The fact that some browsers do and some don't should be enough
   to tell you that browser behaviour is inconsistent.  You are unlikely
   to be able to reliably fix that with script.

   If you want a reliable indicator that a script has finished loading
   and is ready for use, put a statement at the bottom like:

     var SCRIPT_LOADED = true;

   --
   Rob


[jQuery] Re: Unexpected $(document).ready() behavior when jQuery is loaded after the page

2009-10-09 Thread Sasha Sklar

Is this known to be fixed in the nightly? I wrote a quick test, seems
like document.ready still doesn't fire if jQuery is loaded after DOM
Ready:

// make sure dom ready has already occured by attaching an event to
old school window.onload
window.onload = function() {
console.log('window onload fires');
var url = http://code.jquery.com/jquery-nightly.js;;
var head = document.getElementsByTagName(head)[0], done = false;
var script = document.createElement(script);
script.src = url;

script.onload = script.onreadystatechange = function() {
if (!done  (!this.readyState || this.readyState == loaded ||
this.readyState == complete)) {
console.log('jquery nightly is done loading');
done = true;
$(document).ready(function() {
console.log('dom ready functions should fire 
now');
});

}
};

head.appendChild(script);
};

Maybe I'm missing something? I think this is going to be a bigger
issue as more people start to use things like LAB.js and EFWS to
dynamically load js.

- Sasha Sklar

On Oct 8, 5:18 pm, Michael Geary m...@mg.to wrote:
 Failing to run the document ready functions is a bug in jQuery 1.3.2 that is
 fixed in the current svn. It now calls document.ready listeners even if you
 load jQuery and subsequent document ready functions dynamically.

 At least I *assume* that it's a bug that was fixed, and not just an
 accidental improvement! :-)

 Try your code with the nightly you can get here:

 http://docs.jquery.com/Downloading_jQuery#Nightly_Builds

 Regarding the onload for the script, the best way to handle this is to make
 a custom copy of jquery.js or jquery.min.js and add a line to the end:

 window.jQueryLoaded  jQueryLoaded();

 Then you provide a global jQueryLoaded() function before loading jQuery, and
 that has your other initialization code (using document ready if you want
 with the new jQuery code).

 Or you can add whatever initialization code you want at the end of your
 jquery.js file.

 -Mike

 p.s. Speaking of jQuery svn, are there nightly builds or the like

 On Thu, Oct 8, 2009 at 6:11 AM, Ryan Crumley crum...@gmail.com wrote:

  Rob,

  Point taken about using onLoad for a script tag possibly not being
  supported. In this case however that part of the code is working fine.
  The issue I am having is related to jQuery being added to a page after
  the page has completed loading. When this happens ready listeners are
  never executed. If jQuery is present when the page loads then ready
  listeners are executed as expected.

  Ryan

  On Oct 8, 12:45 am, RobG robg...@gmail.com wrote:
   On Oct 8, 10:04 am, Ryan Crumley crum...@gmail.com wrote:

I am experiencing unexpected behavior using $(document).ready() on a
page where I inject jQuery after the page has loaded and then attach
listeners to the ready event. The ready() event is never called using
Firefox and Safari however it is called using IE.
   [...]
                function loadjquery() {
                        var url = 
 http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/
jquery.js;
                        var head =
  document.getElementsByTagName(head)[0], done = false;
                        var script = document.createElement(script);
                        script.src = url;

                        script.onload = script.onreadystatechange =
  function() {

   There is no onload attribute for script elements defined in HTML 4.01,
   therefore you should not expect that a script element will fire a load
   event. The fact that some browsers do and some don't should be enough
   to tell you that browser behaviour is inconsistent.  You are unlikely
   to be able to reliably fix that with script.

   If you want a reliable indicator that a script has finished loading
   and is ready for use, put a statement at the bottom like:

     var SCRIPT_LOADED = true;

   --
   Rob


[jQuery] (validate) - How do I validate required fields before form submit

2009-10-09 Thread Alex

Hi

I am trying to use jquery: validation plugin by Jörn Zaefferer. Which
works really well I have to say.

The one limitation I am trying to work around is how I can run
validation for required fields before I submit a form.

At the moment I have to submit the form before I see the error
messages for required fields I would like to see them prior as the
user tabs through the form.

Thanks in advance

Alex


[jQuery] accessing a microsoft reporting table css classes

2009-10-09 Thread Steven Maglio
A co-worker and I have been trying to use jQuery to get access to frameset
frames within an iframe (that sounds awkward). He created a stackoverflow
question about it, but I thought this mailing list might have a greater
knowledge the problem space.

There is a screen shot link posted in the answers section (I don't have
enough points to update the question).

http://stackoverflow.com/questions/1541140/accessing-a-microsoft-reporting-table-css-classes-using-jquery

Any help you can give would be appreciated.

-- 
Steven Maglio
smagli...@gmail.com
twitter: http://twitter.com/smaglio81
linkedin: http://www.linkedin.com/in/stevenmaglio
tech-blog: http://stevenmaglio.blogspot.com/


[jQuery] Re: problem with multi-upload

2009-10-09 Thread James

In your includes, you have a jquery-latest.js and a jquery.js. Are
they both the jQuery library? Including two copies of the jQuery
libraries may cause issues.

On Oct 8, 5:05 pm, RAM r_ahims...@poczta.onet.pl wrote:
 I have the following lines on my main HTML page:

 script src=jquery-latest.js type=text/javascript
 language=javascript/script
 script src=jquery.MultiFile.js type=text/javascript
 language=javascript/script
 script src=jquery.form.js type=text/javascript
 language=javascript/script
 script src=jquery.js type=text/javascript language=javascript/
 script
 script src=jquery.blockUI.js type=text/javascript
 language=javascript/script
 script src=jquery.MetaData.js type=text/javascript
 language=javascript/script

 input type=file class=multi accept=gif|jpg|jpeg|jpe|bmp|png|mpg|
 mpeg|mov|avi|wmv

 The problem is that although I see input type=file control, I don't
 see associated list of file names below, so I cannot attach many
 files.
 Please help.


[jQuery] Re: retrieve tr id

2009-10-09 Thread jlcox

You can use the metadata plugin to get this pretty easily. Example:

script src=../scripts/jquery-1.3.2.min.js language=javascript
type=text/javascript/script
script src=../scripts/jquery.metadata.pack.js language=JavaScript
type=text/javascript/script
script language=JavaScript type=text/javascript
$(document).ready(function() {

$(._edit).click(function(){
var md = $(this).metadata();
alert(md.rowid);
});

});
/script
titleUntitled Document/title
/head
body
a href=javascript:; class=_edit {rowid:'1'}Edit/abr/
a href=javascript:; class=_edit {rowid:'2'}Edit/abr/
a href=javascript:; class=_edit {rowid:'3'}Edit/abr/
/body


[jQuery] How to pass a Jquery variable to php?

2009-10-09 Thread LWD

Hi!
How can i pass a jquery variable to a php variable?
Or pass a jquery variable in GET or POST.
Thanks!!


[jQuery] Efficiently Detect When Sibling Elements Overlap

2009-10-09 Thread BrianMB

Example:

div id=bignbsp;/div
div class=smallnbsp;/div
div class=smallnbsp;/div
div class=smallnbsp;/div
div class=smallnbsp;/div
div class=smallnbsp;/div
!-- ...and so on --


#big is positioned absolutely behind a portion of the .smalls, but
is not a parent element.

I have been doing this:

   var smallArray = [];

   var $big = $('#big');
   var $bigPos = $big.offset();

   $('div.small').each(function() {
var $this = $(this);
var $thisPos = $this.offset();

if(
$thisPos.left = $bigPos.left 
$thisPos.left = $bigPos.left+$big.outerWidth() 

$thisPos.top = $bigPos.top 
$thisPos.top = $bigPos.top+$big.outerHeight()
) smallArray.push($this);
});

...but this seems kludgy.  Am I missing out on some methods of jQuery
or vanilla JavaScript that will allow me to do this in a more elegant
 efficient manner?

Thanks ahead for any help you can provide.


[jQuery] XMLHttpRequest in jQuery

2009-10-09 Thread Nits

I have the following piece of code for XMLHttpRequest. I want to write
the jQuery equivalent for the same. Since I am new to jQuery, any help
would be great!!

body
script type=text/javascript
function ajaxFunction()
{
var xmlhttp;
xmlhttp=new XMLHttpRequest();
}
xmlhttp.onreadystatechange=function()
{
if(xmlhttp.readyState==4)
{
document.form1.time.value=xmlhttp.responseText;
}
}
xmlhttp.open(GET, https://ondemand.abc.com/xyz/sessionServlet
,true);
xmlhttp.send(null);
}
/script

form id=form1 runat=server
div
Name: input type=text name=username onkeyup=ajaxFunction(); /
Time: input type=text name=time /

/div
/form
/body

And when I run my application and type something in the textbox, i get
the following value in the adjacent ones'
htmlscript window.location = 'http://localhost/sso/signonServlet?
sessionID=643267726466939704344537951412a2a';/script/html


[jQuery] Using jQuery Ajax commands with Chrome Extension's local files.

2009-10-09 Thread Wesley Johnson

I'm using jQuery 1.3.2 and Google Chrome 4.0.221.6 - The issue I'm
having is trying to load an xml file, that is nested inside the Chrome
Extension. I realize that the xml file is local and typically you
cannot access local files through javascript. However, when using
files through Chrome Extensions, the file is not accessed with
file:///, but rather chrome-extension://app key/
filename.fileext. Javascript seems to recognize this as a url and
happily sends it to the browser, where chrome fetches the file.
However, when using these files with jQuery's Ajax commands, it fails.

Note: It doesn't fail like a normal local file access denied
Javascript error, it simply fails and just says error. Is there a
way around this?
Thanks!

Here is some example code to represent the problem:

$(function(){
var xmlURL = chrome.extension.getURL(markups.xml);
$.ajax({
type: GET,
url: xmlURL,
dataType: xml,
success: function(xml){
 //do stuff
},
error: function(xml, message, object){
console.log(message); //produces error
}
});
});


[jQuery] Re: XMLHttpRequest in jQuery

2009-10-09 Thread Jeffrey Kretz

This would be one way of doing that with jQuery:

$.ajax({
   url:https://ondemand.abc.com/xyz/sessionServlet;,
   success:function(results){$(#time).val(results);}
});

-Original Message-
From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
Behalf Of Nits
Sent: Friday, October 09, 2009 12:56 PM
To: jQuery (English)
Subject: [jQuery] XMLHttpRequest in jQuery


I have the following piece of code for XMLHttpRequest. I want to write
the jQuery equivalent for the same. Since I am new to jQuery, any help
would be great!!

body
script type=text/javascript
function ajaxFunction()
{
var xmlhttp;
xmlhttp=new XMLHttpRequest();
}
xmlhttp.onreadystatechange=function()
{
if(xmlhttp.readyState==4)
{
document.form1.time.value=xmlhttp.responseText;
}
}
xmlhttp.open(GET, https://ondemand.abc.com/xyz/sessionServlet
,true);
xmlhttp.send(null);
}
/script

form id=form1 runat=server
div
Name: input type=text name=username onkeyup=ajaxFunction(); /
Time: input type=text name=time /

/div
/form
/body

And when I run my application and type something in the textbox, i get
the following value in the adjacent ones'
htmlscript window.location = 'http://localhost/sso/signonServlet?
sessionID=643267726466939704344537951412a2a';/script/html



[jQuery] Remove content of div if on /login.php?action=logout page

2009-10-09 Thread Painstik

Can it be done?

If user comes to this page: mypage.com/login.php?action=logout
To remove this div conent: div id=LoginContainer style=


Please help...


[jQuery] Re: XMLHttpRequest in jQuery

2009-10-09 Thread Nits

Can you explain this code to me and also any links for further
study...

On Oct 9, 3:35 pm, Jeffrey Kretz jeffkr...@hotmail.com wrote:
 This would be one way of doing that with jQuery:

 $.ajax({
    url:https://ondemand.abc.com/xyz/sessionServlet;,
    success:function(results){$(#time).val(results);}



 });
 -Original Message-
 From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On

 Behalf Of Nits
 Sent: Friday, October 09, 2009 12:56 PM
 To: jQuery (English)
 Subject: [jQuery] XMLHttpRequest in jQuery

 I have the following piece of code for XMLHttpRequest. I want to write
 the jQuery equivalent for the same. Since I am new to jQuery, any help
 would be great!!

 body
 script type=text/javascript
 function ajaxFunction()
 {
 var xmlhttp;
 xmlhttp=new XMLHttpRequest();
 }
 xmlhttp.onreadystatechange=function()
 {
 if(xmlhttp.readyState==4)
 {
 document.form1.time.value=xmlhttp.responseText;
 }
 }
 xmlhttp.open(GET,https://ondemand.abc.com/xyz/sessionServlet
 ,true);
 xmlhttp.send(null);
 }
 /script

 form id=form1 runat=server
 div
 Name: input type=text name=username onkeyup=ajaxFunction(); /
 Time: input type=text name=time /

 /div
 /form
 /body

 And when I run my application and type something in the textbox, i get
 the following value in the adjacent ones'
 htmlscript window.location = 'http://localhost/sso/signonServlet?
 sessionID=643267726466939704344537951412a2a';/script/html- Hide 
 quoted text -

 - Show quoted text -


[jQuery] Re: Hide/Show if logged in

2009-10-09 Thread Painstik

 No it is not a trick question, I am new with jquery. I decided to do
it on server side, thanks for help.


[jQuery] Re: XMLHttpRequest in jQuery

2009-10-09 Thread Nits

Also I have to invoke this script on click of the link on the
page...how can I do it...

On Oct 9, 3:35 pm, Jeffrey Kretz jeffkr...@hotmail.com wrote:
 This would be one way of doing that with jQuery:

 $.ajax({
    url:https://ondemand.abc.com/xyz/sessionServlet;,
    success:function(results){$(#time).val(results);}



 });
 -Original Message-
 From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On

 Behalf Of Nits
 Sent: Friday, October 09, 2009 12:56 PM
 To: jQuery (English)
 Subject: [jQuery] XMLHttpRequest in jQuery

 I have the following piece of code for XMLHttpRequest. I want to write
 the jQuery equivalent for the same. Since I am new to jQuery, any help
 would be great!!

 body
 script type=text/javascript
 function ajaxFunction()
 {
 var xmlhttp;
 xmlhttp=new XMLHttpRequest();
 }
 xmlhttp.onreadystatechange=function()
 {
 if(xmlhttp.readyState==4)
 {
 document.form1.time.value=xmlhttp.responseText;
 }
 }
 xmlhttp.open(GET,https://ondemand.abc.com/xyz/sessionServlet
 ,true);
 xmlhttp.send(null);
 }
 /script

 form id=form1 runat=server
 div
 Name: input type=text name=username onkeyup=ajaxFunction(); /
 Time: input type=text name=time /

 /div
 /form
 /body

 And when I run my application and type something in the textbox, i get
 the following value in the adjacent ones'
 htmlscript window.location = 'http://localhost/sso/signonServlet?
 sessionID=643267726466939704344537951412a2a';/script/html- Hide 
 quoted text -

 - Show quoted text -


[jQuery] Re: XMLHttpRequest in jQuery

2009-10-09 Thread Nits

I just did this with following code:

$(document).ready(function(){
$(a).click(function(event){

event.preventDefault();

$.ajax({
url:https://ondemand.abc.com/xyz/sessionServlet;,
success:function(results)
{
$(#time).val(results);
}
});
});
   });

What you say on this?

On Oct 9, 4:11 pm, Nits nitesh.ja...@gmail.com wrote:
 Also I have to invoke this script on click of the link on the
 page...how can I do it...

 On Oct 9, 3:35 pm, Jeffrey Kretz jeffkr...@hotmail.com wrote:



  This would be one way of doing that with jQuery:

  $.ajax({
     url:https://ondemand.abc.com/xyz/sessionServlet;,
     success:function(results){$(#time).val(results);}

  });
  -Original Message-
  From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On

  Behalf Of Nits
  Sent: Friday, October 09, 2009 12:56 PM
  To: jQuery (English)
  Subject: [jQuery] XMLHttpRequest in jQuery

  I have the following piece of code for XMLHttpRequest. I want to write
  the jQuery equivalent for the same. Since I am new to jQuery, any help
  would be great!!

  body
  script type=text/javascript
  function ajaxFunction()
  {
  var xmlhttp;
  xmlhttp=new XMLHttpRequest();
  }
  xmlhttp.onreadystatechange=function()
  {
  if(xmlhttp.readyState==4)
  {
  document.form1.time.value=xmlhttp.responseText;
  }
  }
  xmlhttp.open(GET,https://ondemand.abc.com/xyz/sessionServlet
  ,true);
  xmlhttp.send(null);
  }
  /script

  form id=form1 runat=server
  div
  Name: input type=text name=username onkeyup=ajaxFunction(); /
  Time: input type=text name=time /

  /div
  /form
  /body

  And when I run my application and type something in the textbox, i get
  the following value in the adjacent ones'
  htmlscript window.location = 'http://localhost/sso/signonServlet?
  sessionID=643267726466939704344537951412a2a';/script/html- Hide 
  quoted text -

  - Show quoted text -- Hide quoted text -

 - Show quoted text -


[jQuery] Re: Remove content of div if on /login.php?action=logout page

2009-10-09 Thread James

It can be done, but why not just do it server-side if you can? It's
more reliable.

To do it in Javascript, you'd have to get the query string data from
the URL and act on it. There are no native Javascript functions for
directly fetching a part of the query string, so you'd have to make
one (thus, slower).
Here's one you can use:
http://kouloumbris.com/archives/usefull-javascript-functions

On Oct 9, 11:42 am, Painstik pains...@gmail.com wrote:
 Can it be done?

 If user comes to this page: mypage.com/login.php?action=logout
 To remove this div conent: div id=LoginContainer style=

 Please help...


[jQuery] Re: XMLHttpRequest in jQuery

2009-10-09 Thread Jeffrey Kretz

The code you have below looks, fine.  I'll break it down for you.

// When the document is ready.
$(document).ready(function(){

// Find ALL anchor tags on the page, and bind the click event.
$(a).click(function(event){

// Do not fire the default click event.
event.preventDefault();

// Call the ajax method
$.ajax({
url:https://ondemand.abc.com/xyz/sessionServlet;,   // To
this url.
success:function(results) {  // Fire
this when done.

// Look for the control with an ID of time and assign
the value.
$(#time).val(results);
}
});

});
});

-Original Message-
From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
Behalf Of Nits
Sent: Friday, October 09, 2009 3:23 PM
To: jQuery (English)
Subject: [jQuery] Re: XMLHttpRequest in jQuery


I just did this with following code:

$(document).ready(function(){
$(a).click(function(event){

event.preventDefault();

$.ajax({
url:https://ondemand.abc.com/xyz/sessionServlet;,
success:function(results)
{
$(#time).val(results);
}
});
});
   });

What you say on this?

On Oct 9, 4:11 pm, Nits nitesh.ja...@gmail.com wrote:
 Also I have to invoke this script on click of the link on the
 page...how can I do it...

 On Oct 9, 3:35 pm, Jeffrey Kretz jeffkr...@hotmail.com wrote:



  This would be one way of doing that with jQuery:

  $.ajax({
     url:https://ondemand.abc.com/xyz/sessionServlet;,
     success:function(results){$(#time).val(results);}

  });
  -Original Message-
  From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On

  Behalf Of Nits
  Sent: Friday, October 09, 2009 12:56 PM
  To: jQuery (English)
  Subject: [jQuery] XMLHttpRequest in jQuery

  I have the following piece of code for XMLHttpRequest. I want to write
  the jQuery equivalent for the same. Since I am new to jQuery, any help
  would be great!!

  body
  script type=text/javascript
  function ajaxFunction()
  {
  var xmlhttp;
  xmlhttp=new XMLHttpRequest();
  }
  xmlhttp.onreadystatechange=function()
  {
  if(xmlhttp.readyState==4)
  {
  document.form1.time.value=xmlhttp.responseText;
  }
  }
  xmlhttp.open(GET,https://ondemand.abc.com/xyz/sessionServlet
  ,true);
  xmlhttp.send(null);
  }
  /script

  form id=form1 runat=server
  div
  Name: input type=text name=username onkeyup=ajaxFunction(); /
  Time: input type=text name=time /

  /div
  /form
  /body

  And when I run my application and type something in the textbox, i get
  the following value in the adjacent ones'
  htmlscript window.location = 'http://localhost/sso/signonServlet?
  sessionID=643267726466939704344537951412a2a';/script/html- Hide
quoted text -

  - Show quoted text -- Hide quoted text -

 - Show quoted text -



[jQuery] Re: XMLHttpRequest in jQuery

2009-10-09 Thread James

Is https://ondemand.abc.com the same domain of the website that your
Javascript is calling from?
If not, then it won't work due to cross-domain restriction policies.

On Oct 9, 12:22 pm, Nits nitesh.ja...@gmail.com wrote:
 I just did this with following code:

 $(document).ready(function(){
             $(a).click(function(event){

             event.preventDefault();

             $.ajax({
             url:https://ondemand.abc.com/xyz/sessionServlet;,
             success:function(results)
                     {
                         $(#time).val(results);
                     }
             });
                         });
                        });

 What you say on this?

 On Oct 9, 4:11 pm, Nits nitesh.ja...@gmail.com wrote:

  Also I have to invoke this script on click of the link on the
  page...how can I do it...

  On Oct 9, 3:35 pm, Jeffrey Kretz jeffkr...@hotmail.com wrote:

   This would be one way of doing that with jQuery:

   $.ajax({
      url:https://ondemand.abc.com/xyz/sessionServlet;,
      success:function(results){$(#time).val(results);}

   });
   -Original Message-
   From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On

   Behalf Of Nits
   Sent: Friday, October 09, 2009 12:56 PM
   To: jQuery (English)
   Subject: [jQuery] XMLHttpRequest in jQuery

   I have the following piece of code for XMLHttpRequest. I want to write
   the jQuery equivalent for the same. Since I am new to jQuery, any help
   would be great!!

   body
   script type=text/javascript
   function ajaxFunction()
   {
   var xmlhttp;
   xmlhttp=new XMLHttpRequest();
   }
   xmlhttp.onreadystatechange=function()
   {
   if(xmlhttp.readyState==4)
   {
   document.form1.time.value=xmlhttp.responseText;
   }
   }
   xmlhttp.open(GET,https://ondemand.abc.com/xyz/sessionServlet
   ,true);
   xmlhttp.send(null);
   }
   /script

   form id=form1 runat=server
   div
   Name: input type=text name=username onkeyup=ajaxFunction(); /
   Time: input type=text name=time /

   /div
   /form
   /body

   And when I run my application and type something in the textbox, i get
   the following value in the adjacent ones'
   htmlscript window.location = 'http://localhost/sso/signonServlet?
   sessionID=643267726466939704344537951412a2a';/script/html- Hide 
   quoted text -

   - Show quoted text -- Hide quoted text -

  - Show quoted text -




[jQuery] Re: XMLHttpRequest in jQuery

2009-10-09 Thread Nits

Its a different domain, but its working...

On Oct 9, 4:42 pm, James james.gp@gmail.com wrote:
 Ishttps://ondemand.abc.comthe same domain of the website that your
 Javascript is calling from?
 If not, then it won't work due to cross-domain restriction policies.

 On Oct 9, 12:22 pm, Nits nitesh.ja...@gmail.com wrote:



  I just did this with following code:

  $(document).ready(function(){
              $(a).click(function(event){

              event.preventDefault();

              $.ajax({
              url:https://ondemand.abc.com/xyz/sessionServlet;,
              success:function(results)
                      {
                          $(#time).val(results);
                      }
              });
                          });
                         });

  What you say on this?

  On Oct 9, 4:11 pm, Nits nitesh.ja...@gmail.com wrote:

   Also I have to invoke this script on click of the link on the
   page...how can I do it...

   On Oct 9, 3:35 pm, Jeffrey Kretz jeffkr...@hotmail.com wrote:

This would be one way of doing that with jQuery:

$.ajax({
   url:https://ondemand.abc.com/xyz/sessionServlet;,
   success:function(results){$(#time).val(results);}

});
-Original Message-
From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On

Behalf Of Nits
Sent: Friday, October 09, 2009 12:56 PM
To: jQuery (English)
Subject: [jQuery] XMLHttpRequest in jQuery

I have the following piece of code for XMLHttpRequest. I want to write
the jQuery equivalent for the same. Since I am new to jQuery, any help
would be great!!

body
script type=text/javascript
function ajaxFunction()
{
var xmlhttp;
xmlhttp=new XMLHttpRequest();
}
xmlhttp.onreadystatechange=function()
{
if(xmlhttp.readyState==4)
{
document.form1.time.value=xmlhttp.responseText;
}
}
xmlhttp.open(GET,https://ondemand.abc.com/xyz/sessionServlet
,true);
xmlhttp.send(null);
}
/script

form id=form1 runat=server
div
Name: input type=text name=username onkeyup=ajaxFunction(); /
Time: input type=text name=time /

/div
/form
/body

And when I run my application and type something in the textbox, i get
the following value in the adjacent ones'
htmlscript window.location = 'http://localhost/sso/signonServlet?
sessionID=643267726466939704344537951412a2a';/script/html- Hide 
quoted text -

- Show quoted text -- Hide quoted text -

   - Show quoted text -- Hide quoted text -

 - Show quoted text -


[jQuery] Re: Remove content of div if on /login.php?action=logout page

2009-10-09 Thread Painstik

I have found something... I used url parser i found... the code goes
like this...

$(document).ready(function() {
var match = jQuery.url.attr('relative');
var $b = 'login.php';
if(match == $b) {
$('#LoginContainer').remove()
};
});


Now it have to be changed so that every link that contains login.php
do the same thing... something like contains, but I cannot get it
work...


[jQuery] effect over images loaded via ajax (load method)

2009-10-09 Thread kknaru



i have some images loaded viad load method, something like this:

ul
   liimg src=1 alt= //li
   liimg src=2 alt= //li
/ul

on mouseover i want to append a div inside that li with a greater z-
index than the img so that div comes in front of the image(like a
bar with links for image editing).On mouseout i want it to disappear.
anyway...the problem is that those images are constantly changed
(loaded via load method) and i tried something like this:

$('img').live('mouseover',function(){
$(this).append('divlinks links/div');
});

$('img').live('mouseout',function(){
$('div').remove()
});

so...the actual problem is that when the mouse leaves the image area
and comes on the div area..the div disappear and appear continuously
so i can't click the links inside.Remember that the div comes over
the image(you know what i mean...it's a classic effect by now).
so..how should i do it right? thanks


[jQuery] Re: How to write this using jquery?

2009-10-09 Thread mhulse

Hi,

I think I need to rephrase my question.

Is there a jQuery version of this:

window[] : document[]

Basically, I am trying to target an swf in order to use AS3
ExternalInterface.addCallback()...

For some reason, doing $('object#id') does not work for the addCallback
().

The function I posted in message #1 works, but I just realized Safari
likes window[movieName] instead of document[movieName], and I hate
to browser sniff for anything.

Long story short, is there a nice jQuery, multi-browser compaitble,
way of targeting an swf that will play nice with
ExternalInterface.addCallback()?


[jQuery] Re: How to pass a Jquery variable to php?

2009-10-09 Thread ngreenwood6


depends on what you are trying to do. say you had this form:

form
input id=name type=text value=test /
/form

in jquery you can simply do this:

var name = $(#name).val();

you could then send a post or get using jquery to pass that variable on
submit


Leandro Dias wrote:
 
 
 Hi!
 How can i pass a jquery variable to a php variable?
 Or pass a jquery variable in GET or POST.
 Thanks!!
 
 

-- 
View this message in context: 
http://www.nabble.com/How-to-pass-a-Jquery-variable-to-php--tp25828076s27240p25828847.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] jquery tabs

2009-10-09 Thread ngreenwood6


I have created a tabbed item. There are 2 tabs on called first the other
second. Now when tab1 is clicked it should show the tab1 item and the same
for tab2. This is working however I have run into a little problem. Once the
page loads it should show what is on the tabs which is also working fine.
Now this page gets data from another source. When tab2 is clicked again it
reloads the data that was already there, which I do not want to happen. Say
for example if you were on tab1 reading a page and tab2 had a form to send
in an email. If you were to switch to tab2 it would show the form. Now if
you were to start filling in the form and click back on tab1 and then back
on tab2 again it would reload that page and erase what you had already
started. I do not want this to happen. Once the page loads I want the data
to be static. Is this possible using the tab ui, and if so how?
-- 
View this message in context: 
http://www.nabble.com/jquery-tabs-tp25828777s27240p25828777.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] jQuery/JSON forms issue: tries to download response

2009-10-09 Thread Jim

I have a file upload form (see end of email) that I am am processing
with jQuery so that it can be submitted via AJAX. When I click the
submit button, the form sends as it should (I can see the submit went
properly in the server logs). However, the response doesn't get
handled properly. In the response, I get a file download dialog
(firefox), although the page itself isn't replaced:

You have chosen to download
idcplg
which is a text/json
from: test-server.mydomain.edu
[...]


The code I have to setup javascript is as follows (there are no
javascript errors on page load or form submit):
.
  script type=text/javascript src=/content/jq/jquery.js/script
  script type=text/javascript src=/content/jq/jquery.form.js/
script
  SCRIPT type=text/javascript
// wait for the DOM to be loaded
$(document).ready(function()
{
  var options =
  {
dataType:  'json',
success:   function(data)
{
  var out = document.getElementById(OUTPUT);
  out.innerHTML = ;
  out.innerHTML += Response Text: + data + BR;
};
// bind form using 'ajaxForm'
$('#ReportUploadForm').ajaxForm(options);
  });
/SCRIPT


Any idea what I might be doing wrong?

Thanks,
-Jim Stapleton


The Form (some values are filled in with javascript after load, or
when items are selected from the select box):

FORM NAME=ReportUploadForm ACTION=/content/idcplg
ID=ReportUploadForm STYLE=PADDING: AUTO; MARGIN: AUTO;
method=POST enctype=multipart/form-data
  INPUT TYPE=HIDDENNAME=dSecurityGroup ID=dSecurityGroup
VALUE=Authenticated
  INPUT TYPE=HIDDENNAME=dDocAuthor  ID=dDocAuthor
VALUE=!--$dUser--
  INPUT TYPE=HIDDENNAME=dDocTypeID=dDocType
VALUE=Reports
  INPUT TYPE=HIDDENNAME=IdcService
VALUE=CHECKIN_UNIVERSAL
  INPUT TYPE=HIDDENNAME=dDocNameID=dDocName
VALUE=
  INPUT TYPE=HIDDENNAME=dDocTitle   ID=dDocTitle
VALUE=
  INPUT TYPE=HIDDENNAME=dDocAccount ID=dDocAccount
VALUE=
  INPUT TYPE=HIDDENNAME=IsJson  ID=IsJson
VALUE=1
  TABLE STYLE=MARGIN: AUTO; PADDING: AUTO;
TR
  TDReport/TDTDSELECT NAME=ReportType
ID=ReportType/SELECT/TD
/TRTR
  TDFile/TDTDINPUT TYPE=FILE ID=primaryFile
NAME=primaryFile/TD
/TR
  /TABLE
DIV STYLE=WIDTH=75%; MARGIN: AUTO; PADDING: AUTO; TEXT-ALIGN:
CENTER;
  INPUT TYPE=SUBMIT NAME=CHECKIN ID=CHECKIN VALUE=Check In
STYLE=MARGIN: AUTO; PADDING: AUTO;
/DIV
/FORM



Re: Re[jQuery] move content of div if on /login.php?action=logout page

2009-10-09 Thread ngreenwood6


yes, at the top of your page you would do:

$action = $_GET['action'];

Then inside of a script tag you would do this:

script type=text/javascript
var action = ?=$action;?;

//if you want to remove it you will do
$(#LoginContainer).remove();

//if you want to just hide it so you can maybe show it again later
$(#LoginContainer).hide();
/script

hopefully that will help. if you have any questions just let me know


Painstik-2 wrote:
 
 
 Can it be done?
 
 If user comes to this page: mypage.com/login.php?action=logout
 To remove this div conent: div id=LoginContainer style=
 
 
 Please help...
 
 

-- 
View this message in context: 
http://www.nabble.com/Remove-content-of-div-if-on--login.php-action%3Dlogout-page-tp25828313s27240p25828811.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: jQuery/JSON forms issue: tries to download response

2009-10-09 Thread MorningZ

it's supposed to be application/json, not text/json. set the
content type properly in your server side code and you'll be fine...
text/plain will work as well

On Oct 9, 8:12 pm, Jim stapleton...@gmail.com wrote:
 I have a file upload form (see end of email) that I am am processing
 with jQuery so that it can be submitted via AJAX. When I click the
 submit button, the form sends as it should (I can see the submit went
 properly in the server logs). However, the response doesn't get
 handled properly. In the response, I get a file download dialog
 (firefox), although the page itself isn't replaced:

 You have chosen to download
 idcplg
 which is a text/json
 from: test-server.mydomain.edu
 [...]

 The code I have to setup javascript is as follows (there are no
 javascript errors on page load or form submit):
 .
   script type=text/javascript src=/content/jq/jquery.js/script
   script type=text/javascript src=/content/jq/jquery.form.js/
 script
   SCRIPT type=text/javascript
     // wait for the DOM to be loaded
     $(document).ready(function()
     {
       var options =
       {
         dataType:      'json',
         success:       function(data)
         {
           var out = document.getElementById(OUTPUT);
           out.innerHTML = ;
           out.innerHTML += Response Text: + data + BR;
         };
         // bind form using 'ajaxForm'
         $('#ReportUploadForm').ajaxForm(options);
       });
     /SCRIPT

 Any idea what I might be doing wrong?

 Thanks,
 -Jim Stapleton

 The Form (some values are filled in with javascript after load, or
 when items are selected from the select box):

 FORM NAME=ReportUploadForm ACTION=/content/idcplg
 ID=ReportUploadForm STYLE=PADDING: AUTO; MARGIN: AUTO;
 method=POST enctype=multipart/form-data
   INPUT TYPE=HIDDEN    NAME=dSecurityGroup ID=dSecurityGroup
 VALUE=Authenticated
   INPUT TYPE=HIDDEN    NAME=dDocAuthor  ID=dDocAuthor
 VALUE=!--$dUser--
   INPUT TYPE=HIDDEN    NAME=dDocType    ID=dDocType
 VALUE=Reports
   INPUT TYPE=HIDDEN    NAME=IdcService
 VALUE=CHECKIN_UNIVERSAL
   INPUT TYPE=HIDDEN    NAME=dDocName    ID=dDocName
 VALUE=
   INPUT TYPE=HIDDEN    NAME=dDocTitle   ID=dDocTitle
 VALUE=
   INPUT TYPE=HIDDEN    NAME=dDocAccount ID=dDocAccount
 VALUE=
   INPUT TYPE=HIDDEN    NAME=IsJson      ID=IsJson
 VALUE=1
   TABLE STYLE=MARGIN: AUTO; PADDING: AUTO;
     TR
       TDReport/TDTDSELECT                 NAME=ReportType
 ID=ReportType/SELECT/TD
     /TRTR
       TDFile/TDTDINPUT TYPE=FILE ID=primaryFile
 NAME=primaryFile/TD
     /TR
   /TABLE
 DIV STYLE=WIDTH=75%; MARGIN: AUTO; PADDING: AUTO; TEXT-ALIGN:
 CENTER;
   INPUT TYPE=SUBMIT NAME=CHECKIN ID=CHECKIN VALUE=Check In
 STYLE=MARGIN: AUTO; PADDING: AUTO;
 /DIV
 /FORM


[jQuery] Re: How to write this using jquery?

2009-10-09 Thread mhulse

 Long story short, is there a nice jQuery, multi-browser compaitble,
 way of targeting an swf that will play nice with
 ExternalInterface.addCallback()?

THANK YOU JQUERY:

$('#id')[0];

Beautiful! :)

Cheers,
M


[jQuery] scrolling text within a div

2009-10-09 Thread macsig

Hello guys,
in a page I'm working on I have room for a div height not more than
200px, however I need to fit in a text that requires 300px and I don't
want to show the scroll-bar on the right side so I'm looking for some
ways/plug-ins in order to scroll the text within the div. I'd like to
be able to scroll down, to scroll up and to stop the scrolling.

Any suggestions about?


Thanks and have a nice weekend.


Sig


[jQuery] Plugin not working with latest JQuery Plugin

2009-10-09 Thread shapper

Hello,

I have been using on my projects the following Email Defuscator:
http://www.ia-stud.hiof.no/~joakims/projects/defuscator/

Strangely when using it with the latest JQuery version I get the
error:

this.each is not a function
[Break on this error] jQuery.fn.defuscate=function(settings){s...ace
(regex,'$...@$2'));var is_link=true;}\r\n

The Plugin code is really short:
http://plugins.jquery.com/files/jquery.defuscate.js_1.txt

Could someone, please, tell me what is wrong?

If you can suggest me a better plugin please let me know.

Thanks,
Miguel



[jQuery] Re: Unexpected $(document).ready() behavior when jQuery is loaded after the page

2009-10-09 Thread Michael Geary
It works fine for me in the current nightly. Here are a couple of test
cases:

http://mg.to/test/jquery/dynamic-nightly/jquery-dynamic.html

http://mg.to/test/jquery/dynamic-nightly/jquery-dynamic-onload.html

The first one loads jQuery when you click a button; the second does it from
an onload attribute.

I'm not using any of the onreadystatechange stuff. Instead, I appended a
function call to the end of the jquery.js file that I'm using.

-Mike

On Fri, Oct 9, 2009 at 10:30 AM, Sasha Sklar sashask...@gmail.com wrote:


 I came across this issue while looking at LAB.js. Is this known to be
 fixed in latest nightly? From what I can tell document.ready still
 won't fire if jQuery is loaded after DOM Ready has occurred. Here's my
 test code:

 // make sure dom ready has already happened by attaching an event to
 old school window.onload
 window.onload = function() {
console.log('window onload fires');
var url = http://code.jquery.com/jquery-nightly.js;;
 var head = document.getElementsByTagName(head)[0], done = false;
var script = document.createElement(script);
script.src = url;

script.onload = script.onreadystatechange = function() {
 if (!done  (!this.readyState || this.readyState == loaded ||
 this.readyState == complete)) {
 console.log('jquery nightly is done loading');
done = true;
$(document).ready(function() {
console.log('dom ready functions should fire
 now');
});

}
};

head.appendChild(script);
 };

 - Sasha

 On Oct 8, 5:18 pm, Michael Geary m...@mg.to wrote:
  Failing to run the document ready functions is a bug in jQuery 1.3.2 that
 is
  fixed in the current svn. It now calls document.ready listeners even if
 you
  load jQuery and subsequent document ready functions dynamically.
 
  At least I *assume* that it's a bug that was fixed, and not just an
  accidental improvement! :-)
 
  Try your code with the nightly you can get here:
 
  http://docs.jquery.com/Downloading_jQuery#Nightly_Builds
 
  Regarding the onload for the script, the best way to handle this is to
 make
  a custom copy of jquery.js or jquery.min.js and add a line to the end:
 
  window.jQueryLoaded  jQueryLoaded();
 
  Then you provide a global jQueryLoaded() function before loading jQuery,
 and
  that has your other initialization code (using document ready if you want
  with the new jQuery code).
 
  Or you can add whatever initialization code you want at the end of your
  jquery.js file.
 
  -Mike
 
  p.s. Speaking of jQuery svn, are there nightly builds or the like
 
  On Thu, Oct 8, 2009 at 6:11 AM, Ryan Crumley crum...@gmail.com wrote:
 
   Rob,
 
   Point taken about using onLoad for a script tag possibly not being
   supported. In this case however that part of the code is working fine.
   The issue I am having is related to jQuery being added to a page after
   the page has completed loading. When this happens ready listeners are
   never executed. If jQuery is present when the page loads then ready
   listeners are executed as expected.
 
   Ryan
 
   On Oct 8, 12:45 am, RobG robg...@gmail.com wrote:
On Oct 8, 10:04 am, Ryan Crumley crum...@gmail.com wrote:
 
 I am experiencing unexpected behavior using $(document).ready() on
 a
 page where I inject jQuery after the page has loaded and then
 attach
 listeners to the ready event. The ready() event is never called
 using
 Firefox and Safari however it is called using IE.
[...]
 function loadjquery() {
 var url = 
  http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/
 jquery.js;
 var head =
   document.getElementsByTagName(head)[0], done = false;
 var script =
 document.createElement(script);
 script.src = url;
 
 script.onload = script.onreadystatechange =
   function() {
 
There is no onload attribute for script elements defined in HTML
 4.01,
therefore you should not expect that a script element will fire a
 load
event. The fact that some browsers do and some don't should be enough
to tell you that browser behaviour is inconsistent.  You are unlikely
to be able to reliably fix that with script.
 
If you want a reliable indicator that a script has finished loading
and is ready for use, put a statement at the bottom like:
 
  var SCRIPT_LOADED = true;
 
--
Rob



[jQuery] Re: Debug says I'm missing a paren, but all parens are matched!

2009-10-09 Thread Michael Geary
Let's break that statement down into individual statements:

var selector = [id$= + b1 + ] input;
var value = ( Hide ? Show : Hide );
$(selector).val( value );

Now what is in the variable 'value'? You can try alerting it:

var value = ( Hide ? Show : Hide );
alert( value );  // always alerts 'Show'

You can see what the problem is now: the expression ( Hide ? Show :
Hide ) always evaluates to Show.

What you probably meant to do was something like this:

var $input = $([id$=+b1+] input);
$input.val( $input.val() == Hide ? Show : Hide );

Or written out more step-by-step:

var $input = $([id$=+b1+] input);
var value = ( $input.val() == Hide ? Show : Hide );
$input.val( value );

-Mike

On Fri, Oct 9, 2009 at 12:35 PM, hsfrey hsf...@gmail.com wrote:


 Giovanni:

   Thanks for the suggestion, but, unfortunately it doesn't do
 anything . :-(

  However, I tried the following:

 $([id$=+b1+] input).val(Hide?Show:Hide);

   This actually does switch the label to show, but not back to
 hide when clicked again.
 BUT - I'm as confused about why it DOES work the first time as about
 why it doesn't subsequently. g

   The attribute value isn't actually the First element of the
 input tag; type is. Why does .val change the Second element?
 That's why I was using .attr before instead of .val)
 (Remember, the target is input type=button value=Hide onclick=togl
 ('box1')/)

   Also - The Docs say that .val with one argument GETS the value of
 the first matched element.
 Why does this call with one argument SET the first element?
 Or, DOES it set the element? Even though it LOOKS like it's set, it
 ACTS on subsequent calls as though it hasn't been.

 Harvey


 On Oct 8, 11:19 pm, Giovanni Battista Lenoci gian...@gmail.com
 wrote:
  hsfrey ha scritto:
 
   function togl(b1) {
  var t1 = document.getElementById(b1).getElementsByTagName(input);
  var labl = t1[0].value;
  t1[0].value = labl==Hide?Show:Hide;
   ...
   }
 
  In addition, rather than just Match the ID, I want to match the ID
   which ENDS in the string contained in b1.
   A simple #+b1 won't do that, which is why I used [[id$=+b1=].
 
   The target of the JS is the html:
   div id=box1 ...
   input type=button value=Hide onclick=togl('box1')/
   ...
   /div
 
  If I understood, in your markup the button will have an id like
  something_box1, right?
 
  If you can change your markup, i suggest to you to group elements using
  a class. by the way your first code:
 
  $(([id$=+b1+]) input).attr(value, attr(value)==Hide?Show:Hide);
 
  should be
 
  $([id$=+b1+] input).val($(this).val()==Hide?Show:Hide);
 
  Bye
 
  (i've not tested the code, but I think is right :P)
 
  --
  gianiaz.net - web solutions
  via piedo, 58 - 23020 tresivio (so) - italy
  +39 347 7196482



[jQuery] Please explain $(#username) $(#newUser).bind(click,{},function(){}) and..........

2009-10-09 Thread anjith

 i am using Jquery and javascript from long back but i don't know what
this really means and what they return etc can any explain theseor
can u just any wesite containing tutorials about these codings.


[jQuery] Please say the meaning of $(#username) or $(#newUser).bind(click,{},function(){}) and..........

2009-10-09 Thread anjith

i am using Jquery and javascript from long back but i don't know what
this really means and what they return etc can any explain theseor
can u just any wesite containing tutorials about these codings.


 $(#username)

  $(#newUser).bind(click,{},function(){})


$(#spamimage).attr({src:})

I know what functions they do but i am unable to write my own
programing using these , the third command i know it is returning src
for a image but what is syntax and how to call value in a div or p tag
and how to return values in to those tags using these type of coding
can u say any books/websites or any e-material also helpful to me...
Generally we use document.getElementById().value or
document.getElementByName().value

Thanks and regards,
Anjith kumar Garapati