[jQuery] Disable globals for jQuery.get()?

2008-10-06 Thread Micky Hulse

Hi,

I have this bit of code that runs on page load:

$.get(token, function(txt) {
$emailStory.append('input type=hidden name=ts value=' + txt +
'');
});

But it triggers ajaxStart/ajaxStop... I have tried:

$.ajax({
url: token,
global: false
});

But that does not seem to help... I assume that is because $.get() is
not $.ajax().

Is there any way I can use $.get() but have ajax*() events ignore the
$.get() request?

Thanks for the help.
M


[jQuery] [validate] required( dependency-expression ) for select

2008-10-06 Thread Vic

Hello all, i have a question in regard to jquery validate plugin. i am
using an select control and for certain option value a user select , a
textarea control will appear on the form, and i need to validate this
textarea control. so i tried to use required(dependency-expression) to
check only when a certain value is selected, the textarea control is
set to required. i am not quite sure what to put in the rules
section to trigger the validation.

Any help will be great,

Thanks in advance.

Vic


[jQuery] Re: $(#mydiv).sortable is not a function error

2008-10-06 Thread AdrianMG

Sorry I wrote with error the question... the answer for my problem was
that I copied some jQuery UI code in the jquery.js that's all :P

Thank you!

On 5 oct, 23:09, GARIL [EMAIL PROTECTED] wrote:
  somediv should be preceded either by # or . like so...

 $(#somediv);
 or
 $(.somediv);

 On Oct 5, 4:00 pm, AdrianMG [EMAIL PROTECTED] wrote:

  Hi guys! I was working with jQuery 1.2.6 development and firebug didnt
  report me anybug. Now I am trying to move to 1.2.6 production, but
  firebug reports me 2 erros related with $(somediv).sortable is not
  a function... What can I do? :S


[jQuery] Re: div um zwei img erstellen

2008-10-06 Thread [EMAIL PROTECTED]

 Hey, what's the name of this list? jQuery English??? ...
Sorry, forgot, next time, I promise :-)

Ralf

 thanks
 Neto
 --
 Antonio Marin Neto
 Sun Certified Programmer for Java 2 Platform 1.4

 Blog:http://netomarin.blogspot.com
 Blog:http://weblogs.java.net/blog/netomarin/
 GTalk: [EMAIL PROTECTED]
 Skype: netomarin

 On Fri, Oct 3, 2008 at 2:37 PM, BB [EMAIL PROTECTED] wrote:

  Du hast das schon richtig erkannt: Geht aber nicht, da append wohl
  ein vollständiges Element erwartet...

  also musst du alles in einem string schreiben:

  $(#container).append('div style=height: 95px; display:
  inline;img src=./images/' + imagesArray[i] + '
  id=image' + i + ' width=150 heigth=95 //div');

  wenn du aber immer 2 unterschiedliche bilder haben willst und die
  neuen nicht einfach untendrunter gehängt werden sollen dann benutze
  statt .append(); .html();.

  On 2 Okt., 16:03, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
   Hallo,
   ich habe ein array aus Bilder, das lese ich aus und zeige immer 2
   davon aus.
   Jetzt möchte ich, dass immer um zwei img tags ein div tag steht, also
   divimg.../img...//div

   Dazu habe ich folgendes gemacht

   Schleife des arrays durchgehen:
   wenn i%2
   $('#container').append('div style=height: 95px; display:
   inline;');
   dann
   $('#container').append('img src=./images/' + imagesArray[i] + '
   id=image' + i + ' width=150 heigth=95 /');
   und wieder wenn i%2
   $('#container').append('/div')

   Geht aber nicht, da append wohl ein vollständiges Element erwartet...
   '
   Wie kann ich das denn machen, also div2 img tags, schließendes div?


[jQuery] Re: Partial load strips out script tags?

2008-10-06 Thread Adrian Lynch

I haven't used a partial load in a  while, but could it be you have a
typo:

$(#load_target).load(has_script.htm #script);

Should be:

$(#load_target).load(has_script.htm, #script);

Adrian

On Oct 6, 4:24 am, ctford [EMAIL PROTECTED] wrote:
 When I use .load() to pull in a whole page, script tags are correctly pulled
 in and executed. However, if I add a selector to the .load() call all script
 tags get stripped out. In the following example, the heading from the second
 HTML file gets pulled in, but the JS with the alert does not. Could this be
 a bug?

 html
         head
                 titleAjax/title
                 script type=text/javascript 
 src=jquery-1.2.6.min.js/script
         /head

         body
                 div id=load_target/div
                 script type=text/javascript
                         $(#load_target).load(has_script.htm #script);
                 /script
         /body
 /html

 html
         head
                 titleScript/title
         /head

         body
                 div id=script 
                         h1Heading/h1
                         script type=text/javascript
                                 alert('Hi');
                         /script
                 /div
         /body
 /html
 --
 View this message in 
 context:http://www.nabble.com/Partial-load-strips-out-script-tags--tp19830989...
 Sent from the jQuery General Discussion mailing list archive at Nabble.com.


[jQuery] Re: Disable globals for jQuery.get()?

2008-10-06 Thread BB

All AJAX shortcuts, such as:
.get()
.post()
.getScript()
.getJSON()
all uses the .ajax() function.
But the most settings of these functions are allready defined.
Look at the jQuery code:
return jQuery.ajax({
  type: GET,
  url: url,
  data: data,
  success: callback,
  dataType: type
});

so if you want to set your own settings use the .ajax() function!

On 6 Okt., 08:50, Micky Hulse [EMAIL PROTECTED] wrote:
 Hi,

 I have this bit of code that runs on page load:

 $.get(token, function(txt) {
         $emailStory.append('input type=hidden name=ts value=' + txt +
 '');

 });

 But it triggers ajaxStart/ajaxStop... I have tried:

 $.ajax({
         url: token,
         global: false

 });

 But that does not seem to help... I assume that is because $.get() is
 not $.ajax().

 Is there any way I can use $.get() but have ajax*() events ignore the
 $.get() request?

 Thanks for the help.
 M


[jQuery] Re: Disable globals for jQuery.get()?

2008-10-06 Thread Adrian Lynch

I take it you have defined your own ajaxStart/Stop?

If so, can you maybe remove and then recreate them either side of
the .get call?

Adrian

On Oct 6, 7:50 am, Micky Hulse [EMAIL PROTECTED] wrote:
 Hi,

 I have this bit of code that runs on page load:

 $.get(token, function(txt) {
         $emailStory.append('input type=hidden name=ts value=' + txt +
 '');

 });

 But it triggers ajaxStart/ajaxStop... I have tried:

 $.ajax({
         url: token,
         global: false

 });

 But that does not seem to help... I assume that is because $.get() is
 not $.ajax().

 Is there any way I can use $.get() but have ajax*() events ignore the
 $.get() request?

 Thanks for the help.
 M


[jQuery] Re: Best practices: Wait to reference objects? Classes like PHP? How do you stay organized with little overhead?

2008-10-06 Thread ajpiano

$(#anElementThatIsNotInTheDOM) will always return true.  what you
want to check for is

$(#anElementThatIsNotInTheDOM).length  0

or if you're feeling chipper slash efficient:

documentGetElementById(anElementThatIsNotInTheDOM)

it's common practise to save references to jQuery objects for various
purposes (scoping, efficiency, etc...), however it sounds like your
initial instinct to read more about plugin development is probably
correct :)



On Oct 4, 1:31 pm, Micky Hulse [EMAIL PROTECTED] wrote:
 I should also mention:

 I would love to write jQuery js like the pseudo PHP/JS example...

 Being able to not reference and cache an object until it exists, and
 then being able to use that cached object throughout my code,
 especially other functions.

 (Using class example from my previous post:)
 ===

 class Myclass {

         ...
         ...

         function someClassMethod2() {
                  $foo1 = $this-childObj1;
         }

         function someClassMethod2() {
                  $foo1 = $this-childObj1;
         }
         ...
         ...

 }

 ===

 I like the thought of grabbing a global from a function, that is only
 cached when the object exists, and avoiding the need to pass-in
 objects via function arguments.

 Hrmm, maybe I need to read more about jQuery plugins? :)

 Thanks

 Cheers,
 Micky

 On Oct 4, 10:18 am, Micky Hulse [EMAIL PROTECTED] wrote:

  Hello,

  I just have a quick question about jQuery best practices...

  I have been wondering for a while now, is it bad practice for me to
  make references to objects outside of the block of code they are used
  in?

  For example, in my master JS file I might have this code:

  ===

  // Start closure:
  $(function() {

          var $parentObj = $('#parentContianer');
          var $childObj1 = $('#childEle1');
          var $childObj2 = $('#childEle2');
          var $childObj3 = $('#childEle3');
          var $childObj4 = $('#childEle4');
          var $childObj5 = $('#childEle5');
          var $childObj6 = $('#childEle6');

          if($parentObj) { // Parent object exists, execute code block:
                  ... do something with child objects 
          }

  });

  // End closure.

  ===

  HTML:

  ===

  body

  div id=parentContianer
          div id=#childEle1/div
          div id=#childEle2/div
          div id=#childEle3/div
          div id=#childEle4/div
          div id=#childEle5/div
          div id=#childEle6/div
  /div

  /body

  ===

  Should I avoid referencing those child objects only until the parent
  object exists?

  I really like keeping all of my used variables at the top of my JS (so
  I know what vars I am using and such), but I am just not sure how to
  best handle object references... I do not want to do unecessary
  lookups.

  Is there anyway I could do something like a simple PHP class, but with
  JS (psuedo js/php code below):

  ===

  ?php

  class Myclass {

          var $parentObj = $('#parentContianer');
          var $childObj1 = ''
          var $childObj2 = ''
          var $childObj3 = ''
          var $childObj4 = ''
          var $childObj5 = ''
          var $childObj6 = ''

          // Class constructor:
          function Myclass() {
                  if($this-parentObj) {
                          $this-childObj1 = $('#childEle1');
                          $this-childObj2 = $('#childEle2');
                          $this-childObj3 = $('#childEle3');
                          $this-childObj4 = $('#childEle4');
                          $this-childObj5 = $('#childEle5');
                          $this-childObj6 = $('#childEle6');
                          Init(); // Call Init() method.
                  } else { return false; } // If parentObj does not exist, 
  quit.
          }
          function Init() {
                  $foo1 = $this-childObj1;
                  $foo2 = $this-childObj2;
                  ... Do more stuff with the child objects here ...
          }

  }

  ?

  ===

  Basically, I want to keep my code organized and readable... But I also
  want to keep the overhead minimal.

  Hehe, am I making sense here?

  Any tips/advice/links ya'll could send my way would be super
  helpful

  Thanks!
  Cheers,
  Micky Hulse


[jQuery] Re: Problem jQuery Selecting Input field

2008-10-06 Thread Adrian Lynch

Try this:

script src=jquery-1.2.6.min.js/script

script
$(function() {
alert($(input[id$='home']).val());
alert($(input[id$='street']).val());
});
/script

form id=phone
   input id=home value=This is the value of phone:home /
   input id=phone:mobile /
/form


form id=customer
   input id=customer:name /
   input id=customer:city /
/form


form id=address
   input id=address:street value=This is the value of
address:street /
   input id=address:zip /
/form

Adrian

On Oct 6, 6:27 am, Faisal Basra [EMAIL PROTECTED] wrote:
 Yes, right Morningz looks like this.

 form id=phone
    input id=phone:home /
    input id=phone:mobile /
 /form

 form id=customer
    input id=customer:name /
    input id=customer:city /
 /form

 form id=address
    input id=address:street /
    input id=address:zip /
 /form

 i want to access input fields, just only specifying home, mobile,name,
 city, street,zip  not as form:input
 please any way ?


[jQuery] Re: jqueryPngFix and links on IE6

2008-10-06 Thread shortStormTrooper

@fazal

position:relative on the link does not always work, it depends on the
complexity of the link's relationship to its parents and to other
elements on the page. Sometimes z-index can help, sometimes nothing in
pure CSS/HTML will fix the problem...

On Oct 5, 10:36 am, Fazal Khan [EMAIL PROTECTED] wrote:
 With any PNG fix you use jQuery or not, if the link isn't clickable,
 just apply the position:relative; attribute to the link in your css
 file and it will work.

 On Sep 2, 12:28 pm, Giovanni Battista Lenoci [EMAIL PROTECTED]
 wrote:

  Hi, I'm using the pngFix plugin to show some png images with
  trasparency.

  These images are part of a list of menu, and each one is inside on
  link tag.

  When the png fix is applied I can see trasparency but the linkable
  area is restricted to the visible part of the image.
  I've putted an example page here:

 http://lab.gianiaz.com/jquery/menupngfix/

  There's only an image in it with dimensions : 200pxX150px.
  If you look the page with firefox and Internet Explorer 7 you will be
  able to click on the entire area of 200x150px.
  With Internet explorer 6 you'll be able to click only on the black
  part of the image.

  I know that pngfix replaces the image with a span, and I can with some
  selector intercept the click on the parent of the span, but maybe
  there's some css fix to make the entire span area clickable.

  Any suggestion?

  Thank you


[jQuery] Re: Jquery and ASP.NET

2008-10-06 Thread David Meiser


In case you missed this [1] announcement, Microsoft is going to begin 
shipping jQuery with Visual Studio and ASP.NET MVC, unchanged.  Don't 
look for a date or version or Service Pack as to when this will actually 
start shipping/be available for download.  Based on the announcement, I 
would guess soon.


Until then, here [2] is an article about using Script Manager to 
override the Microsoft ASP.NET AJAX library with the jQuery library.


Peace,
Dave

[1] 
http://weblogs.asp.net/scottgu/archive/2008/09/28/jquery-and-microsoft.aspx
[2] 
http://weblogs.asp.net/bleroy/archive/2008/07/07/using-scriptmanager-with-other-frameworks.aspx


eduardo wrote:

Is possible use JQuery in aspx pages writing with ASp.net 3.5 ?

Thanks in advance

Eduardo
  


[jQuery] Re: jCarousel Lite - callback function returning an array, but how do I get inside?

2008-10-06 Thread Adrian Lynch

One way is to use yourJQ.get(0), yourJQ.get(1) etc. But what about
just selecting against it with:

$(a selector goes here, yourJQ).doSomething();

Or:

yourJQ.each(function(i) {
alert(this);
});

I'm sure someone will say not to use .get() but I can't remember the
other way it's done ;)

Adrian

On Oct 5, 11:52 pm, [EMAIL PROTECTED] [EMAIL PROTECTED]
wrote:
 I am loving the jCarousel Lite plugin, but I need to be able to
 control an FLV player that is in the currently displayed list item.
 Because I have 2 FLV players, and I need to stop only the playing one
 when the carousel changes to the next slide.

 I know that there are callback functions that return a jquery object
 that selects all the visible items in the carousel, but I don't know
 how to get into that object. Which is a failing of my jquery knowledge
 more than anything :

 So can anyone help? I've done a bit of searching for jquery array
 stuff, but haven't found anything useful for this particular case.

 Thanks for your time.


[jQuery] Re: it doesn't work with HTML loaded dynamically

2008-10-06 Thread Will

an example of the use :

http://w.rouvre.free.fr

: )


[jQuery] Resize Delay?

2008-10-06 Thread BooZker

I am centering a absolutely positioned div by saying:
var center_it =((window_size/2)-(wrapper_width/2))

then:
$('#wrapper').css({left:center_it+'px'});

That's simple, but my problem is Firefox has a delay of almost half a
second or more when resizing before it triggers the .resize function.
So I resize the browser, wait, and then it fires the resize function.

I got around it with:
setTimeout('absolute_center()',1);

but will this take too much user resources? I'm a web programmer and
don't know much about computer programming. Safari (webkit browsers)
do not have this delay and do not need the setTimeout, but why does FF?


[jQuery] Superfish - always display one of the submenus

2008-10-06 Thread iguana007

Hello there, I would like ask You if there is any possibility to
always display one of the submenus. I would like have first submenu
always expanded and other being expanded by hover of its parent list
item.
Thank You for any suggestions.
Luke


[jQuery] AJAX Load two external files into separate divs

2008-10-06 Thread morningovermidnight

I am trying to use AJAX to load two external files into separate divs.
I have one file loading into one div with no problem. I am thinking
that if I can just repeat this action with the other url for the other
external file and chain the two together so that a click on ONE link
will load TWO files into seperate divs. But thati's where I'm
lost...any help would be appreciated! Here's the code below(modified
from some found on NetTuts):

$(document).ready(function() {

$('a.details').click(function(){

var toLoad = $(this).attr('href');

$('#foo').fadeOut('fast',loadContent);
$('#load').remove();
$('#foo').append('LOADING...');
$('#load').fadeIn('normal');
function loadContent() {
$('#foo').load(toLoad,'',showNewContent())
}
function showNewContent() {
$('#foo').fadeIn('normal',hideLoader());
}
function hideLoader() {
$('#load').fadeOut('normal');
}
return false;

});

});

(p.s. is there a way to make this solution degrade gracefully so that
is someone doesn't have js enabled, it would still work for them?)


[jQuery] Re: problem when i click

2008-10-06 Thread MorningZ

Care to divulge what the problem is?


On Oct 6, 3:27 am, ledaker [EMAIL PROTECTED] wrote:
 $(document).ready(function()
 {

 $('#button3').click(
 function(event){
 alert(this.id);

 $
 ('td:contains(1-2)').parent().find('td:gt(0)').addClass('InputSearch');
 $('tr:odd').addClass('LinkCal');
 $('tr:even').addClass('LinkTag');
 $('td:contains(2-2)').addClass('LinkTag');
 $('input').removeClass('Inputon').addClass('Inputoff');
 $('#button3').removeClass('Inputoff').addClass('Inputon');

 });

 $('#button1').click(
 function(event){
 alert(this.id);

 $
 ('td:contains(1-2)').parent().find('td:gt(0)').addClass('InputSearch');
 $('tr:odd').addClass('LinkCal');
 $('tr:even').addClass('LinkTag');
 $('td:contains(2-2)').addClass('LinkTag');
 $('input').removeClass('Inputon').addClass('Inputoff');
 $('#button1').removeClass('Inputoff').addClass('Inputon');

 });

 $('#button2').click(
 function(event){
 alert(this.id);

 $
 ('td:contains(1-2)').parent().find('td:gt(0)').addClass('InputSearch');
 $('tr:odd').addClass('LinkCal');
 $('tr:even').addClass('LinkTag');
 $('td:contains(2-2)').addClass('LinkTag');
 $('input').removeClass('Inputon').addClass('Inputoff');
 $('#button2').removeClass('Inputoff').addClass('Inputon');

 });
 }

 );


[jQuery] Re: JQuery .draggable() - How can you make a linked image draggable?

2008-10-06 Thread Adrian Lynch

By clickable do you mean a hyperlink? If so, then I'd guess that your
dragging the image out of the link.

a href=img ...//a

becomes:

a href=/a

img .../

So drag the a instead. This should still have the image inside.

Just guessing mind, not had much experience with this myself.

Adrian

On Oct 4, 7:55 pm, Ed [EMAIL PROTECTED] wrote:
 I'm using the JQuery UI .draggable() function as shown below.

 The problem with the below code is that once an image is dragged, it
 is no longer a clickable link.

 $(.linked_img).draggable({
 helper: 'original',
 revert: 'invalid',
 start: function(){
         $(this).click(function(){return false;});},

 stop: function(){
         $(this).click(function(){return true;});

 }
 });

 My goals are

 1. Drag linked images (without going to the linked page).
 2. If an image is dragged, it should remain clickable when dragging
 stops.

 Any idea how to make it work?


[jQuery] JQuery validate problem

2008-10-06 Thread Bill

I have a problem.where i use the jquey validate plugin for my
project.

I want to use the validate like this:

s:textfield id=name name=userGroup.name/

but it does not work . i should make the id and name property as same.
or named the id as cname and name is name

if i use the struts2 framework and want to use name like xxx.yyy,what
can i do to resolve this situation? 3x


[jQuery] Re: Jquery and ASP.NET

2008-10-06 Thread George Adamson

To get around the server-side-id vs client-side-id differences you can
often use id selectors like this $(DIV[id$=myServerSideID]) but
there is always the possibility of confusion between elements whose
IDs end with the same pattern of letters.

For an internal project we've used a couple of quick and dirty custom
selectors called :aspid() and :aspname()   The :aspid() selector
suffers from the same issues as the $id=... solution above.
The :aspname() selector will not get confused between elements but it
only works on form elements because they have a name attribute.

They rely on the way asp.net build client IDs and Names that end with
the server-side id...
I would not recommend widespread use of these selectors because they
are so asp-specific but they can be helpful none the less.

Cheer. I hope this helps a wee bit.

jQuery.extend(jQuery.expr[':'], {

/**
 * Custom selector for matching elements by their server-side ID
(using their client-side IDs generated by ASP.Net)
 * They may return multiple elements when more than one client-side
id ends with the same id string.
 *
 * (Note: The :aspid() selector matches on the element id.
The :aspname() selector matches on the element name (so it only works
on form elements that support the name attribute). The latter is more
accurate because it can rely on the $ separator in the name
attribute to correctly locate the start of the id in the string)
 *
 * @param String id The ID to search for. This is the id you used in
the ASP server-side code.
 *
 * @example $(INPUT:aspid(buttonEdit))
 * @desc Find the input element who's server-side id is buttonEdit.
(The client-side id will be something like
ctl00_MainContent_buttonEdit)
 *
 * @name :aspid, :aspname
 * @type jQuery object
 *
 * @cat jQuery/Custom selector
 * @author George Adamson
 */
aspid : function(a,i,m){ var id=a.getAttribute(id);   
return id
 m[3]  id.substr(id.length - m[3].length - 1) == _+m[3]; },
aspname   : function(a,i,m){ var id=a.getAttribute(name); 
return id
 m[3]  id.substr(id.length - m[3].length - 1) == $+m[3]; }
});


[jQuery] Re: R: [jQuery] Only show div's within parent.

2008-10-06 Thread Adrian Lynch

Or:

$(document).ready(function(){
$(a.show).click(function () {
$(this).siblings(div.hidden).slideToggle(fast);
});
});

Which will hopefully protect against the markup changing.

Or better still, go up to the parent, then back in to find the right
div.hidden:

$(document).ready(function(){
$(a.show).click(function () {
$(div.hidden, $
(this).parent()).slideToggle(fast);
});
});

Adrian

On Oct 5, 4:06 pm, diego valobra [EMAIL PROTECTED] wrote:
 Hi, another example..

 $(document).ready(function(){
  
    $('.hidden').hide(0) // just if you want all items closed at the beginning
   
    $('a.show').click(function () {
           
         $('.hidden').slideUp('fast') // just if you want a kind of accordion
    
         $(this).next('div').slideToggle('fast') // it takes just the next div 
 :)

     });
    

 });

 here is a demo http://www.pirolab.it/piro_09/slide_up.html

 Diego

 --- Dom 5/10/08, [EMAIL PROTECTED] [EMAIL PROTECTED] ha scritto:
 Da: [EMAIL PROTECTED] [EMAIL PROTECTED]
 Oggetto: [jQuery] Only show div's within parent.
 A: jQuery (English) jquery-en@googlegroups.com
 Data: Domenica 5 ottobre 2008, 14:32

 This is my first time with jQuery!

 I have a list like this:
 ul id=results
         li
                 a href=# class=showsome text/a
                 div class=hiddensome text/div
         /li
         li
                 a href=# class=showsome text/a
                 div class=hiddensome text/div
         /li
         li
                 a href=# class=showsome text/a
                 div class=hiddensome text/div
         /li
 /ul

 And a script like this:
 $(document).ready(function(){
         $(a.show).click(function () {
                 $(div.hidden).slideToggle(fast);
         });

 });

 Now when a press one of the links with the class show it does show
 every div with the class hidden. But I only want to show the child
 div of the link show. Not all of them.

 Is that possible and how?

       Scopri il blog di Yahoo! Mail:
 Trucchi, novità e la tua opinione.http://www.ymailblogit.com/blog


[jQuery] Re: $().each() only iterates through first item

2008-10-06 Thread Dave Methvin

 $j(.is_preferred_email).each(
 function(i) {
 this[i].checked = false;
 }
 );

Inside the function of each(), the first arg is the index in the
array. The this is the actual DOM element. It looks like you thought
it was the original jQuery object, but it's not. In short, what you
wanted was this.checked and not this[i].checked.

However, you could have just said:

$j(.is_preferred_email).attr(checked, false);

which is a lot shorter! There is an internal .each() built into nearly
all the setter functions like .attr(), .css(), and .bind() so it is
automatically applied to all the elements that were selected.





[jQuery] Re: XML Parsing Question...

2008-10-06 Thread Erik Beeson
To my knowledge, XML parsing via the jQuery constructor isn't supported.

See here: http://dev.jquery.com/ticket/3143

--Erik


On Sat, Oct 4, 2008 at 12:29 PM, KenLG [EMAIL PROTECTED] wrote:


 For much of my app, I'm doing an Ajax hit to the server to grab XML.
 That works great.

 But, in some cases, I've got too many pieces of data (unrelated) that
 I need to pull so I'm trying to do a simple passthrough from the
 server side (I'm using ASP.Net). So, I'll either output from SQL
 Server or hand-stitch some XML and write it to the page.

 Whenever I do this passthrough (whether it comes from SQL Server or
 from my own efforts), the XML doesn't get parsed by Jquery.

 For example:

 var sTestXML = '?xml version=1.0?\r
 \nEventContactsEventContactEventContactDataHello/
 EventContactData/EventContact/EventContacts\r\n';

 var test = $(sTestXML);

 alert(test.find(EventContact).length);

 will result in the alert showing zero.

 Now, if I lower case some of the tags (and this will vary from XML doc
 to XML doc but usually it's the root and object-level tags), it'll
 work. What's going on here?



[jQuery] Re: XML Parsing Question...

2008-10-06 Thread Alexandre Plennevaux
and if you simply try $(EventContact,test).length?




LAb[au] _ *lab*oratory for *a*rchitecture and *u*rbanism

Alexandre Plennevaux

Lakensestraat 104 Rue de Laeken
Brussel 1000 Bruxelles
België _ Belgique _ Belgium

tel: +32 (0)2 2196555
fax: +32 (0)2 4266986

mail: [EMAIL PROTECTED] [EMAIL PROTECTED]
http://www.lab-au.com
VAT: BE0475.210.720


On Mon, Oct 6, 2008 at 11:09 AM, Adrian Lynch [EMAIL PROTECTED]wrote:


 JS is case sensitive, maybe .find() is also?

 Adrian

 On Oct 4, 8:29 pm, KenLG [EMAIL PROTECTED] wrote:
  For much of my app, I'm doing an Ajax hit to the server to grab XML.
  That works great.
 
  But, in some cases, I've got too many pieces of data (unrelated) that
  I need to pull so I'm trying to do a simple passthrough from the
  server side (I'm using ASP.Net). So, I'll either output from SQL
  Server or hand-stitch some XML and write it to the page.
 
  Whenever I do this passthrough (whether it comes from SQL Server or
  from my own efforts), the XML doesn't get parsed by Jquery.
 
  For example:
 
  var sTestXML = '?xml version=1.0?\r
  \nEventContactsEventContactEventContactDataHello/
  EventContactData/EventContact/EventContacts\r\n';
 
  var test = $(sTestXML);
 
  alert(test.find(EventContact).length);
 
  will result in the alert showing zero.
 
  Now, if I lower case some of the tags (and this will vary from XML doc
  to XML doc but usually it's the root and object-level tags), it'll
  work. What's going on here?



[jQuery] Re: XML Parsing Question...

2008-10-06 Thread Adrian Lynch

JS is case sensitive, maybe .find() is also?

Adrian

On Oct 4, 8:29 pm, KenLG [EMAIL PROTECTED] wrote:
 For much of my app, I'm doing an Ajax hit to the server to grab XML.
 That works great.

 But, in some cases, I've got too many pieces of data (unrelated) that
 I need to pull so I'm trying to do a simple passthrough from the
 server side (I'm using ASP.Net). So, I'll either output from SQL
 Server or hand-stitch some XML and write it to the page.

 Whenever I do this passthrough (whether it comes from SQL Server or
 from my own efforts), the XML doesn't get parsed by Jquery.

 For example:

 var sTestXML = '?xml version=1.0?\r
 \nEventContactsEventContactEventContactDataHello/
 EventContactData/EventContact/EventContacts\r\n';

 var test = $(sTestXML);

 alert(test.find(EventContact).length);

 will result in the alert showing zero.

 Now, if I lower case some of the tags (and this will vary from XML doc
 to XML doc but usually it's the root and object-level tags), it'll
 work. What's going on here?


[jQuery] Re: Possible to set metadata parameter dynamically?

2008-10-06 Thread Adrian Lynch

Is the data attribute something jQuery knows about? Never seen it
myself.

Anyway, here's an idea. If the value of data is in object notation,
read it into a var and eval it much like you would a JSON string!

Then you might be able to work on the data more easily.

Adrian

On Oct 4, 9:55 pm, me-and-jQuery [EMAIL PROTECTED] wrote:
 Well, I meant with attr(data,{ id : 6})... my mistake.

 On Oct 4, 10:24 pm, me-and-jQuery [EMAIL PROTECTED] wrote:



  So is it possible to change the value of metadata parameter? Lets say
  we have div data={ id: 5 }.

  Or is the only way to change it with attr(id,6)? I have more
  parameters for element, so this is not an elegant solution.

  Thanks.- Hide quoted text -

 - Show quoted text -


[jQuery] problem when i click

2008-10-06 Thread ledaker

$(document).ready(function()
{

$('#button3').click(
function(event){
alert(this.id);

$
('td:contains(1-2)').parent().find('td:gt(0)').addClass('InputSearch');
$('tr:odd').addClass('LinkCal');
$('tr:even').addClass('LinkTag');
$('td:contains(2-2)').addClass('LinkTag');
$('input').removeClass('Inputon').addClass('Inputoff');
$('#button3').removeClass('Inputoff').addClass('Inputon');

});

$('#button1').click(
function(event){
alert(this.id);

$
('td:contains(1-2)').parent().find('td:gt(0)').addClass('InputSearch');
$('tr:odd').addClass('LinkCal');
$('tr:even').addClass('LinkTag');
$('td:contains(2-2)').addClass('LinkTag');
$('input').removeClass('Inputon').addClass('Inputoff');
$('#button1').removeClass('Inputoff').addClass('Inputon');

});

$('#button2').click(
function(event){
alert(this.id);

$
('td:contains(1-2)').parent().find('td:gt(0)').addClass('InputSearch');
$('tr:odd').addClass('LinkCal');
$('tr:even').addClass('LinkTag');
$('td:contains(2-2)').addClass('LinkTag');
$('input').removeClass('Inputon').addClass('Inputoff');
$('#button2').removeClass('Inputoff').addClass('Inputon');

});

}
);


[jQuery] Re: Processing.js Google Group Now Formed!

2008-10-06 Thread Rick Faircloth


Ok...I'll ask...what is Processing.js about?

Rick

chris thatcher wrote:

I started using processing.js also, I'll definitely join this group!

Thatcher

On Sat, Oct 4, 2008 at 7:16 PM, F1LT3R [EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED] wrote:



Hey Joe,

I love using Processing so I am glad you started this group and I will
definitely be subscribing.
You have a question? I have been digging around in the Processing.js
for a while now and am quite familiar with the Java Processing
language, so maybe I could help?

Thanks,

Al



On Sep 24, 1:36 pm, Joe [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED] wrote:
 Head here:

 http://groups.google.com/group/processingjs

 And discuss!  I already have one question and don't want to post it
 here on the jQuery board so I figured I'd go ahead and create the
 group.

 Cheers.

 Joe




--
Christopher Thatcher




[jQuery] Re: $().each() only iterates through first item

2008-10-06 Thread sydneyos

Dave,

Actually, I tried both of those things first - should have mentioned
that.  It was only after I got three elements doing
alert($j(.is_preferred_email)) that I switched to using the index.

On Oct 5, 7:53 pm, Dave Methvin [EMAIL PROTECTED] wrote:
          $j(.is_preferred_email).each(
              function(i) {
                  this[i].checked = false;
              }
          );

 Inside the function of each(), the first arg is the index in the
 array. The this is the actual DOM element. It looks like you thought
 it was the original jQuery object, but it's not. In short, what you
 wanted was this.checked and not this[i].checked.

 However, you could have just said:

 $j(.is_preferred_email).attr(checked, false);

 which is a lot shorter! There is an internal .each() built into nearly
 all the setter functions like .attr(), .css(), and .bind() so it is
 automatically applied to all the elements that were selected.


[jQuery] Re: jqueryPngFix and links on IE6

2008-10-06 Thread Klaus Hartl

position: relative does not always work but in my experience
triggering hasLayout almost always (you can never tell with IE) works
if links displayed as block aren't clickable as a whole.

http://www.satzansatz.de/cssd/onhavinglayout.html

--Klaus



On 6 Okt., 12:48, shortStormTrooper [EMAIL PROTECTED] wrote:
 @fazal

 position:relative on the link does not always work, it depends on the
 complexity of the link's relationship to its parents and to other
 elements on the page. Sometimes z-index can help, sometimes nothing in
 pure CSS/HTML will fix the problem...

 On Oct 5, 10:36 am, Fazal Khan [EMAIL PROTECTED] wrote:

  With any PNG fix you use jQuery or not, if the link isn't clickable,
  just apply the position:relative; attribute to the link in your css
  file and it will work.

  On Sep 2, 12:28 pm, Giovanni Battista Lenoci [EMAIL PROTECTED]
  wrote:

   Hi, I'm using the pngFix plugin to show some png images with
   trasparency.

   These images are part of a list of menu, and each one is inside on
   link tag.

   When the png fix is applied I can see trasparency but the linkable
   area is restricted to the visible part of the image.
   I've putted an example page here:

  http://lab.gianiaz.com/jquery/menupngfix/

   There's only an image in it with dimensions : 200pxX150px.
   If you look the page with firefox and Internet Explorer 7 you will be
   able to click on the entire area of 200x150px.
   With Internet explorer 6 you'll be able to click only on the black
   part of the image.

   I know that pngfix replaces the image with a span, and I can with some
   selector intercept the click on the parent of the span, but maybe
   there's some css fix to make the entire span area clickable.

   Any suggestion?

   Thank you


[jQuery] problem with internet explorer...

2008-10-06 Thread Manarius

hi guys and girls :)
first of all excuse me if my english is rather bad, i am from austria
so english is not an everyday language for my mind.

the silly warmup question first:
i am not geeky enough to know, how to search for this on google (but
believe me, i tried many many keywords before adressing such a simple
question to you all):
how can i load (using jquery.history) content out of a div inside my
target.html into a div in my main.html? my goal would be to have a
completely normal html page which is able to be used without js. (i
think its called unintrusive javascript but i cannot grasp how to use
it)

the programing question second:
i am using more js than this but my problem seems to be something
with:
jquery, jquery.history, jquery.editease,

i registered an invisible link on pageload. then i load ajaxed content
into my dom/iframe using editease and history.
everything works as expected in firefox, opera and safari, but when i
open the page in ie the two links which are loaded per ajax call wont
work anymore.
you can see my problem at: http://www.spamyourself.net/home.php#Services
(its the nächste btn in this case)
the hash is reset correctly and page reload gets you to the right
place (#Services2), but clicking the btn does not trigger the dom
reload.
i tried workarounds, i tried cursing, i tried kind asking, but the ie
ignores all of my tries to persuade it.
i would be very happy if someone could help me on that.

and the rendering question:
i just tested the page again after several small changes and what
happens?
internet explorer displays every header wrong. you can clearly see it,
when you start up any page of spamyourself.net. the orange headers are
displayed fringed (i tested it, its not the css colorattr or html,
it seems to be regarded to loading ajaxcontent.)
and the second rendering problem:
spamyourself.net/home.php#Services
why arent the nächste and the zurück btn-backgrounds white? is
this a known bug=?

thats all folks :)
thanks for your time if you look at the page,
thanks for your time if you just read that and ignore it.
greetings from rainy vienna,
jascha ehrenreich.

(btw: if someone has some useful advices for me, just keep em coming.
the page is still in development, as is my mind, i will certainly make
changes to both of them before delivering it to my friend who asked me
to do it :))




[jQuery] Re: $().each() only iterates through first item

2008-10-06 Thread sydneyos

Thanks for your input.  Here is the relevant HTML (dynamically
generated)

  input checked=checked class=is_preferred_email
id=record_person_emails_10001_is_preferred
name=record_person_emails_10001_is_preferred
onchange=setPreferredEmail(this); type=checkbox value=1 /input
name=record_person_emails_10001_is_preferred type=hidden
value=0 /

 input class=is_preferred_email
id=record_person_emails_10021_is_preferred
name=record_person_emails_10021_is_preferred
onchange=setPreferredEmail(this); type=checkbox value=1 /input
name=record_person_emails_10021_is_preferred type=hidden
value=0 /

 input class=is_preferred_email
id=record_person_emails_1223301735390_is_preferred
name=record_person_emails_1223301735390_is_preferred
onchange=setPreferredEmail(this); type=checkbox value=1 /input
name=record_person_emails_1223301735390_is_preferred type=hidden
value=0 /

On Oct 5, 7:22 pm, MorningZ [EMAIL PROTECTED] wrote:
 There is absolutely no way you have the selector setup correctly

 what is the HTML?

 On Oct 5, 8:53 pm, sydneyos [EMAIL PROTECTED] wrote:

  I have the following expression where is_preferred_email is a class
  assigned to three elements in my page:

          $j(.is_preferred_email).each(
              function(i) {
                  this[i].checked = false;
              }
          );

  if I put alert(this[i].name); in the function, I only ever get one
  message, which is consistent w/ the checking/unchecking behavior I
  see.

  Likewise, a call to $j(.is_preferred_email).size() returns 1.

  alert(j$(is_preferred_email)) gives me

  [object HtmlInputElement],[object HtmlInputElement],[object
  HtmlInputElement]

  so clearly it is finding all three items.

  I'm stumped.

  I am also using prototype but have called var $j =
  jQuery.noConflict();

  I'm sure I'm missing something obvious - hope someone can pick it out.

  Thanks,


[jQuery] Re: Jquery and ASP.NET

2008-10-06 Thread GARIL


Definitely.


On Oct 5, 1:45 pm, eduardo wrote:
 Is possible use JQuery in aspx pages writing with ASp.net 3.5 ?


[jQuery] Re: Problem jQuery Selecting Input field

2008-10-06 Thread Alexander Gyoshev
attributeEndsWith http://docs.jquery.com/Selectors/attributeEndsWithselectors:

$(input[id$=':home'])


On Mon, Oct 6, 2008 at 8:27 AM, Faisal Basra [EMAIL PROTECTED] wrote:


 Yes, right Morningz looks like this.

 form id=phone
   input id=phone:home /
   input id=phone:mobile /
 /form

 form id=customer
   input id=customer:name /
   input id=customer:city /
 /form

 form id=address
   input id=address:street /
   input id=address:zip /
 /form

 i want to access input fields, just only specifying home, mobile,name,
 city, street,zip  not as form:input
 please any way ?



[jQuery] Re: JQuery validate problem

2008-10-06 Thread Jörn Zaefferer
Take a look at the instructions here:
http://docs.jquery.com/Plugins/Validation/Reference#Fields_with_complex_names_.28brackets.2C_dots.29

Jörn

On Mon, Oct 6, 2008 at 10:50 AM, Bill [EMAIL PROTECTED] wrote:

 I have a problem.where i use the jquey validate plugin for my
 project.

 I want to use the validate like this:

 s:textfield id=name name=userGroup.name/

 but it does not work . i should make the id and name property as same.
 or named the id as cname and name is name

 if i use the struts2 framework and want to use name like xxx.yyy,what
 can i do to resolve this situation? 3x



[jQuery] Re: $().each() only iterates through first item

2008-10-06 Thread BB

Try:
$j(.is_preferred_email).each(
function(i) {
this.checked = false;
}
);

or as the posts before:
$j(.is_preferred_email).attr(checked, false);

On 6 Okt., 16:04, sydneyos [EMAIL PROTECTED] wrote:
 Thanks for your input.  Here is the relevant HTML (dynamically
 generated)

   input checked=checked class=is_preferred_email
 id=record_person_emails_10001_is_preferred
 name=record_person_emails_10001_is_preferred
 onchange=setPreferredEmail(this); type=checkbox value=1 /input
 name=record_person_emails_10001_is_preferred type=hidden
 value=0 /

  input class=is_preferred_email
 id=record_person_emails_10021_is_preferred
 name=record_person_emails_10021_is_preferred
 onchange=setPreferredEmail(this); type=checkbox value=1 /input
 name=record_person_emails_10021_is_preferred type=hidden
 value=0 /

  input class=is_preferred_email
 id=record_person_emails_1223301735390_is_preferred
 name=record_person_emails_1223301735390_is_preferred
 onchange=setPreferredEmail(this); type=checkbox value=1 /input
 name=record_person_emails_1223301735390_is_preferred type=hidden
 value=0 /

 On Oct 5, 7:22 pm, MorningZ [EMAIL PROTECTED] wrote:

  There is absolutely no way you have the selector setup correctly

  what is the HTML?

  On Oct 5, 8:53 pm, sydneyos [EMAIL PROTECTED] wrote:

   I have the following expression where is_preferred_email is a class
   assigned to three elements in my page:

           $j(.is_preferred_email).each(
               function(i) {
                   this[i].checked = false;
               }
           );

   if I put alert(this[i].name); in the function, I only ever get one
   message, which is consistent w/ the checking/unchecking behavior I
   see.

   Likewise, a call to $j(.is_preferred_email).size() returns 1.

   alert(j$(is_preferred_email)) gives me

   [object HtmlInputElement],[object HtmlInputElement],[object
   HtmlInputElement]

   so clearly it is finding all three items.

   I'm stumped.

   I am also using prototype but have called var $j =
   jQuery.noConflict();

   I'm sure I'm missing something obvious - hope someone can pick it out.

   Thanks,




[jQuery] Re: $().each() only iterates through first item

2008-10-06 Thread MorningZ

As for yout .size() issue

this code

http://paste.pocoo.org/show/87223/

works totally as expected.  not sure what you have different



On Oct 6, 10:41 am, BB [EMAIL PROTECTED] wrote:
 Try:
         $j(.is_preferred_email).each(
             function(i) {
                 this.checked = false;
             }
         );

 or as the posts before:
 $j(.is_preferred_email).attr(checked, false);

 On 6 Okt., 16:04, sydneyos [EMAIL PROTECTED] wrote:

  Thanks for your input.  Here is the relevant HTML (dynamically
  generated)

    input checked=checked class=is_preferred_email
  id=record_person_emails_10001_is_preferred
  name=record_person_emails_10001_is_preferred
  onchange=setPreferredEmail(this); type=checkbox value=1 /input
  name=record_person_emails_10001_is_preferred type=hidden
  value=0 /

   input class=is_preferred_email
  id=record_person_emails_10021_is_preferred
  name=record_person_emails_10021_is_preferred
  onchange=setPreferredEmail(this); type=checkbox value=1 /input
  name=record_person_emails_10021_is_preferred type=hidden
  value=0 /

   input class=is_preferred_email
  id=record_person_emails_1223301735390_is_preferred
  name=record_person_emails_1223301735390_is_preferred
  onchange=setPreferredEmail(this); type=checkbox value=1 /input
  name=record_person_emails_1223301735390_is_preferred type=hidden
  value=0 /

  On Oct 5, 7:22 pm, MorningZ [EMAIL PROTECTED] wrote:

   There is absolutely no way you have the selector setup correctly

   what is the HTML?

   On Oct 5, 8:53 pm, sydneyos [EMAIL PROTECTED] wrote:

I have the following expression where is_preferred_email is a class
assigned to three elements in my page:

        $j(.is_preferred_email).each(
            function(i) {
                this[i].checked = false;
            }
        );

if I put alert(this[i].name); in the function, I only ever get one
message, which is consistent w/ the checking/unchecking behavior I
see.

Likewise, a call to $j(.is_preferred_email).size() returns 1.

alert(j$(is_preferred_email)) gives me

[object HtmlInputElement],[object HtmlInputElement],[object
HtmlInputElement]

so clearly it is finding all three items.

I'm stumped.

I am also using prototype but have called var $j =
jQuery.noConflict();

I'm sure I'm missing something obvious - hope someone can pick it out.

Thanks,


[jQuery] simple table filtering?

2008-10-06 Thread bdee1


I am looking for a simple way to filter the contents of a table.  to clarify
- i would like to have a form at the top of an HTML table where i can select
a field to filter on and then a textbox.  as i type in the textbox, the
table's contents will change to display only rows where the selected field
contains the search term.

I actually found a plugin to do this (uiTableFilter), but i need to take ti
one step further.  I need to have the ability to filter on more than one
column.  I tried just having two forms on the page, each calling the
uiTableFilter plugin, but as soon as you start typing in one box, it just
cancels out the search from any of the other boxes.

any suggestions here?
-- 
View this message in context: 
http://www.nabble.com/simple-table-filtering--tp19839476s27240p19839476.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: jquery code works with firefox but not ie.

2008-10-06 Thread Eric

Good tip!   Another reason to use JSON?

http://us2.php.net/json_encode

On Oct 5, 10:43 am, Mantas [EMAIL PROTECTED] wrote:
 try to right:
 header('Content-Type: text/xml');
 in your php file.
 I had the same problem with IE and then i've remembered this magic
 line, it solved my problem

 On 30 Rugs, 20:33, kelvin pompey [EMAIL PROTECTED] wrote:

  I tried the code without ajax. It works in firefox but not in ie. I modelled
  my code on this example from the sitepoint jquery ajax tutorial.
  html
  head
  titleAJAX with jQuery Example/title
  script type=text/javascript src=jquery-1.2.6.pack.js/script
  script type=text/javascript
  $(document).ready(function(){
  timestamp = 0;

  updateMsg();
  $(form#chatform).submit(function(){
  $.post(backend.php,{
  message: $(#msg).val(),
  name: $(#author).val(),
  action: postmsg,
  time: timestamp}, function(xml) {

  $(#msg).empty();
  addMessages(xml);});
  return false;
  });
  });

  function addMessages(xml) {
  if($(status,xml).text() == 2) return;
  timestamp = $(time,xml).text();
  $(message,xml).each(function(id) {
  message = $(message,xml).get(id);
  $(#messagewindow).prepend(b+$(author,message).text()+
  /b: +$(text,message).text()+
  br /);});
  }

  function updateMsg() {
  $.post(backend.php,{ time: timestamp }, function(xml) {
  $(#loading).remove();
  addMessages(xml);});

  setTimeout('updateMsg()', 4000);}

  /script
  style type=text/css
  #messagewindow {
  height: 250px;
  border: 1px solid;
  padding: 5px;
  overflow: auto;}

  #wrapper {
  margin: auto;
  width: 438px;}

  /style
  /head
  body
  div id=wrapper
  p id=messagewindowspan id=loadingLoading.../span/p
  form id=chatform
  Name: input type=text id=author /
  Message: input type=text id=msg /
  input type=submit value=ok /br /
  /form
  /div
  /body
  /html

  This code works in both firefox and ie. I can't figure out what I am doing
  differently that makes my code not work with ie.

  On Tue, Sep 30, 2008 at 12:53 PM, Eric [EMAIL PROTECTED] wrote:

   I'm a little concerned by this line:
   client = $(client,data).get(id);

   I'd recommend putting a var in front so that you have a local, not a
   global, variable.
   It also seems to me like $(client,data).get(id) is equivalent to
   'this' inside the each.

   so instead of: client = $(client,data).get(id);
   use:  var client = this;

   I've never tried to use jQuery with IE and XML data, so I'm not sure
   what quirks might be caused by that combination.

   I would recommend trying your function without the AJAX call:
   var data = insert_your_xml_here;
   $(client,data).each(function(id) {
                          client = $(client,data).get(id);
                          $(#left_items).append(li id='+$
   (id,client).text()+'a
   href='#'+$(name,client).text()+/a/li);
                  });

   If none of that helps, I'd recommend installing Firebug, and doing
   some heavy console logging (http://getfirebug.com/console.html),
   specifically of the variable 'client'.

   On Sep 30, 12:14 pm, silk.odyssey [EMAIL PROTECTED] wrote:
I have the following code that works in firefox and google chrome
using jquery 1.2.6.

function setUpClient()
{
        $.post(http://localhost/gestivov2/include/ajax/getclients.php;,
   {},
        function(data){
        $('#left_items').empty();
                //alert(data);
                $(client,data).each(function(id) {
                        client = $(client,data).get(id);
                        $(#left_items).append(li
   id='+$(id,client).text()+'a
href='#'+$(name,client).text()+/a/li);
                });
        })

}

It doesn't work with internet explorer 7, 8 beta nor 6. If I uncomment
the alert code, the xml data gets displayed so it looks like the code
within the each block is not being executed. What am i doing wrong?


[jQuery] Re: Possible to set metadata parameter dynamically?

2008-10-06 Thread Erik Beeson
In an older version of the metadata plugin, you used to be able to set
something (metaDone to false I think it was) that would force it to reload,
but that doesn't work anymore.

This is all untested, but here's my read on it:

Now, metadata is stored in jQuery's internal caching system, which
associates arbitrary data with DOM elements. To remove all metadata for a
particular element use:

$.removeData(element, 'metadata');

The removeData function is described here:

http://docs.jquery.com/Internals/jQuery.removeData#elemname

To force one or more elements from a jQuery selection to refresh, try:

$(...).each(function() { $.removeData(this, 'metadata'); });

Hope it helps.

--Erik

P.S.: If you're changing the 'single' option like $(...).metadata({single:
'foo'})..., you need to use the same value for the second parameter to
removeData ('foo', in this case).


On Sat, Oct 4, 2008 at 1:24 PM, me-and-jQuery [EMAIL PROTECTED]wrote:


 So is it possible to change the value of metadata parameter? Lets say
 we have div data={ id: 5 }.

 Or is the only way to change it with attr(id,6)? I have more
 parameters for element, so this is not an elegant solution.


 Thanks.



[jQuery] Re: Processing.js Google Group Now Formed!

2008-10-06 Thread Rey Bango


Hi,

Can you please move this over to the Processing Google Group. This 
mailing list is for jQuery and the initial announcement was to let you 
know of the best place to chat about Processing.js.


Thanks,

Rey
jQuery Project

F1LT3R wrote:

You may be looking for online apps... but I think you are ahead of the
curve here. Don't you feel the browser replacing the deskstop? I too
feel like the Processing language is far simpler to implement than the
standard Canvas object. Plus... it already has a large user base. ???



On Oct 4, 10:06 pm, Rick Faircloth [EMAIL PROTECTED] wrote:

Sounds interesting... I saw the example images John has in the repository,
but are there any online working apps using it?

Thanks,

Rick

chris thatcher wrote:

Processing.js (http://github.com/jeresig/processing-js/) is written
by John Resig and is a port of the Processing language (
http://processing.org) developed at MIT that uses the Html Canvas (
http://en.wikipedia.org/wiki/Canvas_(HTML_element)
http://en.wikipedia.org/wiki/Canvas_%28HTML_element%29 )
It is a very sexy 2D drawing API that allows developers to create rich
visualizations, and via excanvas.js, is supported by all browsers
(needs some work based on my experience).
I spent a few hours on the train and wrote a 75 line routine to
produce Heat Maps on top of Google Maps, it can be used to render
beautiful charts, manipulate images, etc, etc.
It's a big win for the javascript community and John's skills show
clearly in it's simplicity and it's completeness.
Thatcher
On Sat, Oct 4, 2008 at 9:26 PM, Rick Faircloth
[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote:
Ok...I'll ask...what is Processing.js about?
Rick
chris thatcher wrote:
I started using processing.js also, I'll definitely join this
group!
Thatcher
On Sat, Oct 4, 2008 at 7:16 PM, F1LT3R
[EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED] wrote:
   Hey Joe,
   I love using Processing so I am glad you started this group
and I will
   definitely be subscribing.
   You have a question? I have been digging around in the
Processing.js
   for a while now and am quite familiar with the Java Processing
   language, so maybe I could help?
   Thanks,
   Al
   On Sep 24, 1:36 pm, Joe [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]
   mailto:[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED] wrote:
Head here:
   http://groups.google.com/group/processingjs
And discuss!  I already have one question and don't want
to post it
here on the jQuery board so I figured I'd go ahead and
create the
group.
Cheers.
Joe
--
Christopher Thatcher
--
Christopher Thatcher




[jQuery] Re: simple table filtering?

2008-10-06 Thread bdee1


that is very helpful and should be a great starting point - thank you very
much for posting!!  I will let you know how i make out.



Eric-286 wrote:
 
 
 This sounds specialized enough that you'll probably be writing the
 code yourself. No problem, jQuery will help!
 
 Basically, every time the contents of your text fields change, you'll
 go through every row of the table, check specific cells, and if they
 don't match the text (http://www.w3schools.com/jsref/jsref_match.asp)
 from the text field, hide the row.  You'll need to set up the Drop-
 down menus appropriately -- I would recommend that you have the Value
 of the select Options be the index of the column.
 
 So if your table is:
 Name | Address | Ice Cream
 
 Your select would contain:
 option value='0'Name/option
 option value='1'Address/option
 option value='2'Ice Cream/option
 
 I started the index at 0, so I'll be using eq() in my code.  If I
 started at 1, then I'd use nthChild:
 http://docs.jquery.com/Core/eq  -- index starts at 0
 http://docs.jquery.com/Selectors/nthChild  -- index starts at 1
 
 You could generate these dropdowns automatically, but I won't get into
 that here.
 
 So the jQuery code that would get triggered on a search would look
 something like this (untested code):
 
 $('#myTable tbody tr').each( function () {
   var that = $(this); // save jQuery version of this
 
   var cellValueToConsider = that.find('td').eq(   $
 ('#firstDropDown').val() ).text();
 
   if (! cellValueToConsider.match( $('#firstSearchField').val() )  ) {
 that.parent().hide();
   }
 
// repeat similar logic with #secondDropDown and #secondSearchField
   //   or generalize the code for an arbitrary number of search
 fields.
 
 });
 
 
 
 
 
 
 On Oct 6, 10:50 am, bdee1 [EMAIL PROTECTED] wrote:
 I am looking for a simple way to filter the contents of a table.  to
 clarify
 - i would like to have a form at the top of an HTML table where i can
 select
 a field to filter on and then a textbox.  as i type in the textbox, the
 table's contents will change to display only rows where the selected
 field
 contains the search term.

 I actually found a plugin to do this (uiTableFilter), but i need to take
 ti
 one step further.  I need to have the ability to filter on more than one
 column.  I tried just having two forms on the page, each calling the
 uiTableFilter plugin, but as soon as you start typing in one box, it just
 cancels out the search from any of the other boxes.

 any suggestions here?
 --
 View this message in
 context:http://www.nabble.com/simple-table-filtering--tp19839476s27240p198394...
 Sent from the jQuery General Discussion mailing list archive at
 Nabble.com.
 
 

-- 
View this message in context: 
http://www.nabble.com/simple-table-filtering--tp19839476s27240p19840326.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: simple table filtering?

2008-10-06 Thread Eric

This sounds specialized enough that you'll probably be writing the
code yourself. No problem, jQuery will help!

Basically, every time the contents of your text fields change, you'll
go through every row of the table, check specific cells, and if they
don't match the text (http://www.w3schools.com/jsref/jsref_match.asp)
from the text field, hide the row.  You'll need to set up the Drop-
down menus appropriately -- I would recommend that you have the Value
of the select Options be the index of the column.

So if your table is:
Name | Address | Ice Cream

Your select would contain:
option value='0'Name/option
option value='1'Address/option
option value='2'Ice Cream/option

I started the index at 0, so I'll be using eq() in my code.  If I
started at 1, then I'd use nthChild:
http://docs.jquery.com/Core/eq  -- index starts at 0
http://docs.jquery.com/Selectors/nthChild  -- index starts at 1

You could generate these dropdowns automatically, but I won't get into
that here.

So the jQuery code that would get triggered on a search would look
something like this (untested code):

$('#myTable tbody tr').each( function () {
  var that = $(this); // save jQuery version of this

  var cellValueToConsider = that.find('td').eq(   $
('#firstDropDown').val() ).text();

  if (! cellValueToConsider.match( $('#firstSearchField').val() )  ) {
that.parent().hide();
  }

   // repeat similar logic with #secondDropDown and #secondSearchField
  //   or generalize the code for an arbitrary number of search
fields.

});






On Oct 6, 10:50 am, bdee1 [EMAIL PROTECTED] wrote:
 I am looking for a simple way to filter the contents of a table.  to clarify
 - i would like to have a form at the top of an HTML table where i can select
 a field to filter on and then a textbox.  as i type in the textbox, the
 table's contents will change to display only rows where the selected field
 contains the search term.

 I actually found a plugin to do this (uiTableFilter), but i need to take ti
 one step further.  I need to have the ability to filter on more than one
 column.  I tried just having two forms on the page, each calling the
 uiTableFilter plugin, but as soon as you start typing in one box, it just
 cancels out the search from any of the other boxes.

 any suggestions here?
 --
 View this message in 
 context:http://www.nabble.com/simple-table-filtering--tp19839476s27240p198394...
 Sent from the jQuery General Discussion mailing list archive at Nabble.com.


[jQuery] Match the filename to highlight current link on page

2008-10-06 Thread suntrop

Hi there,

I've following code to highlight the current link in my menu:
var path = location.pathname.substring(1);
if (path != '') {
$('#navigation [EMAIL PROTECTED]' + path + ']').css('color','#c03');
} else {
$('#navigation [EMAIL PROTECTED]/]').css('color','#c03');
}

But some files/pages have similar names like:
potatoes.html
fried-potatoes.html
The second page highlights the first link (potatoes.html) as well.
What's wrong of course.


How can I make this bulletproof? Is it possible only to match the
exact filename?

I would be really glad if someone can help!

Regards
suntrop


[jQuery] Re: problem with internet explorer...

2008-10-06 Thread Manarius

i just solved the silly question myself.
you just have to add:

var toLoad = href+' #ContentText';
target.load(toLoad, function() {

instead of:
 target.load(href, function() {

into jquery.history.js around line 250.

but the bugs remain :(
greetings,
jascha


[jQuery] Re: jQuery cycle and handling new request/page changed

2008-10-06 Thread Mike Alsup

 me=noob
 Mike=the man

 *Thanks !*

Ha, no problem.  Don't feel bad, that's a very subtle issue and it's
really a bug in my code, not yours.

Mike



[jQuery] Can jQuery load from DOM?

2008-10-06 Thread jQuery(new).to(me)

Hello,

I am trying to load jQuery from Javascript like the following code.


== code ==
if (typeof jQuery == 'undefined' || !jQuery) {
var s = document.createElement('script');
s.setAttribute('type','text/javascript');
s.setAttribute('src','http://localhost/jquery-latest.min.js');
document.getElementsByTagName('head')[0].appendChild(s);
}
== end of code ==

However, then this code is included, jquery-latest.min.js is
included, but the page shows javascript error, $ is not defined.

Any tips to solve this problem??

Thanks bunch in advance!


[jQuery] Re: Jquery and ASP.NET

2008-10-06 Thread [EMAIL PROTECTED]

MorningZ, thanks for the ideas. Personally, I don't prefer overriding
control ID's as they have to be unique. You can easily break your code
if you don't pay enough attention.  For .NET guys, I recommend using 
%=ControlName.ClientID% syntax.

The only downside is that you can not put your scripts in an external
(js) file. You have to put them to the parent page where your aspnet
code is.

On Oct 6, 5:49 am, MorningZ [EMAIL PROTECTED] wrote:
 Suggestion for .NET peoples

 if you don't want MasterPages or UserControls (or any other Naming
 Container for that matter to mess with your control ID's, check out
 this library

 http://www.wilcob.com/Demos/IDOverride/

 Also, to easily work with JSON, this library is most excellent

 http://james.newtonking.com/pages/json-net.aspx

 And lastly, Rick Strahl's blog is an excellent one to follow in jQuery/
 ASP.NET land

 http://www.west-wind.com/weblog/

 On Oct 5, 8:51 pm, [EMAIL PROTECTED] [EMAIL PROTECTED]
 wrote:

  Sure. Check our corporate page : spina.com.tr. It's built on .net 3.5
   jQuery 1.2.6

  (See html source code to understand how we use it.)

  On Oct 5, 9:45 pm, eduardo [EMAIL PROTECTED] wrote:

   Is possible use JQuery in aspx pages writing with ASp.net 3.5 ?

   Thanks in advance

   Eduardo


[jQuery] treeview: prendered + cookie persistence

2008-10-06 Thread pjdevries

I'm using treeview (version 1.4.1) with the 'prerendered' option in
combination with 'cookie' persistence. This seems to work fine until
the page with the treeview is build from scratch (as opposed to
refreshed as a result of pressing the browser back button for
instance). Because I build the prerendered treeview with all nodes
collapsed, all list items initially have the 'expandable' class set.
After the persistence logic has done it's thing, one would expect the
'expandable' classes of the expanded nodes to have changed to
'collapsable' but unfortunately that is not the case.

Is there a simple solution or workaround for this problem?


[jQuery] How to uninstall the

2008-10-06 Thread Kynn Jones
I have a jQuery-based script that performs some updates on the current page
(using the load method), and eventually visits a second page, by resetting
window.location.

This works fine, but if the user hits the back button, the whole sequence is
repeated, including the re-loading of the second page.

I'd like to prevent this behavior.  Is it possible?

I tried removing the script with $( 'script[src*=/path/to/script]'
).remove(), but this did not prevent the whole sequence from running again.

Then I thought that the reason for this was that using remove() does not get
rid of the callback that was originally installed at the very end of the
script with jQuery( MyScript.sleep ).  So I tried to uninstall the callback
with $( 'document' ).unbind( 'ready', ... ), but this didn't do anything
either.

How can uninstall the onready callback?  If this is not possible, is there
some other way that I can block the sequence from running a second time when
the user the BACK button?

The script has the following form:

var MyScript = ( function ( $ ) {
  var SELF_URL = location.pathname + location.search;

  var $$; $$ = {
check: function () {
  if ( $$.results_ready() ) {
$( 'script[src*=/path/to/script]' ).remove();
$( 'document' ).unbind( 'ready', $$.sleep );  // is this right???
window.location = SELF_URL + 'results=1';
  }
  else {
$$.sleep();
  }
},

sleep: function () {
  setTimeout( $$.refresh, 2000 );
},

refresh: function () {
  $( 'body' ).load( SELF_URL, $$.check );
},

results_ready: function () {
  // etc., etc.
}
  };

  return $$;
} )( jQuery );

jQuery( MyScript.sleep );



Thanks in advance!

Kynn


[jQuery] Re: ANNOUNCE: jQuery listnav plugin

2008-10-06 Thread Jack Killpatrick


Hi Ettiene, how'd using it go for you?

Thanks to everyone else for the initial feedback. I'm interested to hear 
if anyone has implemented it anywhere. ?


- Jack

Ettiene wrote:

Excellent stuff man! I'm already busy using it hehe

Ettiene

  





[jQuery] Re: treeview: prendered + cookie persistence

2008-10-06 Thread Jörn Zaefferer
If you use prerendered, you have to read the cookie on the serverside
and render the tree accordingly. Otherwise you have to disable
prerendered to be able to use cookie persistence.

Jörn

On Mon, Oct 6, 2008 at 6:08 PM, pjdevries [EMAIL PROTECTED] wrote:

 I'm using treeview (version 1.4.1) with the 'prerendered' option in
 combination with 'cookie' persistence. This seems to work fine until
 the page with the treeview is build from scratch (as opposed to
 refreshed as a result of pressing the browser back button for
 instance). Because I build the prerendered treeview with all nodes
 collapsed, all list items initially have the 'expandable' class set.
 After the persistence logic has done it's thing, one would expect the
 'expandable' classes of the expanded nodes to have changed to
 'collapsable' but unfortunately that is not the case.

 Is there a simple solution or workaround for this problem?



[jQuery] Re: Match the filename to highlight current link on page

2008-10-06 Thread Adrian Lynch

Extract the href and then split it into it's various sections

var href  = some selector;

hrefSections = href.split(/);

If there are no query string parameters you have the file name in the
last array element:

var fileName = hrefSections[hrefSections.length - 1];

Now do your other selector and you can compare the whole file name and
not just the end.

Adrian

On Oct 6, 4:46 pm, suntrop [EMAIL PROTECTED] wrote:
 Hi there,

 I've following code to highlight the current link in my menu:
 var path = location.pathname.substring(1);
 if (path != '') {
         $('#navigation [EMAIL PROTECTED]' + path + 
 ']').css('color','#c03');} else {

         $('#navigation [EMAIL PROTECTED]/]').css('color','#c03');

 }

 But some files/pages have similar names like:
 potatoes.html
 fried-potatoes.html
 The second page highlights the first link (potatoes.html) as well.
 What's wrong of course.

 How can I make this bulletproof? Is it possible only to match the
 exact filename?

 I would be really glad if someone can help!

 Regards
 suntrop


[jQuery] Re: jquery code works with firefox but not ie.

2008-10-06 Thread ajpiano

one of the biggest things to watch out for is malformed markup.
typically, firefox will be much friendlier on markup that IE refuses
to inject.

have a look at your  and /


[jQuery] Re: Can jQuery load from DOM?

2008-10-06 Thread Michael Geary

Yes, you can do that. I'll bet the reason you're getting $ undefined is that
you're trying to reference it immediately after running that code. The
dynamic script element loads asynchronously, and as with all asynchronous
JavaScript, you need to either use a completion callback function or a
setInterval polling loop. The callback is a much better way to go.

I don't think jQuery provides this out of the box, but it's easy to add to
your own copy of jQuery. Simply add a line like this at the very end of the
file:

window.jQueryLoaded  jQueryLoaded();

And define a jQueryLoaded function in your code:

function jQueryLoaded() {
$(function() {
// go to town here!
});
}

Here's a working test case:

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

-Mike

 From: jQuery(new).to(me)
 
 Hello,
 
 I am trying to load jQuery from Javascript like the following code.
 
 
 == code ==
 if (typeof jQuery == 'undefined' || !jQuery) {
   var s = document.createElement('script');
   s.setAttribute('type','text/javascript');
   s.setAttribute('src','http://localhost/jquery-latest.min.js');
   document.getElementsByTagName('head')[0].appendChild(s);
 }
 == end of code ==
 
 However, then this code is included, jquery-latest.min.js 
 is included, but the page shows javascript error, $ is not defined.
 
 Any tips to solve this problem??
 
 Thanks bunch in advance!



[jQuery] Re: Can jQuery load from DOM?

2008-10-06 Thread Web Specialist
Using this approach is possible to allow js file cache? Or in every page
that js file needs to load again?

Cheers
Marco Antonio

On Mon, Oct 6, 2008 at 2:54 PM, Michael Geary [EMAIL PROTECTED] wrote:


 Yes, you can do that. I'll bet the reason you're getting $ undefined is
 that
 you're trying to reference it immediately after running that code. The
 dynamic script element loads asynchronously, and as with all asynchronous
 JavaScript, you need to either use a completion callback function or a
 setInterval polling loop. The callback is a much better way to go.

 I don't think jQuery provides this out of the box, but it's easy to add
 to
 your own copy of jQuery. Simply add a line like this at the very end of the
 file:

window.jQueryLoaded  jQueryLoaded();

 And define a jQueryLoaded function in your code:

function jQueryLoaded() {
$(function() {
// go to town here!
});
}

 Here's a working test case:

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

 -Mike

  From: jQuery(new).to(me)
 
  Hello,
 
  I am trying to load jQuery from Javascript like the following code.
 
 
  == code ==
  if (typeof jQuery == 'undefined' || !jQuery) {
var s = document.createElement('script');
s.setAttribute('type','text/javascript');

  s.setAttribute('src','http://localhost/jquery-latest.min.js'http://localhost/jquery-latest.min.js%27
 );
document.getElementsByTagName('head')[0].appendChild(s);
  }
  == end of code ==
 
  However, then this code is included, jquery-latest.min.js
  is included, but the page shows javascript error, $ is not defined.
 
  Any tips to solve this problem??
 
  Thanks bunch in advance!




[jQuery] Re: R: [jQuery] Only show div's within parent.

2008-10-06 Thread ricardobeat

This will toggle the element with class 'hidden' next to the a:

$('a.show').click(function(){
   $(this).next('.hidden').slideToggle(fast);
});

- ricardo

On Oct 6, 6:03 am, Adrian Lynch [EMAIL PROTECTED] wrote:
 Or:

 $(document).ready(function(){
         $(a.show).click(function () {
                 $(this).siblings(div.hidden).slideToggle(fast);
         });

 });

 Which will hopefully protect against the markup changing.

 Or better still, go up to the parent, then back in to find the right
 div.hidden:

 $(document).ready(function(){
         $(a.show).click(function () {
                 $(div.hidden, $
 (this).parent()).slideToggle(fast);
         });

 });

 Adrian

 On Oct 5, 4:06 pm, diego valobra [EMAIL PROTECTED] wrote:

  Hi, another example..

  $(document).ready(function(){
   
     $('.hidden').hide(0) // just if you want all items closed at the 
  beginning
    
     $('a.show').click(function () {
            
          $('.hidden').slideUp('fast') // just if you want a kind of accordion
     
          $(this).next('div').slideToggle('fast') // it takes just the next 
  div :)

      });
     

  });

  here is a demo http://www.pirolab.it/piro_09/slide_up.html

  Diego

  --- Dom 5/10/08, [EMAIL PROTECTED] [EMAIL PROTECTED] ha scritto:
  Da: [EMAIL PROTECTED] [EMAIL PROTECTED]
  Oggetto: [jQuery] Only show div's within parent.
  A: jQuery (English) jquery-en@googlegroups.com
  Data: Domenica 5 ottobre 2008, 14:32

  This is my first time with jQuery!

  I have a list like this:
  ul id=results
          li
                  a href=# class=showsome text/a
                  div class=hiddensome text/div
          /li
          li
                  a href=# class=showsome text/a
                  div class=hiddensome text/div
          /li
          li
                  a href=# class=showsome text/a
                  div class=hiddensome text/div
          /li
  /ul

  And a script like this:
  $(document).ready(function(){
          $(a.show).click(function () {
                  $(div.hidden).slideToggle(fast);
          });

  });

  Now when a press one of the links with the class show it does show
  every div with the class hidden. But I only want to show the child
  div of the link show. Not all of them.

  Is that possible and how?

        Scopri il blog di Yahoo! Mail:
  Trucchi, novità e la tua opinione.http://www.ymailblogit.com/blog


[jQuery] Re: Can jQuery load from DOM?

2008-10-06 Thread Michael Geary
Browser caching works with this technique, exactly as it does with a
script tag.
 
A good way to verify this is with the outstanding Fiddler HTTP debugging
proxy (Windows only, but if you don't use Windows, this is the killer app
for a Windows VM under VMware):
 
http://www.fiddlertool.com/
 
-Mike
 



  _  

From: Web Specialist

Using this approach is possible to allow js file cache? Or in every page
that js file needs to load again?

Cheers
Marco Antonio


On Mon, Oct 6, 2008 at 2:54 PM, Michael Geary [EMAIL PROTECTED] wrote:



Yes, you can do that. I'll bet the reason you're getting $ undefined is that
you're trying to reference it immediately after running that code. The
dynamic script element loads asynchronously, and as with all asynchronous
JavaScript, you need to either use a completion callback function or a
setInterval polling loop. The callback is a much better way to go.

I don't think jQuery provides this out of the box, but it's easy to add to
your own copy of jQuery. Simply add a line like this at the very end of the
file:

   window.jQueryLoaded  jQueryLoaded();

And define a jQueryLoaded function in your code:

   function jQueryLoaded() {
   $(function() {
   // go to town here!
   });
   }

Here's a working test case:

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

-Mike

 From: jQuery(new).to(me)


 Hello,

 I am trying to load jQuery from Javascript like the following code.


 == code ==
 if (typeof jQuery == 'undefined' || !jQuery) {
   var s = document.createElement('script');
   s.setAttribute('type','text/javascript');
   s.setAttribute('src','http://localhost/jquery-latest.min.js'
http://localhost/jquery-latest.min.js%27 );
   document.getElementsByTagName('head')[0].appendChild(s);
 }
 == end of code ==

 However, then this code is included, jquery-latest.min.js
 is included, but the page shows javascript error, $ is not defined.

 Any tips to solve this problem??

 Thanks bunch in advance!






[jQuery] Re: Tablesorter Plugin and widgets

2008-10-06 Thread ajpiano

you need to make your addWidget method handle a function as an
argument, and then execute the function if it is supplied and a
function...

function foo(bar,callback) {
$(bar).remove();
callback  $.isFunction(callback)  callback();
}


foo(#baz,function() {alert(done!);}); // removes baz and then says
done
foo(#baz); // just removes baz.



On Oct 4, 9:55 am, Issac  Kelly [EMAIL PROTECTED] wrote:
 I'm working on Christian Bach's tablesorter.

 I've made a widget that can select rows, and now I want to make a
 widget that can delete rows, and have a callback.

 The problem is the callback.

 The widgets are called like this

         $.tablesorter.addWidget({
             // give the widget a id
             id: selectRows,
             // format is called when the on init and when a sorting has
 finished
             format: function(table)
                 {
                         $(tbody tr,table).click(function(e){
                         row = this;
                                 if($(row).hasClass('selectedRow'))
                                         $(row).removeClass('selectedRow');
                                 else
                                         $(row).addClass('selectedRow');
                         });
             }
         });
         $.tablesorter.addWidget({
             // give the widget a id
             id: deleteRows,
             // format is called when the on init and when a sorting has
 finished
             format: function(table)
                 {
                         if($(tfoot,table).length)
                         {
                                 //add the foot
                                 $(table).append(tfoot/tfoot);
                         }
                         //add a row.
                         $(tfoot,table).append(tr class=\deleteRow\a 
 href=\#\
 class=\deleteRows\Delete selected entries/a);

                         $(.deleteRows).click(function(){
                                 $(.selectedRow,table).each(function(){
                                         $(this).remove();
                                         ///I WANT A CALLBACK HERE
                                 });
                         });
                 }
         });

     $(table).tablesorter({
         widgets: ['selectRows','deleteSelected']
     });

 So, the widgets are called via a text array.  How could I add a
 callback to a widget?


[jQuery] Re: simple table filtering?

2008-10-06 Thread MorningZ

Also, this blog post by John Resig may be of help

http://ejohn.org/blog/jquery-livesearch/

I could see that as easily being tweaked to work on table rows instead
of divs





On Oct 6, 11:33 am, bdee1 [EMAIL PROTECTED] wrote:
 that is very helpful and should be a great starting point - thank you very
 much for posting!!  I will let you know how i make out.



 Eric-286 wrote:

  This sounds specialized enough that you'll probably be writing the
  code yourself. No problem, jQuery will help!

  Basically, every time the contents of your text fields change, you'll
  go through every row of the table, check specific cells, and if they
  don't match the text (http://www.w3schools.com/jsref/jsref_match.asp)
  from the text field, hide the row.  You'll need to set up the Drop-
  down menus appropriately -- I would recommend that you have the Value
  of the select Options be the index of the column.

  So if your table is:
  Name | Address | Ice Cream

  Your select would contain:
  option value='0'Name/option
  option value='1'Address/option
  option value='2'Ice Cream/option

  I started the index at 0, so I'll be using eq() in my code.  If I
  started at 1, then I'd use nthChild:
 http://docs.jquery.com/Core/eq -- index starts at 0
 http://docs.jquery.com/Selectors/nthChild -- index starts at 1

  You could generate these dropdowns automatically, but I won't get into
  that here.

  So the jQuery code that would get triggered on a search would look
  something like this (untested code):

  $('#myTable tbody tr').each( function () {
    var that = $(this); // save jQuery version of this

    var cellValueToConsider = that.find('td').eq(   $
  ('#firstDropDown').val() ).text();

    if (! cellValueToConsider.match( $('#firstSearchField').val() )  ) {
      that.parent().hide();
    }

     // repeat similar logic with #secondDropDown and #secondSearchField
    //   or generalize the code for an arbitrary number of search
  fields.

  });

  On Oct 6, 10:50 am, bdee1 [EMAIL PROTECTED] wrote:
  I am looking for a simple way to filter the contents of a table.  to
  clarify
  - i would like to have a form at the top of an HTML table where i can
  select
  a field to filter on and then a textbox.  as i type in the textbox, the
  table's contents will change to display only rows where the selected
  field
  contains the search term.

  I actually found a plugin to do this (uiTableFilter), but i need to take
  ti
  one step further.  I need to have the ability to filter on more than one
  column.  I tried just having two forms on the page, each calling the
  uiTableFilter plugin, but as soon as you start typing in one box, it just
  cancels out the search from any of the other boxes.

  any suggestions here?
  --
  View this message in
  context:http://www.nabble.com/simple-table-filtering--tp19839476s27240p198394...
  Sent from the jQuery General Discussion mailing list archive at
  Nabble.com.

 --
 View this message in 
 context:http://www.nabble.com/simple-table-filtering--tp19839476s27240p198403...
 Sent from the jQuery General Discussion mailing list archive at Nabble.com.


[jQuery] Re: Disable globals for jQuery.get()?

2008-10-06 Thread Micky Hulse

Thanks for the help all!

I am going to try your suggestions, and also put-together a simple
test page in order to show/test the specific code... I am wondering if
maybe some other jQuery  plugin/script is causing problems with this.

I will be back shortly with demo page.

Thanks a billion!!!

Micky

On Oct 6, 5:03 am, Mike Alsup [EMAIL PROTECTED] wrote:
  But it triggers ajaxStart/ajaxStop... I have tried:

  $.ajax({
          url: token,
          global: false

  });

 Can you post a demo that shows this not working?  global: false should
 prevent the global ajax events from triggering.


[jQuery] not defined error using instance variable in each callback

2008-10-06 Thread marty

This is driving me crazy

I'm trying to copy elements from a wrapped set into an array.

This works:

// build an array of text on the line
var rowTextArray = new Array();

// add text into array
this.children.each( function() {
rowTextArray.push = encodeURIComponent( $(this).text() 
);
} );


This does not:

// build an array of text on the line
this.rowTextArray = new Array();

// add text into array
this.children.each( function() {
this.rowTextArray.push = encodeURIComponent( 
$(this).text() );
} );

Here's the error I get:
Error: this.rowTextArray is undefined

Any help would be greatly appreciated!!

Regards,
Marty


[jQuery] Chicago JavaScript Meetup

2008-10-06 Thread Justin Meyer

Excuse 'spamming' the forum, but it's relevant 

Vlad Didenko is organizing Chicago's first JavaScript meetup.  If you
are in the Chicago area and looking to improve your JavaScript skills,
join the group at http://javascript.meetup.com/10/.

We are posting discussion/talk topics to http://tinyurl.com/jsca081017.
Of course, jQuery will be featured.

Thanks,

Justin Meyer


[jQuery] Trouble getting 1 hover to work at a time

2008-10-06 Thread line47

I know what needs to be done but I'm not sure how to accomplish it.

I want the span inside of the a.appHelpPopup  to show on hover. Right
now both span messages show on hover. :(
I'm not sure how to only get the proper message associated to hover an
not all spans.

Here is my markup.

script type=text/javascript
$(document).ready(function() {
$(.checkListMedium .appHelpPopup span).hide();

 $(.checkListMedium .appHelpPopup).hover(
  function () {
  $('.appHelpPopup span').show();  }
,
  function () {
$(.appHelpPopup span).hide();
  }
);
});
/script


-

div class=checkListMedium
  label* Question Type/label
  table border=0
id=applicationForm_AuthoringModeControlsContainer_questionType
tbody
  tr
tdinput type=radio language=javascript
onclick=javascript:setTimeout('__doPostBack(\'applicationForm
$AuthoringModeControlsContainer$questionType$0\',\'\')', 0)
value=TextBox
name=applicationForm:AuthoringModeControlsContainer:questionType
id=applicationForm_AuthoringModeControlsContainer_questionType_0/
  label
for=applicationForm_AuthoringModeControlsContainer_questionType_0Text
Boxa href=#create class=appHelpPopupimg border=0 alt=Text
Box Help src=help.png/spanProvides a box to enter text into./
span/a/label/td
  /tr
  tr
tdinput type=radio language=javascript
onclick=javascript:setTimeout('__doPostBack(\'applicationForm
$AuthoringModeControlsContainer$questionType$1\',\'\')', 0)
value=TextArea
name=applicationForm:AuthoringModeControlsContainer:questionType
id=applicationForm_AuthoringModeControlsContainer_questionType_1/
  label
for=applicationForm_AuthoringModeControlsContainer_questionType_1Text
Areaa href=#create class=appHelpPopupimg border=0 alt=Text
Area Help src=help.png/span Provides an area for entering
multiple lines of text./span/a/label/td
  /tr
/tbody
  /table
/div



Any help is appreciated thanks!




[jQuery] Opacity in IE

2008-10-06 Thread Greg G

I have some animation I'm working on that works fine in Firefox but
not in IE.  I have two issues:

Part of the animation is fading out an element.  I want to integrate
this with the animate function and not use the fade out option.  I've
tried using filter : alpha(opacity... but that didn't help.

The callback function, which essentialy resets the animation behind
the scene, doesn't work.

I figure a URL would be better than me putting in code.  Plus, I can't
remember if I need to wrap my code in order to post it.

http://www.silverchild.com/menuwidget/blowup.html

Thank you in advance for everyones help.


[jQuery] jscrollpane not functioning in iframes

2008-10-06 Thread ekene


i made two test html pages.

this is the link for the child page which calls jscrollpane
http://ekeneijeoma.com/clients/lrany/recordTest.html

this is the script in the recordTest.html page
$(document).ready(function(){
  $('#record-scroll-pane').jScrollPane();
});

this is the link for the root/parent page 
http://ekeneijeoma.com/clients/lrany/recordScrollPaneTest.html

does anyone see any issues related to why the jscrollpane is not
functioning? using firebug you can see that the divs for jscrollpane are
added to the dom but nothing is displayed.

-- 
View this message in context: 
http://www.nabble.com/jscrollpane-not-functioning-in-iframes-tp19839944s27240p19839944.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: append mailto link to orphan plain text email address

2008-10-06 Thread skankster

No one?

On 2 Okt., 14:45, skankster [EMAIL PROTECTED] wrote:
 Hi,

 I have a div that contains simple text data with line breaks. I want
 to append a mailto link to the email address but so far I have not
 been able to select the email.

 The container looks something like this:

 div id=myId
         Username: Johnnybr /
         Email: [EMAIL PROTECTED]
 /div

 With the help of jQuery it should look like this:

 div id=myId
         Username: Johnnybr /
         Email: a href=mailto:;[EMAIL PROTECTED]/a
 /div

 My first intention was to use a filter like:

 $('#myId').contents().filter(':contains(@)');

 but I found out that I couldn't apply it since the container had no
 children. So I used a function first to wrap the elements into span
 tags and then applied 'find':

   $.fn.orphans = function(){
         var ret = [];
         this.each(function(){$.each(this.childNodes, function() {if
                 (this.nodeType == 3 ! $.nodeName(this, br) ) 
 ret.push(this)})});
         return $(ret);
    }

  $(document).ready(function() {
         $('#myId').orphans().wrap('span/');
         $('#myId').find(':contains(@)').wrap('a href=mailto:/');

  });

 I'm still at a loss as to how to select just the email address without
 the preceeding 'Email:' and am wondering if I'm not heading in a
 totally wrong direction with the orphan wrapping function.

 I gladly appreciate any assistance offered concerning this issue!


[jQuery] Re: Disable globals for jQuery.get()?

2008-10-06 Thread Micky Hulse

Hello,

Here are a few test pages... Sorry, I have not had time to try the
solutions offered here yet.

Demo 1:
http://www.ambiguism.com/sandbox/scripts/jquery/get-ajaxStartStop-
test/

Demo 2:
http://www.ambiguism.com/sandbox/scripts/jquery/get-ajaxStartStop-
test/getOff.php

Sorry in advance if any of my jQuery coding looks noobish and/or is
setup badly. Also, I am sure there is something really obvious that I
am missing... If that is the case, I deeply apologize for wasting
anyone's time. :(

Thanks!
Cheers,
Micky


[jQuery] Re: Intercept Back button click on browser

2008-10-06 Thread Leanan

*sigh*

Ok.  I've decided upon the jquery.history_remote.js plugin by Klaus.
I have it working, except there is one slight problem, and I can't
figure out how to fix it.

I have a table of links that, when you click on a link, they pull up
more detailed data, load it into a div, so on and so forth as I've
described earlier.  I've changed the href to be #detailed_infosome
number.

I made the call to initialize, giving it a call back function that
will show the original div you see and hide the div(s) with the
detailed info, as I'd like it to.  The problem is that the data you
get from clicking on the link with the #detailed_info href is an ajax
call.  And it appears that when I enable ajaxHistory that all the
links now make two ajax requests instead of one!  I can stop it from
doing this by making a preventDefault call on the event, but then it
doesn't get added to the history.  If I completely remove the history
stuff, the links only make one ajax call, and the data is only
retrieved once as I expect, but then now the back link doesn't work as
I need it.

I'm about ready to rip my hair out...  does anyone have any
suggestions?


[jQuery] Re: Disable globals for jQuery.get()?

2008-10-06 Thread Mike Alsup

 Demo 1:
 http://www.ambiguism.com/sandbox/scripts/jquery/get-ajaxStartStop-
 test/

 Demo 2:
 http://www.ambiguism.com/sandbox/scripts/jquery/get-ajaxStartStop-
 test/getOff.php


I think you've just misunderstood how to set the default ajax
options.  Based on this comment:

 /* Setup global ajax options: */
$.ajax({
   url: token,
   global: false
});

what you probably want instead is this:

$.ajaxSettings.url = token;
$.ajaxSettings.global = false;

Mike


[jQuery] Re: not defined error using instance variable in each callback

2008-10-06 Thread marty

Thanks very much for the reply!

That was a big help!

I was missing the fact that this inside the loop is not the same as
this outside the loop.

Your suggestion really helped!

Regards,
Marty

On Oct 6, 12:59 pm, MorningZ [EMAIL PROTECTED] wrote:
 i would take a guess that you are missing that this points to two
 different things inside and outside the .each loop

 which makes sense because you have this on the outside, and then
 loop against this.children,  so inside the loop this actually is
 the nth child of this

 see if

 this.children.each( function() {
        this.parent.rowTextArray.push = encodeURIComponent( $
 (this).text() );

 } );

 works... although i will note that is just a shot in the dark without
 seeing more of your script

 On Oct 6, 1:22 pm, marty [EMAIL PROTECTED] wrote:

  This is driving me crazy

  I'm trying to copy elements from a wrapped set into an array.

  This works:

                  // build an array of text on the line
                  var rowTextArray = new Array();

                  // add text into array
                  this.children.each( function() {
                          rowTextArray.push = encodeURIComponent( 
  $(this).text() );
                  } );

  This does not:

                  // build an array of text on the line
                  this.rowTextArray = new Array();

                  // add text into array
                  this.children.each( function() {
                          this.rowTextArray.push = encodeURIComponent( 
  $(this).text() );
                  } );

  Here's the error I get:
      Error: this.rowTextArray is undefined

  Any help would be greatly appreciated!!

  Regards,
  Marty


[jQuery] Re: Intercept Back button click on browser

2008-10-06 Thread Klaus Hartl

Is it possible for you to put up a demo?

--Klaus


On 6 Okt., 22:11, Leanan [EMAIL PROTECTED] wrote:
 *sigh*

 Ok.  I've decided upon the jquery.history_remote.js plugin by Klaus.
 I have it working, except there is one slight problem, and I can't
 figure out how to fix it.

 I have a table of links that, when you click on a link, they pull up
 more detailed data, load it into a div, so on and so forth as I've
 described earlier.  I've changed the href to be #detailed_infosome
 number.

 I made the call to initialize, giving it a call back function that
 will show the original div you see and hide the div(s) with the
 detailed info, as I'd like it to.  The problem is that the data you
 get from clicking on the link with the #detailed_info href is an ajax
 call.  And it appears that when I enable ajaxHistory that all the
 links now make two ajax requests instead of one!  I can stop it from
 doing this by making a preventDefault call on the event, but then it
 doesn't get added to the history.  If I completely remove the history
 stuff, the links only make one ajax call, and the data is only
 retrieved once as I expect, but then now the back link doesn't work as
 I need it.

 I'm about ready to rip my hair out...  does anyone have any
 suggestions?


[jQuery] Re: Trouble getting 1 hover to work at a time

2008-10-06 Thread Leanan

I haven't tested this, but I would try something along the following:

$('.appHelpPopup').children('span').show();

The problem is that you have more than one DOM element classed as
appHelpPopup with a span under it, so that selector is grabbing all of
them, and applying show to all of them.  You might need to change it
to child instead of children, I always get those mixed up.


[jQuery] Re: Can jQuery load from DOM?

2008-10-06 Thread ricardobeat

Google has an API that does that, check it out:

http://code.google.com/apis/ajaxlibs/

- ricardo

On Oct 6, 3:29 pm, Michael Geary [EMAIL PROTECTED] wrote:
 Browser caching works with this technique, exactly as it does with a
 script tag.

 A good way to verify this is with the outstanding Fiddler HTTP debugging
 proxy (Windows only, but if you don't use Windows, this is the killer app
 for a Windows VM under VMware):

 http://www.fiddlertool.com/

 -Mike

   _  

 From: Web Specialist

 Using this approach is possible to allow js file cache? Or in every page
 that js file needs to load again?

 Cheers
 Marco Antonio

 On Mon, Oct 6, 2008 at 2:54 PM, Michael Geary [EMAIL PROTECTED] wrote:

 Yes, you can do that. I'll bet the reason you're getting $ undefined is that
 you're trying to reference it immediately after running that code. The
 dynamic script element loads asynchronously, and as with all asynchronous
 JavaScript, you need to either use a completion callback function or a
 setInterval polling loop. The callback is a much better way to go.

 I don't think jQuery provides this out of the box, but it's easy to add to
 your own copy of jQuery. Simply add a line like this at the very end of the
 file:

    window.jQueryLoaded  jQueryLoaded();

 And define a jQueryLoaded function in your code:

    function jQueryLoaded() {
        $(function() {
            // go to town here!
        });
    }

 Here's a working test case:

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

 -Mike

  From: jQuery(new).to(me)

  Hello,

  I am trying to load jQuery from Javascript like the following code.

  == code ==
  if (typeof jQuery == 'undefined' || !jQuery) {
        var s = document.createElement('script');
        s.setAttribute('type','text/javascript');
        s.setAttribute('src','http://localhost/jquery-latest.min.js'

 http://localhost/jquery-latest.min.js%27 );

        document.getElementsByTagName('head')[0].appendChild(s);
  }
  == end of code ==

  However, then this code is included, jquery-latest.min.js
  is included, but the page shows javascript error, $ is not defined.

  Any tips to solve this problem??

  Thanks bunch in advance!


[jQuery] Re: not defined error using instance variable in each callback

2008-10-06 Thread marty

Hi Mike,

You're right, I want to be able to use this.rowTextArray later on.

You're code suggestion works great!

Thanks so much for the help!!

Regards,
Marty



On Oct 6, 1:24 pm, Michael Geary [EMAIL PROTECTED] wrote:
 That's right, the mistaken use of this is the problem - one of them anyway
 - but that solution won't work (what is the parent property of a DOM
 element?).

 Another problem is the misuse of push - it's a method, not a property you
 can store into. (You *can* store into the push property - as the code does
 successfully, but what that does is replace the normal push method with
 your data!)

 Marty, I assume that the purpose of the second example is so you'll have
 this.rowTextArray available for use elsewhere in your code, is that right?

 Then try this (pun intended):

     // build an array of text on the line
     var rowTextArray = this.rowTextArray = [];

     // add text into array
     this.$children.each( function() {
         rowTextArray.push( encodeURIComponent( $(this).text() ) );
     });

 Note the correct use of .push, and also the optional (but nicer) use of []
 instead of new Array().

 I also took the liberty of renaming the children property $children, a
 naming convention I highly recommend (and you'll see in much jQuery code)
 when you have a variable or property containing a jQuery object as I assume
 this.children does.

 -Mike

  From: MorningZ

  i would take a guess that you are missing that this points
  to two different things inside and outside the .each loop

  which makes sense because you have this on the outside, and
  then loop against this.children,  so inside the loop this
  actually is the nth child of this

  see if

  this.children.each( function() {
         this.parent.rowTextArray.push = encodeURIComponent( $
  (this).text() );
  } );

  works... although i will note that is just a shot in the dark
  without seeing more of your script

  On Oct 6, 1:22 pm, marty [EMAIL PROTECTED] wrote:
   This is driving me crazy

   I'm trying to copy elements from a wrapped set into an array.

   This works:

                   // build an array of text on the line
                   var rowTextArray = new Array();

                   // add text into array
                   this.children.each( function() {
                           rowTextArray.push = encodeURIComponent(
   $(this).text() );
                   } );

   This does not:

                   // build an array of text on the line
                   this.rowTextArray = new Array();

                   // add text into array
                   this.children.each( function() {
                           this.rowTextArray.push =
  encodeURIComponent(
   $(this).text() );
                   } );

   Here's the error I get:
       Error: this.rowTextArray is undefined

   Any help would be greatly appreciated!!

   Regards,
   Marty


[jQuery] Re: Intercept Back button click on browser

2008-10-06 Thread Leanan

I'll see if I can create a demo that has the same behavior.

On Oct 6, 4:25 pm, Klaus Hartl [EMAIL PROTECTED] wrote:
 Is it possible for you to put up a demo?

 --Klaus

 On 6 Okt., 22:11, Leanan [EMAIL PROTECTED] wrote:

  *sigh*

  Ok.  I've decided upon the jquery.history_remote.js plugin by Klaus.
  I have it working, except there is one slight problem, and I can't
  figure out how to fix it.

  I have a table of links that, when you click on a link, they pull up
  more detailed data, load it into a div, so on and so forth as I've
  described earlier.  I've changed the href to be #detailed_infosome
  number.

  I made the call to initialize, giving it a call back function that
  will show the original div you see and hide the div(s) with the
  detailed info, as I'd like it to.  The problem is that the data you
  get from clicking on the link with the #detailed_info href is an ajax
  call.  And it appears that when I enable ajaxHistory that all the
  links now make two ajax requests instead of one!  I can stop it from
  doing this by making a preventDefault call on the event, but then it
  doesn't get added to the history.  If I completely remove the history
  stuff, the links only make one ajax call, and the data is only
  retrieved once as I expect, but then now the back link doesn't work as
  I need it.

  I'm about ready to rip my hair out...  does anyone have any
  suggestions?


[jQuery] Re: jscrollpane not functioning in iframes

2008-10-06 Thread ricardobeat

It is functioning, but the scrollbar overflows the iframe. Give the
iframe a width of 292px and you'll see it.

- ricardo

On Oct 6, 4:06 pm, ekene [EMAIL PROTECTED] wrote:
 i made two test html pages.

 this is the link for the child page which calls 
 jscrollpanehttp://ekeneijeoma.com/clients/lrany/recordTest.html

 this is the script in the recordTest.html page
 $(document).ready(function(){
       $('#record-scroll-pane').jScrollPane();

 });

 this is the link for the root/parent 
 pagehttp://ekeneijeoma.com/clients/lrany/recordScrollPaneTest.html

 does anyone see any issues related to why the jscrollpane is not
 functioning? using firebug you can see that the divs for jscrollpane are
 added to the dom but nothing is displayed.

 --
 View this message in 
 context:http://www.nabble.com/jscrollpane-not-functioning-in-iframes-tp198399...
 Sent from the jQuery General Discussion mailing list archive at Nabble.com.


[jQuery] Re: Intercept Back button click on browser

2008-10-06 Thread Leanan

Klaus,

I've created a demo that exhibits this behavior.  I modified your demo
that is included with the script at http://www.stilbuero.de/jquery/history/

All you should have to do is change your index.html to be the
following:

html lang=en
  head
  meta http-equiv=Content-Type content=text/html;
charset=utf-8
  meta http-equiv=Content-Style-Type content=text/css
  meta http-equiv=Content-Script-Type content=text/
javascript
  titlejQuery history/remote - solution for hijaxing links/
title
  script src=jquery-1.1.3.1.pack.js type=text/javascript/
script
  script src=jquery.history_remote.js type=text/javascript/
script
  /head
  body

div id=div1
  a href=#test1 class=testing id=Chap1Test Chap1/abr
  a href=#test2 class=testing id=Chap2Test Chap2/abr
  a href=#test3 class=testing id=Chap3Test Chap3/abr
/div

div id=div2 /div
script type=text/javascript
  $(document).ready(function() {
$.ajaxHistory.initialize(function() {
  $('#div1').show();
  $('#div2').hide();
});

$('.testing').click(function() {
  if ($(this).attr('id') == Chap1) {
$.get('chapter-1.html', function(data) {
  $('#div2').append(data);
  $('#div1').hide();
  $('#div2').show();
});
  }
  if ($(this).attr('id') == Chap2) {
$.get('chapter-2.html', function(data) {
  $('#div2').append(data);
  $('#div1').hide();
  $('#div2').show();
});
  }
  if ($(this).attr('id') == Chap1) {
$.get('chapter-1.html', function(data) {
  $('#div2').append(data);
  $('#div1').hide();
  $('#div2').show();
});
  }
});
  });
/script
  /body
/html

You should notice that every time you click on the Test links, you
will actually get the html page twice instead of once.


[jQuery] Re: Intercept Back button click on browser

2008-10-06 Thread Bil Corry

Leanan wrote on 10/6/2008 3:52 PM: 
 You should notice that every time you click on the Test links, you
 will actually get the html page twice instead of once.

You test for Chap1 twice in the IF statements and you don't test for Chap3 at 
all.  I suspect that would cause a double-load issue for Chap1.


- Bil



[jQuery] Re[jQuery] size creep in FF 3.0.3 and 2.x

2008-10-06 Thread greenteam003


I've been doing some searching in the mailing list and haven't been able to
find this issue although I'm sure it has come up.  I don't know if its a
$.ui.resizable bug or css issue but I have a simple div on a page with the
following html:
 div id=main_footer
div id=footer_headerHandle/div
   this is my footer
  /div
...and with the following styling:
background:#ff url(../gif/panel_background.png);
background-repeat:repeat-x;
bottom:100px;
width:100%;
border-top:solid 2px #00;
border-bottom:solid 2px #00;
position:absolute;

I then attempt to make it resizable with only a top handle and a
semi-transparent helper class:
$(#main_footer).resizable({handles:'n',helper:'ui-resize-helper'})

If i minimize the footer by sliding the top handle towards the bottom, the
div tends to slide down the page for approx 40px and then stops.  If I use
the minHeight when initializing the resizing, it behaves even stranger. 
With the minHeight option set, if I resize the div smaller than the
minHeight setting, the div positions about 2000px down the page where I have
to scroll to find the damn thing.  
I'm sure this has been addressed in the past, but if anyone has suggestions
on how I can stop this behavior please let me know because this makes using
jQuery for vertical resizing useless.  I'm using jQuery.ui '1.6rc2' and
jQuery '1.2.6'.



-- 
View this message in context: 
http://www.nabble.com/Resize-%22creep%22-in-FF-3.0.3-and-2.x-tp19846495s27240p19846495.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: Can jQuery load from DOM?

2008-10-06 Thread sung

It still has the same problem like loading jQuery from javascript.

On Oct 6, 1:40 pm, ricardobeat [EMAIL PROTECTED] wrote:
 Google has an API that does that, check it out:

 http://code.google.com/apis/ajaxlibs/

 - ricardo

 On Oct 6, 3:29 pm, Michael Geary [EMAIL PROTECTED] wrote:

  Browser caching works with this technique, exactly as it does with a
  script tag.

  A good way to verify this is with the outstanding Fiddler HTTP debugging
  proxy (Windows only, but if you don't use Windows, this is the killer app
  for a Windows VM under VMware):

 http://www.fiddlertool.com/

  -Mike

    _  

  From: Web Specialist

  Using this approach is possible to allow js file cache? Or in every page
  that js file needs to load again?

  Cheers
  Marco Antonio

  On Mon, Oct 6, 2008 at 2:54 PM, Michael Geary [EMAIL PROTECTED] wrote:

  Yes, you can do that. I'll bet the reason you're getting $ undefined is that
  you're trying to reference it immediately after running that code. The
  dynamic script element loads asynchronously, and as with all asynchronous
  JavaScript, you need to either use a completion callback function or a
  setInterval polling loop. The callback is a much better way to go.

  I don't think jQuery provides this out of the box, but it's easy to add to
  your own copy of jQuery. Simply add a line like this at the very end of the
  file:

     window.jQueryLoaded  jQueryLoaded();

  And define a jQueryLoaded function in your code:

     function jQueryLoaded() {
         $(function() {
             // go to town here!
         });
     }

  Here's a working test case:

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

  -Mike

   From: jQuery(new).to(me)

   Hello,

   I am trying to load jQuery from Javascript like the following code.

   == code ==
   if (typeof jQuery == 'undefined' || !jQuery) {
         var s = document.createElement('script');
         s.setAttribute('type','text/javascript');
         s.setAttribute('src','http://localhost/jquery-latest.min.js'

  http://localhost/jquery-latest.min.js%27 );

         document.getElementsByTagName('head')[0].appendChild(s);
   }
   == end of code ==

   However, then this code is included, jquery-latest.min.js
   is included, but the page shows javascript error, $ is not defined.

   Any tips to solve this problem??

   Thanks bunch in advance!


[jQuery] Re: Disable globals for jQuery.get()?

2008-10-06 Thread Micky Hulse

Hi Mike, many many thanks for your quick reply. I really appreciate
you (and all of you) taking the time to help me out. :)

 what you probably want instead is this:
 $.ajaxSettings.url = token;
 $.ajaxSettings.global = false;

Ahhh, thanks! I was did not see ajaxSettings in the docs. :(

I think this page confused me a little:

Global Events
http://docs.jquery.com/Ajax_Events

Now that I have had the help and clarification, I understand what the
docs are telling me. :)

So, just a few more quick questions, if anyone has a minute to reply:

1. If I wanted to specify more than one URL to ignore, would the
syntax be something like this:

$.ajaxSettings.url = token1;
$.ajaxSettings.url = token2;
$.ajaxSettings.global = false;

2. When specifying the url as above, should global=false only apply to
those url's? I am noticing that global=false applies globally... Hehe,
not to just the url's specified?

3. My current solution based on the help from this thread:

// Start closure:
$(function() {
$.ajaxSettings.global = false;
...
...
...
$.get(token, function(txt) {
$emailStory.append('input type=hidden name=ts value=' + 
txt +
'');
$.ajaxSettings.global = true;
});
});
// End closure.

Is the above a viable solution? Maybe I should be using $.ajax()
instead?

Thank you!
Cheers,
M


[jQuery] Re: jQuery Truncating Help

2008-10-06 Thread Zachary

Does no one have any answers to this question...It has been quite a
while and I could really use some suggestions.  Thanks.

On Oct 3, 9:21 am, zacharyd [EMAIL PROTECTED] wrote:
 I have been working with Brian Reindel's Truncate plug-intrying to get ti
 to do what I need.  It seems simple enough, but I continue to struggle.  The
 plug-in is designed to truncate the html content within a tag to a certain
 length...taking into consideration the whole last word.  It works
 great...however I need to truncate a list item that contains both text and a
 link; like so:

 liThis is the text that leads to:  # A link that needs to be truncated
 ./li

 The function currently looks like this:

 $('li a').truncate( {
                   length: 35,
                   minTrail: 10,
                   moreText: '',
                   lessText: '',
                   ellipsisText: ...
          });

 But this obviously only takes care of the link...if the text behind it is
 too long it will still push the truncated link down to the next line...If I
 try to do the li it completely removes the link tag no matter its
 lengthand if I try to change the selector in the plugin from
 $(this).html() to $(this).text() it removes the anchor tag
 completelythough it works just fine.  

 Basically I need some way to keep my anchor tag in operation, yet take the
 whole text contained within the li into consideration when determining where
 to truncate.  Your help is much appreciated...Please let me know if you have
 any questions to further clarify my problem.  Thanks.

 btw...the Plugin is located here in case you'd like to see it or use it
 yourself:http://www.reindel.com/truncate/
 --
 View this message in 
 context:http://www.nabble.com/jQuery-Truncating-Help-tp19791107s27240p1979110...
 Sent from the jQuery General Discussion mailing list archive at Nabble.com.


[jQuery] Re: Can jQuery load from DOM?

2008-10-06 Thread ricardobeat

Follow the instructions on the page, you need to put everything inside
the callback function.

On Oct 6, 6:11 pm, sung [EMAIL PROTECTED] wrote:
 It still has the same problem like loading jQuery from javascript.

 On Oct 6, 1:40 pm, ricardobeat [EMAIL PROTECTED] wrote:

  Google has an API that does that, check it out:

 http://code.google.com/apis/ajaxlibs/

  - ricardo

  On Oct 6, 3:29 pm, Michael Geary [EMAIL PROTECTED] wrote:

   Browser caching works with this technique, exactly as it does with a
   script tag.

   A good way to verify this is with the outstanding Fiddler HTTP debugging
   proxy (Windows only, but if you don't use Windows, this is the killer 
   app
   for a Windows VM under VMware):

  http://www.fiddlertool.com/

   -Mike

     _  

   From: Web Specialist

   Using this approach is possible to allow js file cache? Or in every page
   that js file needs to load again?

   Cheers
   Marco Antonio

   On Mon, Oct 6, 2008 at 2:54 PM, Michael Geary [EMAIL PROTECTED] wrote:

   Yes, you can do that. I'll bet the reason you're getting $ undefined is 
   that
   you're trying to reference it immediately after running that code. The
   dynamic script element loads asynchronously, and as with all asynchronous
   JavaScript, you need to either use a completion callback function or a
   setInterval polling loop. The callback is a much better way to go.

   I don't think jQuery provides this out of the box, but it's easy to add 
   to
   your own copy of jQuery. Simply add a line like this at the very end of 
   the
   file:

      window.jQueryLoaded  jQueryLoaded();

   And define a jQueryLoaded function in your code:

      function jQueryLoaded() {
          $(function() {
              // go to town here!
          });
      }

   Here's a working test case:

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

   -Mike

From: jQuery(new).to(me)

Hello,

I am trying to load jQuery from Javascript like the following code.

== code ==
if (typeof jQuery == 'undefined' || !jQuery) {
      var s = document.createElement('script');
      s.setAttribute('type','text/javascript');
      s.setAttribute('src','http://localhost/jquery-latest.min.js'

   http://localhost/jquery-latest.min.js%27 );

      document.getElementsByTagName('head')[0].appendChild(s);
}
== end of code ==

However, then this code is included, jquery-latest.min.js
is included, but the page shows javascript error, $ is not defined.

Any tips to solve this problem??

Thanks bunch in advance!


[jQuery] Re: Opacity in IE

2008-10-06 Thread ricardobeat

Honestly, you should be using flash for this stuff. You'll only get
headaches trying to do fancy animations like these in Javascript, your
code has way too much calls.

If you really really want to do this in JS you should give
your .blowUp divs a position:relative in CSS and use something like
this, there is no need for all that code:

$('.blowUp').animate({left:'-25%',top:'-50%',padding:'1em',opacity:
0}).css({left:0,top:0,padding:'0.75em 0',opacity:1});


On Oct 6, 3:12 pm, Greg G [EMAIL PROTECTED] wrote:
 I have some animation I'm working on that works fine in Firefox but
 not in IE.  I have two issues:

 Part of the animation is fading out an element.  I want to integrate
 this with the animate function and not use the fade out option.  I've
 tried using filter : alpha(opacity... but that didn't help.

 The callback function, which essentialy resets the animation behind
 the scene, doesn't work.

 I figure a URL would be better than me putting in code.  Plus, I can't
 remember if I need to wrap my code in order to post it.

 http://www.silverchild.com/menuwidget/blowup.html

 Thank you in advance for everyones help.


[jQuery] element content displayed out of place using slideToggle (IE6/IE7)

2008-10-06 Thread Streetdaddy


http://www.screencast-o-matic.com/watch/cj6hrGnes

The fps of the screencast isn't fantastic, but you can see the problem.

On page load the .inner element is hidden with hide()

The animation uses slideToggle(500).

During the animation, the content of the element if briefly shown above.

The problem happens only in IE (6 or 7).
-- 
View this message in context: 
http://www.nabble.com/element-content-displayed-out-of-place-using-slideToggle-%28IE6-IE7%29-tp19831950s27240p19831950.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: Can jQuery load from DOM?

2008-10-06 Thread sung

== code ==
if (typeof google == 'undefined' || !google) {
var s = document.createElement('script');
s.setAttribute('type','text/javascript');
s.setAttribute('src','http://www.google.com/jsapi');
document.getElementsByTagName('head')[0].appendChild(s);
}
google.load(jquery,1.2.6);
google.setOnLoadCallback(function() { })
== end of code ==

On the above code, you cannot use google apis. Exact same problem as
the very first post.

On Oct 6, 2:42 pm, ricardobeat [EMAIL PROTECTED] wrote:
 Follow the instructions on the page, you need to put everything inside
 the callback function.

 On Oct 6, 6:11 pm, sung [EMAIL PROTECTED] wrote:

  It still has the same problem like loading jQuery from javascript.

  On Oct 6, 1:40 pm, ricardobeat [EMAIL PROTECTED] wrote:

   Google has an API that does that, check it out:

  http://code.google.com/apis/ajaxlibs/

   - ricardo

   On Oct 6, 3:29 pm, Michael Geary [EMAIL PROTECTED] wrote:

Browser caching works with this technique, exactly as it does with a
script tag.

A good way to verify this is with the outstanding Fiddler HTTP debugging
proxy (Windows only, but if you don't use Windows, this is the killer 
app
for a Windows VM under VMware):

   http://www.fiddlertool.com/

-Mike

  _  

From: Web Specialist

Using this approach is possible to allow js file cache? Or in every page
that js file needs to load again?

Cheers
Marco Antonio

On Mon, Oct 6, 2008 at 2:54 PM, Michael Geary [EMAIL PROTECTED] wrote:

Yes, you can do that. I'll bet the reason you're getting $ undefined is 
that
you're trying to reference it immediately after running that code. The
dynamic script element loads asynchronously, and as with all 
asynchronous
JavaScript, you need to either use a completion callback function or a
setInterval polling loop. The callback is a much better way to go.

I don't think jQuery provides this out of the box, but it's easy to 
add to
your own copy of jQuery. Simply add a line like this at the very end of 
the
file:

   window.jQueryLoaded  jQueryLoaded();

And define a jQueryLoaded function in your code:

   function jQueryLoaded() {
       $(function() {
           // go to town here!
       });
   }

Here's a working test case:

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

-Mike

 From: jQuery(new).to(me)

 Hello,

 I am trying to load jQuery from Javascript like the following code.

 == code ==
 if (typeof jQuery == 'undefined' || !jQuery) {
       var s = document.createElement('script');
       s.setAttribute('type','text/javascript');
       s.setAttribute('src','http://localhost/jquery-latest.min.js'

http://localhost/jquery-latest.min.js%27 );

       document.getElementsByTagName('head')[0].appendChild(s);
 }
 == end of code ==

 However, then this code is included, jquery-latest.min.js
 is included, but the page shows javascript error, $ is not defined.

 Any tips to solve this problem??

 Thanks bunch in advance!


[jQuery] Re: Re[jQuery] size creep in FF 3.0.3 and 2.x

2008-10-06 Thread greenteam003


Well no responses but I did find a band aid, thought I'd share for anyone
else having a similar problem with resizing acting unexpectedly.  I just
tagged on the following stop function to readjust just in case the resizable
slides down while resizing from the top.  It was only occurring when the
height was less than the minHeight option so this seems to fix the bug for
the time being.  I'll have to look at the actual ui source code and enter a
bug report but there's something definitely wrong with the resize calcs in
FF 3.x and 2.x and minHeight.  

$(#main_footer).resizable({handles:'n',helper:'ui-resize-helper',minHeight:30,stop:function(e,ui){
 if(ui.size.height  ui.options.minHeight){
 ui.element.css({height:ui.options.minHeight,
 top:(ui.originalSize.height -
ui.options.minHeight) + ui.originalPosition.top
});
 }
}})

Cheers,
chris

greenteam003 wrote:
 
 I've been doing some searching in the mailing list and haven't been able
 to find this issue although I'm sure it has come up.  I don't know if its
 a $.ui.resizable bug or css issue but I have a simple div on a page with
 the following html:
  div id=main_footer
 div id=footer_headerHandle/div
this is my footer
   /div
 ...and with the following styling:
 background:#ff url(../gif/panel_background.png);
   background-repeat:repeat-x;
   bottom:100px;
   width:100%;
   border-top:solid 2px #00;
   border-bottom:solid 2px #00;
   position:absolute;
 
 I then attempt to make it resizable with only a top handle and a
 semi-transparent helper class:

 $(#main_footer).resizable({handles:'n',helper:'ui-resize-helper'})
 
 If i minimize the footer by sliding the top handle towards the bottom,
 the div tends to slide down the page for approx 40px and then stops.  If
 I use the minHeight when initializing the resizing, it behaves even
 stranger.  With the minHeight option set, if I resize the div smaller than
 the minHeight setting, the div positions about 2000px down the page where
 I have to scroll to find the damn thing.  
 I'm sure this has been addressed in the past, but if anyone has
 suggestions on how I can stop this behavior please let me know because
 this makes using jQuery for vertical resizing useless.  I'm using
 jQuery.ui '1.6rc2' and jQuery '1.2.6'.
 
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Resize-%22creep%22-in-FF-3.0.3-and-2.x-tp19846495s27240p19848065.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Poor Performing jQuery .each()

2008-10-06 Thread Coryt

I am having some trouble tracking down why this relativily simple
client-side template is performing so poorly.

Using js to make an ajax call and retrieve a small amount of data,
limited to 100 rows being returned.
I've tracked the problem down to the actual jQuery iteration, here is
my code:


function OnSucceeded(results, GPRowID)
{
// *** Display all the results.
$.each(results, function(i){
if(i=99){
// *** Clone node assign ID attribute
var template = $
(#TemplateRowLineItem).clone(true).attr(id, GPLi_ + GPRowID +
_ + i);

// *** Now fill in the data
 
template.find(#DocumentNumber).text(this.DocumentNumber);
 
template.find(#Description).text(this.Description);
template.find(#SubTotal).text(this.SubTotal);
template.find(#TaxTotal).text(this.TaxTotal);
template.find(#Total).text(this.Total);

// Add the template to the bottom of the row that
was clicked
template.appendTo($([EMAIL PROTECTED] + GPRowID +
], [EMAIL PROTECTED]));
}
else {
$
(#TemplateRowMore).clone(true).attr(NextResultPage,+
+currResultPage).appendTo($([EMAIL PROTECTED] + GPRowID + ], [EMAIL 
PROTECTED]
$=gvBillingHistory]));
}
});
$(#TemplateRowLoading).remove();
}

Any help would be greatly appreciated!

Thanks,
Cory


[jQuery] Valid jQuery on Development fails on Production

2008-10-06 Thread rich

I am writing a fairly basic script using jQuery. However, the script
behaves differently depending on whether I am running it on my local
Web server (localhost) or on a production server.

On development, the following code returns the HTML I'm expecting:

$('#objID').siblings('.mAddress').html();

On production, the same statement returns undefined.

The document structures are the same on both machines. The only
difference I can find is when I use Firebug to step through the
script. On the development machine, putting a watch on $
('#objID').siblings('.mAddress') results in [ span#object ] while on
production the same watch results in [ [ span#object ] ]
(Notice the double sets of square brackets).

I've verified that the two libraries are identical.

I've done some more experimenting using Firebug. Another part of the
script grabs a set of elements using the statement:
$('.ParentColumn2').each(function(i) { ... })

Within the body of that function, if I set a watch on this, on
development the value of this is what I expect: div.ParentColumn2 ,
but on production the value of this returns what looks like an array:
[ div.ParentColumn2, div.ParentColumn2, div.ParentColumn2, .]

The HTML involved looks like (I've stripped out all but the most
important parts.. and the rows repeat):

table
 tr
  td
div class=ItemTemplate
  div class=ParentColumn2
divspan
id=dnn_ctr45874_ViewProjectGrid_GridView1_ctl02_lbl_Address
class=lbl_Address mAddress111 W Wacker Dr, /spanspan
id=dnn_ctr45874_ViewProjectGrid_GridView1_ctl02_lbl_City
class=lbl_Address mCityChicago/spannbsp;span
id=dnn_ctr45874_ViewProjectGrid_GridView1_ctl02_lbl_PostalCode
class=lbl_Address mPostalCode60601/spannbsp;a
href=javascript:MapMe(this);
id=dnn_ctr45874_ViewProjectGrid_GridView1_ctl02_hypMap
class=hypMapMap/anbsp;nbsp;span
id=dnn_ctr45874_ViewProjectGrid_GridView1_ctl02_lbl_Area
class=mAreaLoop/spanspan
id=dnn_ctr45874_ViewProjectGrid_GridView1_ctl02_lt
class=mLt41.8868010285473/spanspan
id=dnn_ctr45874_ViewProjectGrid_GridView1_ctl02_lg
class=mLg-87.6312860701286/span
/div
  /div
/div
  /td
 /tr
 tr
  td
div class=ItemTemplate
  div class=ParentColumn2
divspan
id=dnn_ctr45874_ViewProjectGrid_GridView1_ctl02_lbl_Address
class=lbl_Address mAddress
/div
  /div
/div
/table


Any ideas?




[jQuery] Is it possible to avoid jumpy / disappearing content

2008-10-06 Thread Nabha

Hi there,

I love jQuery, but I have a question about something I see it doing:

Content that it is hiding or moving often appears in its original
position *before* it is hidden by jQuery. Is there any good,
accessible way around this?

You can see the effect in action on a page like this:
http://docs.jquery.com/Core/jQuery#html

Extra content shows up, and is hidden. Sometimes I imagine this kind
of thing would be a little jarring for the average user.

Thanks!


[jQuery] jQuery plus existing Web Services

2008-10-06 Thread Risingfish

Hello,

I'm starting to play around with jQuery and decided to jump in head
first. We have a number of existing web services, built on ASP.NET,
that we using for our client/server application. Unfortunately, they
cannot handle POSTs or GETS due to the type of data returned. The SOAP
call looks like this:

POST /services/Core/CoreServices.asmx HTTP/1.1
Host: dev.etriptrader.com
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length

?xml version=1.0 encoding=utf-8?
soap12:Envelope xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
xmlns:xsd=http://www.w3.org/2001/XMLSchema; xmlns:soap12=http://
www.w3.org/2003/05/soap-envelope
  soap12:Body
GetTripDetails xmlns=URL
  request
UALMonthint/UALMonth
UALTripIDint/UALTripID
DomicileIDint/DomicileID
FleetIDint/FleetID
SeatIDint/SeatID
DatedateTime/Date
TimestampunsignedLong/Timestamp
  /request
/GetTripDetails
  /soap12:Body
/soap12:Envelope

Is it possible to hit these services using jQuery?


[jQuery] jQuery Turk

2008-10-06 Thread Onur ACUN
hi everbody,

we would like to support jQuery with http://jqueryturk.com web site
which use turkish language. We will be sharing
our experiments, articles about jQuery vs. on jQueryTurk.

we will add a forum soon. http://forum.jqueryturk.com

Onur ACUN


[jQuery] Re: Valid jQuery on Development fails on Production

2008-10-06 Thread Ryura

You have some unclosed tags (the last tr and td). Try closing those.

On Oct 6, 6:06 pm, rich [EMAIL PROTECTED] wrote:
 I am writing a fairly basic script using jQuery. However, the script
 behaves differently depending on whether I am running it on my local
 Web server (localhost) or on a production server.

 On development, the following code returns the HTML I'm expecting:

 $('#objID').siblings('.mAddress').html();

 On production, the same statement returns undefined.

 The document structures are the same on both machines. The only
 difference I can find is when I use Firebug to step through the
 script. On the development machine, putting a watch on $
 ('#objID').siblings('.mAddress') results in [ span#object ] while on
 production the same watch results in [ [ span#object ] ]
 (Notice the double sets of square brackets).

 I've verified that the two libraries are identical.

 I've done some more experimenting using Firebug. Another part of the
 script grabs a set of elements using the statement:
 $('.ParentColumn2').each(function(i) { ... })

 Within the body of that function, if I set a watch on this, on
 development the value of this is what I expect: div.ParentColumn2 ,
 but on production the value of this returns what looks like an array:
 [ div.ParentColumn2, div.ParentColumn2, div.ParentColumn2, .]

 The HTML involved looks like (I've stripped out all but the most
 important parts.. and the rows repeat):

 table
  tr
   td
     div class=ItemTemplate
       div class=ParentColumn2
         divspan
 id=dnn_ctr45874_ViewProjectGrid_GridView1_ctl02_lbl_Address
 class=lbl_Address mAddress111 W Wacker Dr, /spanspan
 id=dnn_ctr45874_ViewProjectGrid_GridView1_ctl02_lbl_City
 class=lbl_Address mCityChicago/spannbsp;span
 id=dnn_ctr45874_ViewProjectGrid_GridView1_ctl02_lbl_PostalCode
 class=lbl_Address mPostalCode60601/spannbsp;a
 href=javascript:MapMe(this);
 id=dnn_ctr45874_ViewProjectGrid_GridView1_ctl02_hypMap
 class=hypMapMap/anbsp;nbsp;span
 id=dnn_ctr45874_ViewProjectGrid_GridView1_ctl02_lbl_Area
 class=mAreaLoop/spanspan
 id=dnn_ctr45874_ViewProjectGrid_GridView1_ctl02_lt
 class=mLt41.8868010285473/spanspan
 id=dnn_ctr45874_ViewProjectGrid_GridView1_ctl02_lg
 class=mLg-87.6312860701286/span
         /div
       /div
     /div
   /td
  /tr
  tr
   td
     div class=ItemTemplate
       div class=ParentColumn2
         divspan
 id=dnn_ctr45874_ViewProjectGrid_GridView1_ctl02_lbl_Address
 class=lbl_Address mAddress
         /div
       /div
     /div
 /table

 Any ideas?


[jQuery] Re: Can jQuery load from DOM?

2008-10-06 Thread Michael Geary

The Google Ajax loader is nice, but it doesn't do what sung is looking for.

google.load() uses document.write() to write a script tag into the
document. It does not use a dynamic script element, so you can't use it to
load jQuery (or anything else) after the document has loaded. You can only
call google.load() from code that runs during the page load.

I realized after posting my sample code that it wasn't quite right either.
It happened to insert the dynamic script tag during the page load, which
isn't quite the same as loading jQuery dynamically *after* the page is
loaded.

In particular, the $(document).ready() call doesn't work if you load jQuery
after the page loads - but you don't need it, because the page is already
loaded!

I updated the sample to load jQuery only in response to a button click. Now
it is truly dynamic:

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

-Mike

 From: ricardobeat
 
 Follow the instructions on the page, you need to put 
 everything inside the callback function.
 
 On Oct 6, 6:11 pm, sung [EMAIL PROTECTED] wrote:
  It still has the same problem like loading jQuery from javascript.
 
  On Oct 6, 1:40 pm, ricardobeat [EMAIL PROTECTED] wrote:
 
   Google has an API that does that, check it out:
 
  http://code.google.com/apis/ajaxlibs/
 
   - ricardo
 
   On Oct 6, 3:29 pm, Michael Geary [EMAIL PROTECTED] wrote:
 
Browser caching works with this technique, exactly as 
 it does with 
a script tag.
 
A good way to verify this is with the outstanding Fiddler HTTP 
debugging proxy (Windows only, but if you don't use 
 Windows, this is the killer app
for a Windows VM under VMware):
 
   http://www.fiddlertool.com/
 
-Mike
 
  _
 
From: Web Specialist
 
Using this approach is possible to allow js file cache? Or in 
every page that js file needs to load again?
 
Cheers
Marco Antonio
 
On Mon, Oct 6, 2008 at 2:54 PM, Michael Geary 
 [EMAIL PROTECTED] wrote:
 
Yes, you can do that. I'll bet the reason you're getting $ 
undefined is that you're trying to reference it 
 immediately after 
running that code. The dynamic script element loads 
asynchronously, and as with all asynchronous 
 JavaScript, you need 
to either use a completion callback function or a 
 setInterval polling loop. The callback is a much better way to go.
 
I don't think jQuery provides this out of the box, 
 but it's easy 
to add to your own copy of jQuery. Simply add a line 
 like this at 
the very end of the
file:
 
   window.jQueryLoaded  jQueryLoaded();
 
And define a jQueryLoaded function in your code:
 
   function jQueryLoaded() {
       $(function() {
           // go to town here!
       });
   }
 
Here's a working test case:
 
   http://mg.to/test/jquery/dynamic/jquery-dynamic.html
 
-Mike
 
 From: jQuery(new).to(me)
 
 Hello,
 
 I am trying to load jQuery from Javascript like the 
 following code.
 
 == code ==
 if (typeof jQuery == 'undefined' || !jQuery) {
       var s = document.createElement('script');
       s.setAttribute('type','text/javascript');
       
 s.setAttribute('src','http://localhost/jquery-latest.min.js'
 
http://localhost/jquery-latest.min.js%27 );
 
       document.getElementsByTagName('head')[0].appendChild(s);
 }
 == end of code ==
 
 However, then this code is included, jquery-latest.min.js
 is included, but the page shows javascript error, $ 
 is not defined.
 
 Any tips to solve this problem??
 
 Thanks bunch in advance!
 



[jQuery] Re: Poor Performing jQuery .each()

2008-10-06 Thread Michael Geary

Is there any possibility that you can get JSON data instead of XML? It will
be *much* faster.

If not, then we can talk about how to optimize the XML parsing and jQuery
operations - although that is a much tougher question.

-Mike

 I am having some trouble tracking down why this relativily 
 simple client-side template is performing so poorly.
 
 Using js to make an ajax call and retrieve a small amount of 
 data, limited to 100 rows being returned.
 I've tracked the problem down to the actual jQuery iteration, 
 here is my code...



[jQuery] Re: $().each() only iterates through first item

2008-10-06 Thread Dave Methvin

 Actually, I tried both of those things first - should have mentioned
 that.  It was only after I got three elements doing
 alert($j(.is_preferred_email)) that I switched to using the index.

Looking at your markup, it seems like it should return three elements.
I don't see a problem there.

I *do* see a problem with, or at least I'm confused by, the markup.
There is a check box and a hidden element with the same name. Why do
you need the hidden element?


[jQuery] Re: not defined error using instance variable in each callback

2008-10-06 Thread Michael Geary

That's right, the mistaken use of this is the problem - one of them anyway
- but that solution won't work (what is the parent property of a DOM
element?).

Another problem is the misuse of push - it's a method, not a property you
can store into. (You *can* store into the push property - as the code does
successfully, but what that does is replace the normal push method with
your data!)

Marty, I assume that the purpose of the second example is so you'll have
this.rowTextArray available for use elsewhere in your code, is that right?

Then try this (pun intended):

// build an array of text on the line
var rowTextArray = this.rowTextArray = [];

// add text into array
this.$children.each( function() {
rowTextArray.push( encodeURIComponent( $(this).text() ) );
});

Note the correct use of .push, and also the optional (but nicer) use of []
instead of new Array().

I also took the liberty of renaming the children property $children, a
naming convention I highly recommend (and you'll see in much jQuery code)
when you have a variable or property containing a jQuery object as I assume
this.children does.

-Mike

 From: MorningZ
 
 i would take a guess that you are missing that this points 
 to two different things inside and outside the .each loop
 
 which makes sense because you have this on the outside, and 
 then loop against this.children,  so inside the loop this 
 actually is the nth child of this
 
 see if
 
 this.children.each( function() {
this.parent.rowTextArray.push = encodeURIComponent( $
 (this).text() );
 } );
 
 works... although i will note that is just a shot in the dark 
 without seeing more of your script
 
 
 
 
 
 On Oct 6, 1:22 pm, marty [EMAIL PROTECTED] wrote:
  This is driving me crazy
 
  I'm trying to copy elements from a wrapped set into an array.
 
  This works:
 
                  // build an array of text on the line
                  var rowTextArray = new Array();
 
                  // add text into array
                  this.children.each( function() {
                          rowTextArray.push = encodeURIComponent( 
  $(this).text() );
                  } );
 
  This does not:
 
                  // build an array of text on the line
                  this.rowTextArray = new Array();
 
                  // add text into array
                  this.children.each( function() {
                          this.rowTextArray.push = 
 encodeURIComponent( 
  $(this).text() );
                  } );
 
  Here's the error I get:
      Error: this.rowTextArray is undefined
 
  Any help would be greatly appreciated!!
 
  Regards,
  Marty
 



[jQuery] Re: $().each() only iterates through first item

2008-10-06 Thread ajpiano

$(.is_preferred_email).each(function() {
$(this).attr(checked,checked);
});

On Oct 6, 8:14 pm, Dave Methvin [EMAIL PROTECTED] wrote:
  Actually, I tried both of those things first - should have mentioned
  that.  It was only after I got three elements doing
  alert($j(.is_preferred_email)) that I switched to using the index.

 Looking at your markup, it seems like it should return three elements.
 I don't see a problem there.

 I *do* see a problem with, or at least I'm confused by, the markup.
 There is a check box and a hidden element with the same name. Why do
 you need the hidden element?


[jQuery] Re: Is it possible to avoid jumpy / disappearing content

2008-10-06 Thread John D.

I too am looking for an accessible solution as I've run into this same
problem using the following:

$(document).ready(function() {
   $('p.firstparagraph').hide()
   $('#hideh1').click(function(){
 $('p.firstparagraph').hide(200);
   });
   $('#showh1').click(function(){
 $('p.firstparagraph').show(200);
   });

 });

p.firstparagraph is showing briefly before the page has completely
loaded then hiding. Using style=display:none isn't an accessible
solution.

I get this behavior with both IE7 and FF3, haven't tried other
browsers yet.

I've been messing with this for 2 days with no luck. I was under the
impression that $(document).ready(function() is executed before the
page is output, but it isn't working that way.

Any help understanding this is appreciated.

Thanks!

John




On Oct 6, 3:08 pm, Nabha [EMAIL PROTECTED] wrote:
 Hi there,

 I love jQuery, but I have a question about something I see it doing:

 Content that it is hiding or moving often appears in its original
 position *before* it is hidden by jQuery. Is there any good,
 accessible way around this?

 You can see the effect in action on a page like 
 this:http://docs.jquery.com/Core/jQuery#html

 Extra content shows up, and is hidden. Sometimes I imagine this kind
 of thing would be a little jarring for the average user.

 Thanks!


  1   2   >