[jQuery] Re: class={title:'test'}

2010-01-21 Thread MorningZ
No, you don't have it right, it's the MetaData plugin in use   :-)

http://pupunzi.open-lab.com/mb-jquery-components/jquery-mb-extruder/

one of the dependencies listed is jquery.metaData.js

On Jan 21, 3:46 pm, Bruno Santos bit...@gmail.com wrote:
 Hiho!

 I believe that you are trying to add some CSS settings directly on the tag
 definition, instead of assigning a class to it.
 If I got it right, you should use the tag parameter *style*, instead of
 class.

 div id=extruderLeft style={title:'test'}
   div class=content
     div class=voice {} logo /div
     div class=voice {panel:'... .php',data:''}
     ...
     /div
   /div
 /div

 2010/1/20 fran23 f...@lavabit.com



  I don't know how to handle

         class={title:'test'}

  it's out of the mb.extruder plugin

   div id=extruderLeft class={title:'test'}
     div class=content
                         div class=voice {} logo /div
                         div class=voice {panel:'... .php',data:''}
                                  ...
                         /div
                 /div
   /div

  normally I assign a class (i.e. class=abc) and set abc via CSS

  .abc { ... }

  but I don't know what to do with class={title:'test'}

  May anybody give an explanation or link where I can learn about it?

  thx
  fran

  --
  View this message in context:
 http://old.nabble.com/class%3D%22%7Btitle%3A%27test%27%7D-tp27238929s...
  Sent from the jQuery General Discussion mailing list archive at Nabble.com.


[jQuery] Re: class={title:'test'}

2010-01-20 Thread MorningZ
Here is the plugin

http://plugins.jquery.com/project/metadata

in your example of

div id=extruderLeft class={title:'test'}

var x = $(#extruderLeft).metadata().title;
console.log(x);

would show test in the Firebug console

On Jan 20, 4:34 am, fran23 f...@lavabit.com wrote:
 I don't know how to handle

         class={title:'test'}

 it's out of the mb.extruder plugin      

   div id=extruderLeft class={title:'test'}
     div class=content              
                         div class=voice {} logo /div
                         div class=voice {panel:'... .php',data:''}        
           
                                  ...
                         /div
                 /div
   /div

 normally I assign a class (i.e. class=abc) and set abc via CSS

 .abc { ... }

 but I don't know what to do with class={title:'test'}

 May anybody give an explanation or link where I can learn about it?

 thx
 fran

 --
 View this message in 
 context:http://old.nabble.com/class%3D%22%7Btitle%3A%27test%27%7D-tp27238929s...
 Sent from the jQuery General Discussion mailing list archive at Nabble.com.


[jQuery] As assistance to test v1.4, I made a cord comparison table between the jQuery versions.

2009-11-17 Thread tato
As assistance to test jQuery v1.4, I made a cord comparison table
between the jQuery versions.
http://jsgt.org/lib/jquery/1.4/comparLegacy2.htm

v14 changes a lot than I thought.


[jQuery] Safest way to test is a variable is a jQuery object?

2009-08-23 Thread Eridius

I am wondering what is the safest way to test if a variable is a
jQuery object.  I am building a function where I want to be able to
pass in either the id of the form or the form object itself.  The
current way I am doing this is

var $form = (form instanceof jQuery ? form : $('#' + form));

Is this the safest way that is not likely to change?  Would I be
better offer wrapping this functionality into a function all by itself
so incase this does change, I only need it to change in one spot (plan
on building a complete UI type framework)?


[jQuery] Re: Help with Test Case for jQuery XSLT Plugin

2009-08-19 Thread LindsayT

I also ran it in Firefox 3.5 on Fedora 10 and it worked properly.  So
what's up with Firefox 3.0.1 for Mac?

On Aug 19, 11:38 am, LindsayT lindsayta...@gmail.com wrote:
 I'm using a jQuery XSLT plugin to load static content from an XML file
 for my portfolio (http://www.oogeeyot.com)  It seems for some people,
 the content loads correctly, but for others, the user has to select
 the links more than once to get the content to load.

 I ran this test case:  http://www.oogeeyot.com/sandbox/jquery_xslt_test_case/

 by Johann who wrote the plugin.  He said it was working for him for
 Mozilla 3.0.13, but I don't know OS.

 I'm running Mozilla Firefox 3.0.1 on Mac OSX and I'm having to select
 the links more than once to get the content to load.  This isn't the
 case for Safari.

 Does anyone have any insight into why it might now work on Firefox in
 OSX?  Is there a caching issue?  If yes, is there something I can
 write in my code to get around it?

 Lindsay


[jQuery] jquery menu plugin browser test

2009-07-01 Thread Dave

http://labs.makotokw.com/s/jquery/menu

Are planning to use the above menu plugin but need to know how it
works in different browsers, most important IE6/7.

The plugin author says it works in:
Google Chrome 3 (Windows)
Firefox 3 (Windows/Mac)
Safari 4 (Mac)

I have tested it in these, where it works fine:
IE8(Windows)
Opera9.6(Windows)
Opera9.64(Windows)
Netscape9.0b3(Windows)

It doesn't work as it should in:
IE7(Windows) - in example 2 the submenus aren't show properly.


So if anyone have the possibility to test the plugin out in other
browsers please do and tell.

Also if it doesn't work in a certain browser, and you are a jquery
pro, maybe you could come up with a solution to make it work.

Thanks / Dave

http://labs.makotokw.com/s/jquery/menu


[jQuery] Re: How to test/filter for all divs being hidden ?

2009-06-17 Thread Charlie





One filter would be to check the length of div:visible, if zero no
div's visible

I think there is a lot easier way to accomplish your task without
having to splice for ID's, writing filter tests and without any if
statements at all by using classes for everything you are doing

By adding/removing classes you can create the filters and by using the
index of button clicked , find corresponding info div to display . This
makes jquery so much easier to write , read , and troubleshoot IMO

Take a look at this version of your script. The only markup difference
is to add class =" info" to all your #content div's. Looking at html in
Firebug is helpful for seeing the new classes for better visual
understanding

  $(function(){
 $("#content div").addClass("info");// add this class so
don't have to splice to find ID, use index to locate instead
 $(".button").css({
 opacity: 0.3
 });
 
 $("#page-wrap div.button").click(function(){

 // add/remove info_active class to use as filter for
visible content. Only the visible content will have this class
 $(".info_active").fadeOut().removeClass("info_active");
// info_active class added below when this div is made visible

 // much easier to index than splice to find ID's since
relationship is one to one
var index= $(".button").index(this); 
 $(".info").eq(index).fadeIn().addClass("info_active"); 

 use the active class to dim the previous button.
Remove class on previous button has to happen before add to new or will
remove from button clicked
 $(".button_active").animate({
 opacity: 0.5,
 borderWidth: 1
 }, 600 ).removeClass("button_active");

highlight css for newly clicked button
 $(this).animate({opacity: 1,borderWidth: 5 }, 600
).addClass("active"); div
 
 });  


  });



Suz T. wrote:

  
Thankyou for your response, I'll try to clarify what I am trying to
doI am trying to have the content of a div on a page appear or
disappear based on a click of a link. However I want to start the page
with none of the content in divs being shown, thus I hid the #content
div's in the css.
  
  
What is happening now is first time I click on "xx-button" it then
fades in the corresponding "#content div.xx" Then the next click of
say "x1-button" fades in #content div.x1" BUT it does not fade out the
previous "#content div.xx". Same thing happens for the third
"x2-button", the "#content div.x2" is faded in but "#content div.x1"
and "#content div.xx" are still visible which is not what I want.
  
  
What I tried to do in the script is test if ALL the divs in "#content
div" are hidden. if true then fade in the corresponding "#content
div.xx" to the clicked "xx-button". This is good and works for the
first condition of the page only. At the next click to "x1-button"
the if statement " appears to return true again. As it appears that
"#content  div" is for any div in #content being hidden versus ALL.
So I am looking to understand how to write the filter/test to check if
ALL the divs in #content being hidden
  
  
  
  
There may be simpler way to do this... this was the closest I came to
getting it almost where I wanted.
  
  
  
Thanks hope this clears it a bit  thanks in advance for the help.
  
  
  
Suz
  
  
  
  
  
Charlie wrote:
  
  this is
confusing, all the #content div's are already hidden by css (
display:none) and you say it's already working . Not very clear what
you are trying to accomplish


$("#content div").hide(); // this will hide every div within #content


using part of your click function below a "filter" like you are asking
about could be


$("#content div:visible").hide();


is that all you are trying to do is hide them?


Suz T. wrote:


Hello I am posting for the first time.. and am resending my message
because it didn't appear to post to the group.
  
As mentioned below, just starting out with jquery/_javascript_ and need
some help with the script below to have it start with none of the
#content div showing.
  
  
I expect this is pretty basic, so thanks in advance for any quick help
you can provide.
  
  
Thanks
  
Suz
  
  
SuzT wrote:
  
  Hello I am
a beginner to jquery/_javascript_ and I am trying to use a

script I saw online to replace the content of a div. However I would

like to have the script start with none of the target content showing.

So far it starts correctly however I am not sure how to test/filter

for ALL the divs in #content being hidden which would be the begging

state of the page.


Here is a link to what it is doing now.

http://noworriestech.com/jquery/indext2.html


Here is the code

script type="text/_javascript_"


 $(function(){


 $("#home-button").css({

 opacity: 0.3

 });


 $("#about-button").css({

 opacity: 0.3

 });

 

[jQuery] Re: How to test/filter for all divs being hidden ?

2009-06-11 Thread Charlie





this is confusing, all the #content div's are already hidden by css (
display:none) and you say it's already working . Not very clear what
you are trying to accomplish

$("#content div").hide(); // this will hide every div within #content

using part of your click function below a "filter" like you are asking
about could be 

$("#content div:visible").hide();

is that all you are trying to do is hide them?

Suz T. wrote:

Hello I am posting for the first time.. and am resending my message
because it didn't appear to post to the group.
  
As mentioned below, just starting out with jquery/_javascript_ and need
some help with the script below to have it start with none of the
#content div showing.
  
  
I expect this is pretty basic, so thanks in advance for any quick help
you can provide.
  
  
Thanks
  
Suz
  
  
SuzT wrote:
  
  Hello I am a
beginner to jquery/_javascript_ and I am trying to use a

script I saw online to replace the content of a div. However I would

like to have the script start with none of the target content showing.

So far it starts correctly however I am not sure how to test/filter

for ALL the divs in #content being hidden which would be the begging

state of the page.


Here is a link to what it is doing now.

http://noworriestech.com/jquery/indext2.html


Here is the code

script type="text/_javascript_"


 $(function(){


 $("#home-button").css({

 opacity: 0.3

 });


 $("#about-button").css({

 opacity: 0.3

 });

 $("#contact-button").css({

 opacity: 0.3

 });


 $("#page-wrap div.button").click(function(){


 $clicked = $(this);


 // if the button is not already "transformed" AND is
not animated

 if ($clicked.css("opacity") != "1" 
$clicked.is(":not

(animated)")) {


 $clicked.animate({

 opacity: 1,

 borderWidth: 5

 }, 600 );


 // each button div MUST have a "xx-button" and the
target div

must have an id "xx"

 var idToLoad = $clicked.attr("id").split('-');


 if ($("#content  div").is(":hidden")) {


 $("#content").find("#"+idToLoad[0]).fadeIn();

 }

 else {

 //we search trough the content for the visible div
and we fade it

out

 $("#content").find("div:visible").fadeOut("fast",
function(){

 //once the fade out is completed, we start to
fade in the right

div


$(this).parent().find("#"+idToLoad[0]).fadeIn();

 })}



 }


 //we reset the other buttons to default style

 $clicked.siblings(".button").animate({

 opacity: 0.5,

 borderWidth: 1

 }, 600 );


 });

 });


/script


Thank you for you assitance in advance.


 
  
  






[jQuery] Re: How to test/filter for all divs being hidden ?

2009-06-11 Thread Suz T.



Thankyou for your response,  I'll try to clarify what I am trying to 
doI am trying to have the content of a div on a page appear or 
disappear based on a click of a link. However I want to start the page 
with none of the content in divs being shown, thus I hid the #content 
div's in the css.


What is happening now is first time I click on xx-button it then fades 
in the corresponding #content div.xx  Then the next click of say 
x1-button fades in #content div.x1 BUT it does not fade out the 
previous #content div.xx.  Same thing happens for the third 
x2-button, the #content div.x2 is faded in but #content div.x1 and 
#content div.xx are still visible which is not what I want.


What I tried to do in the script is test if ALL the divs in #content 
div are hidden.  if true then fade in the corresponding #content 
div.xx to the clicked xx-button. This is good and works for the first 
condition of the page only.  At the next click to  x1-button the if 
statementappears to return true again.  As it appears that 
#content  div is for any div in #content being hidden versus ALL. So 
I am looking to understand how to write the filter/test to check if  ALL 
the divs in #content being hidden




There may be simpler way to do this... this was the closest I came to 
getting it almost where I wanted.



Thanks hope this clears it a bit  thanks in advance for the help.


Suz




Charlie wrote:
this is  confusing,  all the #content div's are already hidden by css 
( display:none) and you say it's already working . Not very clear what 
you are trying to accomplish


$(#content div).hide();  // this will hide every div within #content

using part of your click function below a filter like you are asking 
about could be


$(#content div:visible).hide();

is that all you are trying to do is hide them?

Suz T. wrote:


Hello I am posting for the first time.. and am resending my message 
because it didn't appear to post to the group.
As mentioned below, just starting out with jquery/javascript and need 
some help with the script below to have it start with none of the 
#content div showing.


I expect this is pretty basic, so thanks in advance for any quick 
help you can provide.


Thanks
Suz

SuzT wrote:

Hello I am a beginner to jquery/javascript and I am trying to use a
script I saw online to replace the content of a div. However I would
like to have the script start with none of the target content showing.
So far it starts correctly however I am not sure how to test/filter
for ALL the divs in #content being hidden which would be the begging
state of the page.

Here is a link to what it is doing now.
http://noworriestech.com/jquery/indext2.html

Here is the code
script type=text/javascript

$(function(){

$(#home-button).css({
opacity: 0.3
});

$(#about-button).css({
opacity: 0.3
});
$(#contact-button).css({
opacity: 0.3
});

$(#page-wrap div.button).click(function(){

$clicked = $(this);

// if the button is not already transformed AND is 
not animated

if ($clicked.css(opacity) != 1  $clicked.is(:not
(animated))) {

$clicked.animate({
opacity: 1,
borderWidth: 5
}, 600 );

// each button div MUST have a xx-button and 
the target div

must have an id xx
var idToLoad = $clicked.attr(id).split('-');

if ($(#content  div).is(:hidden)) {

$(#content).find(#+idToLoad[0]).fadeIn();
}
else {
//we search trough the content for the visible 
div and we fade it

out

$(#content).find(div:visible).fadeOut(fast, function(){
//once the fade out is completed, we start 
to fade in the right

div

$(this).parent().find(#+idToLoad[0]).fadeIn();

})}


}

//we reset the other buttons to default style
$clicked.siblings(.button).animate({
opacity: 0.5,
borderWidth: 1
}, 600 );

});
});

/script

Thank you for you assitance in advance.

  









[jQuery] jCarousel as Marqee Test

2009-04-05 Thread spiceflo

Hello together,

I wanna use jCarousel as you can see it here http://www.dslproviderwechsel.de
in the header (the scrolling company logos).

Do you know the parameters for jCarousel to display the plugin as in
the example. Currently I have the following problems:

- the autoscroll function does not scroll smooth, it stops after every
list item
- can I scroll the list elements without end?

Here are my current parameters:

scroll: 1,
auto: 1,
animation: 9000,
buttonNextHTML: 0,
buttonPrevHTML: 0

Thanks for your support

Florian


[jQuery] Re: Should I test if an element exists?

2009-03-13 Thread Scott Sauyet


Nic Hubbard wrote:

I am thinking I could use:

if ( $('#myDiv').length ) {
  // Run my scrip there
}


One of the strengths of jQuery is that this is probably not necessary. 
Almost everything you care to do on the jQuery object returned by your 
selector call will run through a forEach() call.  So if there are no 
matching elements, then the call will return quite quickly.


  -- Scott


[jQuery] Re: How to test Javascript code

2009-01-18 Thread Karl Swedberg



On Jan 18, 2009, at 8:14 AM, Yuvraj Mathur wrote:



Hi,
Is there any web site where we can test our javscript code... that  
uses

libraries like Jquery, Mootools, Dojo, etc...
There use be a site... but I don't remember its address...



Try http://jsbin.com/



--Karl

Karl Swedberg
www.englishrules.com
www.learningjquery.com



[jQuery] jquery-based typing test?

2008-12-09 Thread Jack Killpatrick


Hi All,

I'm about to put together a js-based typing test and am wondering if 
anyone might know of a plugin or code drop that might give me a head 
start? Basic process:


1. user sees an image of a block of text
2. clicks a button to start a timer
3. types into a textarea
4. textarea becomes disabled when timer runs out
5. some calcs are performed (words per minute, accuracy) and available 
via js (for setting into hidden form fields)


Thanks,
Jack



[jQuery] [QUnit] how to test fadeOut is applied

2008-11-20 Thread todd

I have this super simple method that I'm trying to test.

$.fn.updateWaitState = function(message, callback) {
return this.css('color', 
'red').html(message).show().fadeOut(1000,
callback);
}

I want to make sure that the fadeOut is called. Here's what I've
tried:

with(jqUnit) {
test(updateWaitState shows and fades element, function() {
var wasCalled = false;

$(div.mydiv).updateWaitState(This is a message, function
(wasCalled) {
wasCalled = true;
alert(Called  + wasCalled);
start();
});

equals($(div.mydiv).css('visibility'), 'visible', Sets 
element to
visible);

//Wait for callback function
stop();

ok(wasCalled, fadeOut was called);
alert(Done  + wasCalled);

});
});

I'm sure the problem is not understanding the stop and start
methods. The order of popups confirms that Done is encountered
before the Called alert is triggered in the callback function.
Obviously, this causes the ok test to fail.

How do I get the script to stop until the callback function is fired?
Or is there a better way to test that fadeOut is applied?

Thanks in advance,

Todd


[jQuery] Re: how to test fadeOut is applied

2008-11-20 Thread todd

Here's proof that I'm new to QUnit! I was trying to put the test
thread to sleep - obviously that's the wrong paradigm.

I broke the test into 2 tests, and this seems to satisfy what I'm
trying to do:


test(updateWaitState shows element, function() {
$(div.mydiv).hide();

$(div.mydiv).updateWaitState(This is a message);
equals($(div.mydiv).css('visibility'), 'visible', Sets element to
visible);
});

test(updateWaitState fades element, function() {
expect(1);

stop();
$(div.mydiv).updateWaitState(This is a message, function() {
ok(true, callback function was called);
start();
});
});



On Nov 20, 9:08 am, todd [EMAIL PROTECTED] wrote:
 I have this super simple method that I'm trying to test.

 $.fn.updateWaitState = function(message, callback) {
 return this.css('color', 
 'red').html(message).show().fadeOut(1000,
 callback);

 }

 I want to make sure that the fadeOut is called. Here's what I've
 tried:

 with(jqUnit) {
 test(updateWaitState shows and fades element, function() {
 var wasCalled = false;

 $(div.mydiv).updateWaitState(This is a message, function
 (wasCalled) {
 wasCalled = true;
 alert(Called  + wasCalled);
 start();
 });

 equals($(div.mydiv).css('visibility'), 'visible', Sets 
 element to
 visible);

 //Wait for callback function
 stop();

 ok(wasCalled, fadeOut was called);
 alert(Done  + wasCalled);

 });

 });

 I'm sure the problem is not understanding the stop and start
 methods. The order of popups confirms that Done is encountered
 before the Called alert is triggered in the callback function.
 Obviously, this causes the ok test to fail.

 How do I get the script to stop until the callback function is fired?
 Or is there a better way to test that fadeOut is applied?

 Thanks in advance,

 Todd


[jQuery] [validate] how to test text against a bad word list?

2008-09-22 Thread tobaco

hi,

i'm using the excellent validate-plugin and it works like a charm.
now i want to test the text in a textarea against a list of bad words.

how must be the syntax of the custom validation rule?
i'm very bad in regex …


thanks in advance,

tobaco


[jQuery] Re: jquery compatibility test 01

2008-05-29 Thread arden liu
Thanks for your suggestion. Now, I reduce my code as the following. But it
still does not work under Opera.
Maybe I have to use my own javascript instead of jquery, or I will try to
fix this problem of jquery.

===
html
head
titleInsert title here/title
script type=text/javascript src=/test/jquery-1.2.6.js/script
 script type=text/javascript
  function refreshProgress(){
$(#test1).val(e);
setTimeout(refreshProgress, 1500);
  }
   $(function(){
$(#formtest).submit(function(){
 setTimeout(refreshProgress, 1500);
});
   });
 /script
/head
body
 form id=formtest action=s.jsp 
  input id=test1 type=text name=fname value=Default /
  input type=submit id=submitButton value=submit/
 /form
/body
/html
===

On Wed, May 28, 2008 at 7:47 PM, Ariel Flesler [EMAIL PROTECTED] wrote:


 Reducing that to the real situation... you're setting a number as
 value to a text field.
 That did cause troubles (for selects) but was fixed on 1.2.6.
 I tried this (setting the val to a text field) and worked well.

 Maybe something else is failing ? try to remove all the irrelevant
 code and generate a minimalistic test case.

 Cheers

 --
 Ariel Flesler
 http://flesler.blogspot.com

 On 28 mayo, 17:25, arden liu [EMAIL PROTECTED] wrote:
  Hi,
  Today, I did some tests of compatibility among IE 7.0.5730.11, Firefox
  2.0.0.14, Opera 9.27, Safari 3.1.1
  The following JSP(includes Javascrpt) works fine under all these browser.
  Then I used JQuery to implement the same function, it works fine under
  IE/FF/Safari
  The submit function does not work correctly under Opera.
 
  Maybe I did not use Jquery correctly, or it is a compatibility problem of
  jquery-1.2.6.
  Thanks.
  Arden
 
 ===Javascript==­===
  ?xml version=1.0 encoding=UTF-8 ?
  %@ page language=java contentType=text/html; charset=UTF-8
  pageEncoding=UTF-8%
  %@ taglib uri=http://java.sun.com/jsp/jstl/core; prefix=c%
  !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN 
 http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;
  html xmlns=http://www.w3.org/1999/xhtml;
  head
  meta http-equiv=Content-Type content=text/html; charset=UTF-8 /
  titleInsert title here/title
   script type=text/javascript
var ipVal=0;
function refreshProgress(){
  ipVal = ipVal + 1;
  document.getElementById('test1').value=ipVal;
  setTimeout(refreshProgress(), 1500);
}
   /script
  /head
  body
   button id=buttonTest onclick=setTimeout('refreshProgress()',
  1500);Click Me!/button
   form id=formtest action=s.jsp
  onsubmit=setTimeout('refreshProgress()', 1500);
input id=test1 type=text name=fname value=Default /
input type=submit id=submitButton value=submit/
   /form
  /body
  /html
 
 
 =JQuery­===
  ?xml version=1.0 encoding=UTF-8 ?
  %@ page language=java contentType=text/html; charset=UTF-8
  pageEncoding=UTF-8%
  %@ taglib uri=http://java.sun.com/jsp/jstl/core; prefix=c%
  !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN 
 http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;
  html xmlns=http://www.w3.org/1999/xhtml;
  head
  meta http-equiv=Content-Type content=text/html; charset=UTF-8 /
  titleInsert title here/title
  script type=text/javascript src=c:url
  value='/javascripts/jquery/jquery-1.2.6.js'//script
   script type=text/javascript
var ipVal=0;
function refreshProgress(){
  ipVal = ipVal + 1;
  $(#test1).val(ipVal);
  setTimeout(refreshProgress, 1500);
}
 $(function(){
  $(#buttonTest).click(function(){
   setTimeout(refreshProgress, 1500);
  });
  $(#formtest).submit(function(){
   setTimeout(refreshProgress, 1500);
  });
 });
   /script
  /head
  body
   button id=buttonTestClick Me!/button
   form id=formtest action=s.jsp 
input id=test1 type=text name=fname value=Default /
input type=submit id=submitButton value=submit/
   /form
  /body
  /html
 
 =s.jsp=­==
  ?xml version=1.0 encoding=UTF-8 ?
  %@ page language=java contentType=text/html; charset=UTF-8
  pageEncoding=UTF-8%
  %@ taglib uri=http://java.sun.com/jsp/jstl/core; prefix=c%
  !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN 
 http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;
  html xmlns=http://www.w3.org/1999/xhtml;
  head
  %
  Thread.sleep(1);
  %
  /head
  body
   button id=buttonTestClick Me!/button
  /body
  /html



[jQuery] Re: jquery compatibility test 01

2008-05-28 Thread Ariel Flesler

Reducing that to the real situation... you're setting a number as
value to a text field.
That did cause troubles (for selects) but was fixed on 1.2.6.
I tried this (setting the val to a text field) and worked well.

Maybe something else is failing ? try to remove all the irrelevant
code and generate a minimalistic test case.

Cheers

--
Ariel Flesler
http://flesler.blogspot.com

On 28 mayo, 17:25, arden liu [EMAIL PROTECTED] wrote:
 Hi,
 Today, I did some tests of compatibility among IE 7.0.5730.11, Firefox
 2.0.0.14, Opera 9.27, Safari 3.1.1
 The following JSP(includes Javascrpt) works fine under all these browser.
 Then I used JQuery to implement the same function, it works fine under
 IE/FF/Safari
 The submit function does not work correctly under Opera.

 Maybe I did not use Jquery correctly, or it is a compatibility problem of
 jquery-1.2.6.
 Thanks.
 Arden
 ===Javascript==­===
 ?xml version=1.0 encoding=UTF-8 ?
 %@ page language=java contentType=text/html; charset=UTF-8
 pageEncoding=UTF-8%
 %@ taglib uri=http://java.sun.com/jsp/jstl/core; prefix=c%
 !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN 
 http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;
 html xmlns=http://www.w3.org/1999/xhtml;
 head
 meta http-equiv=Content-Type content=text/html; charset=UTF-8 /
 titleInsert title here/title
  script type=text/javascript
   var ipVal=0;
   function refreshProgress(){
     ipVal = ipVal + 1;
     document.getElementById('test1').value=ipVal;
     setTimeout(refreshProgress(), 1500);
   }
  /script
 /head
 body
  button id=buttonTest onclick=setTimeout('refreshProgress()',
 1500);Click Me!/button
  form id=formtest action=s.jsp
 onsubmit=setTimeout('refreshProgress()', 1500);
   input id=test1 type=text name=fname value=Default /
   input type=submit id=submitButton value=submit/
  /form
 /body
 /html

 =JQuery­===
 ?xml version=1.0 encoding=UTF-8 ?
 %@ page language=java contentType=text/html; charset=UTF-8
 pageEncoding=UTF-8%
 %@ taglib uri=http://java.sun.com/jsp/jstl/core; prefix=c%
 !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN 
 http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;
 html xmlns=http://www.w3.org/1999/xhtml;
 head
 meta http-equiv=Content-Type content=text/html; charset=UTF-8 /
 titleInsert title here/title
 script type=text/javascript src=c:url
 value='/javascripts/jquery/jquery-1.2.6.js'//script
  script type=text/javascript
   var ipVal=0;
   function refreshProgress(){
     ipVal = ipVal + 1;
     $(#test1).val(ipVal);
     setTimeout(refreshProgress, 1500);
   }
    $(function(){
     $(#buttonTest).click(function(){
      setTimeout(refreshProgress, 1500);
     });
     $(#formtest).submit(function(){
      setTimeout(refreshProgress, 1500);
     });
    });
  /script
 /head
 body
  button id=buttonTestClick Me!/button
  form id=formtest action=s.jsp 
   input id=test1 type=text name=fname value=Default /
   input type=submit id=submitButton value=submit/
  /form
 /body
 /html
 =s.jsp=­==
 ?xml version=1.0 encoding=UTF-8 ?
 %@ page language=java contentType=text/html; charset=UTF-8
 pageEncoding=UTF-8%
 %@ taglib uri=http://java.sun.com/jsp/jstl/core; prefix=c%
 !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN 
 http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;
 html xmlns=http://www.w3.org/1999/xhtml;
 head
 %
 Thread.sleep(1);
 %
 /head
 body
  button id=buttonTestClick Me!/button
 /body
 /html


[jQuery] How do you test if hidden or shown in jquery

2008-03-03 Thread otherjohn

ok,
I have 2 elements that use the .toggle function to hide and show
themselves. But I would like, when each is clicked, for it to test if
the other element is currently showing and hide it and vice versa. Can
someone help me find how to do that?
John


[jQuery] Please suggest minimal test of jQuery installation

2008-02-16 Thread RLFitch

Please suggest some way to verify jQuery installation.

I having some difficulty with jQuery installation on a server with
'antiquated' OS (OpenVMS circa 1995).  I not sure if my lack of
success is due to the web server software/OS or if I'm doing something
wrong. I've managed to install jQuery on several other machines
(including much newer OpenVMS).

Thanks very much.
Ransom Fitch


[jQuery] Re: jquery newbie test

2008-02-05 Thread tlob

finaly I am not alone anymore ;-)

On Feb 5, 2:15 am, Josh Nathanson [EMAIL PROTECTED] wrote:
 Access...confirmed.  =]

   - Original Message -
   From: CFMike
   To: jquery-en@googlegroups.com
   Sent: Monday, February 04, 2008 4:00 PM
   Subject: [jQuery] jquery newbie test

   Please ignore. I am new to the jquery list. I am just testing my access. 
 Thank you for your patience.


[jQuery] Re: jquery newbie test

2008-02-05 Thread CFMike

Josh and Aaron- Thanks

On Feb 4, 5:15 pm, Josh Nathanson [EMAIL PROTECTED] wrote:
 Access...confirmed.  =]

   - Original Message -
   From: CFMike
   To: jquery-en@googlegroups.com
   Sent: Monday, February 04, 2008 4:00 PM
   Subject: [jQuery] jquery newbie test

   Please ignore. I am new to the jquery list. I am just testing my access. 
 Thank you for your patience.


[jQuery] Re: jquery newbie test

2008-02-04 Thread Josh Nathanson
Access...confirmed.  =]
  - Original Message - 
  From: CFMike 
  To: jquery-en@googlegroups.com 
  Sent: Monday, February 04, 2008 4:00 PM
  Subject: [jQuery] jquery newbie test


  Please ignore. I am new to the jquery list. I am just testing my access. 
Thank you for your patience.


[jQuery] Re: jquery newbie test

2008-02-04 Thread Aaron Heimlich
Your test has succeeded!

On Feb 4, 2008 6:00 PM, CFMike [EMAIL PROTECTED] wrote:

  Please ignore. I am new to the jquery list. I am just testing my access.
 Thank you for your patience.




-- 
Aaron Heimlich
Web Developer
[EMAIL PROTECTED]
http://aheimlich.freepgs.com


[jQuery] jQuery.getScript() way to test if the script has already been downloaded?

2007-12-03 Thread seth

Hi,
Is there a way to see if a script has already been downloaded before i
'download' it again?

i.e. i have this:

$(document).ready(function(){

  $(#editor).click(function(){
$.getScript(/fckeditor/fckeditor.js, function(){
$.rteditor(body,{ buttons: { Cancel: false, Submit: true } });
});
  });

});

what this does is download the .js file and then calls my rteditor
obj.  But i would like to be able to do a test:

if user has downloaded /fckeditor/fckeditor.js,  then
   call the rteditor obj.
else
   getScript(...) and call rteditor

so does anyone know how i would see if that script has been
downloaded?

thanks
seth


[jQuery] How do you test if an object exists?

2007-08-28 Thread Frank Peterson

I'm getting weird bugs when using setTimeouts and/or setIntervals
after I hit the back button in Firefox to come back to the page.

I need to do a check at the top of any setTimeout to make sure that
the object I need still exists.

But I dont know how :(



[jQuery] Re: How to test if plugin X is loaded ?

2007-08-15 Thread xavier

Thanks, didn't search the doc at the right place (was looking into
core, that's under ajax).

Why would you question if I really want to do that ? What would be the
reason/risk of doing it ?

X+

On Aug 15, 1:09 am, Erik Beeson [EMAIL PROTECTED] wrote:
 I question whether or not you really want to be doing that... But here's
 both questions in one go:

 if(!$.isFunction($.fn['pluginName'])) {
   $.getScript('/path/to/plugin', function() {
 alert('Plugin ready');
   });} else {

   alert('Plugin ready');

 }

 That assumes the plugin is on the same domain as the current page. If not,
 getScript won't work, so you'd have to do something like:

   var script = document.createElement('script');
   script.type = 'text/javascript';
   script.src = '/path/to/plugin';
   $('head')[0].appendChild(script);

 But then you don't get the nice callback stuff to ensure that it's loaded.

 --Erik

 On 8/14/07, Benjamin Sterling [EMAIL PROTECTED] wrote:



  Xavier,
  For question #1:  if(typeof $.fn.tableSorter == 'function')

  question #2: yes, you just need to know the path to the file and do a
  document.write('script...

  On 8/14/07, xavier [EMAIL PROTECTED] wrote:

   Hello,

   I'd like to be able to test if a specific plug in is loaded before
   calling some of its properties (to avoid throwing an error).

   Second question, is it possible to load it if missing ?

   Use case:

   I have a bit of template that have a sortable table of users, and
   another one that list groups. They both have a sortable table, and
   might be included into the same page or used separately.

   I'd rather not load on all the pages the sortable table plugin, so I
   have to be able to detect on each of these template if the plugin is
   already loaded or if I have to load it (or not call the .tableSorter()
   method).

   Any suggestion ?

   Thanks in advance,

   X+

  --
  Benjamin Sterling
 http://www.KenzoMedia.com
 http://www.KenzoHosting.com



[jQuery] Re: How to test if plugin X is loaded ?

2007-08-15 Thread Erik Beeson
Because I think it would be much cleaner to just load the plugins that you
want in the first place...

--Erik


On 8/15/07, xavier [EMAIL PROTECTED] wrote:


 Thanks, didn't search the doc at the right place (was looking into
 core, that's under ajax).

 Why would you question if I really want to do that ? What would be the
 reason/risk of doing it ?

 X+

 On Aug 15, 1:09 am, Erik Beeson [EMAIL PROTECTED] wrote:
  I question whether or not you really want to be doing that... But here's
  both questions in one go:
 
  if(!$.isFunction($.fn['pluginName'])) {
$.getScript('/path/to/plugin', function() {
  alert('Plugin ready');
});} else {
 
alert('Plugin ready');
 
  }
 
  That assumes the plugin is on the same domain as the current page. If
 not,
  getScript won't work, so you'd have to do something like:
 
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = '/path/to/plugin';
$('head')[0].appendChild(script);
 
  But then you don't get the nice callback stuff to ensure that it's
 loaded.
 
  --Erik
 
  On 8/14/07, Benjamin Sterling [EMAIL PROTECTED] wrote:
 
 
 
   Xavier,
   For question #1:  if(typeof $.fn.tableSorter == 'function')
 
   question #2: yes, you just need to know the path to the file and do a
   document.write('script...
 
   On 8/14/07, xavier [EMAIL PROTECTED] wrote:
 
Hello,
 
I'd like to be able to test if a specific plug in is loaded before
calling some of its properties (to avoid throwing an error).
 
Second question, is it possible to load it if missing ?
 
Use case:
 
I have a bit of template that have a sortable table of users, and
another one that list groups. They both have a sortable table, and
might be included into the same page or used separately.
 
I'd rather not load on all the pages the sortable table plugin, so I
have to be able to detect on each of these template if the plugin is
already loaded or if I have to load it (or not call the
 .tableSorter()
method).
 
Any suggestion ?
 
Thanks in advance,
 
X+
 
   --
   Benjamin Sterling
  http://www.KenzoMedia.com
  http://www.KenzoHosting.com




[jQuery] Re: How to test if plugin X is loaded ?

2007-08-14 Thread Benjamin Sterling
Xavier,
For question #1:  if(typeof $.fn.tableSorter == 'function')

question #2: yes, you just need to know the path to the file and do a
document.write('script...



On 8/14/07, xavier [EMAIL PROTECTED] wrote:


 Hello,

 I'd like to be able to test if a specific plug in is loaded before
 calling some of its properties (to avoid throwing an error).

 Second question, is it possible to load it if missing ?

 Use case:

 I have a bit of template that have a sortable table of users, and
 another one that list groups. They both have a sortable table, and
 might be included into the same page or used separately.

 I'd rather not load on all the pages the sortable table plugin, so I
 have to be able to detect on each of these template if the plugin is
 already loaded or if I have to load it (or not call the .tableSorter()
 method).

 Any suggestion ?

 Thanks in advance,

 X+




-- 
Benjamin Sterling
http://www.KenzoMedia.com
http://www.KenzoHosting.com


[jQuery] Re: How to test if plugin X is loaded ?

2007-08-14 Thread Erik Beeson
I question whether or not you really want to be doing that... But here's
both questions in one go:

if(!$.isFunction($.fn['pluginName'])) {
  $.getScript('/path/to/plugin', function() {
alert('Plugin ready');
  });
} else {
  alert('Plugin ready');
}

That assumes the plugin is on the same domain as the current page. If not,
getScript won't work, so you'd have to do something like:

  var script = document.createElement('script');
  script.type = 'text/javascript';
  script.src = '/path/to/plugin';
  $('head')[0].appendChild(script);

But then you don't get the nice callback stuff to ensure that it's loaded.

--Erik


On 8/14/07, Benjamin Sterling [EMAIL PROTECTED] wrote:

 Xavier,
 For question #1:  if(typeof $.fn.tableSorter == 'function')

 question #2: yes, you just need to know the path to the file and do a
 document.write('script...



 On 8/14/07, xavier [EMAIL PROTECTED] wrote:
 
 
  Hello,
 
  I'd like to be able to test if a specific plug in is loaded before
  calling some of its properties (to avoid throwing an error).
 
  Second question, is it possible to load it if missing ?
 
  Use case:
 
  I have a bit of template that have a sortable table of users, and
  another one that list groups. They both have a sortable table, and
  might be included into the same page or used separately.
 
  I'd rather not load on all the pages the sortable table plugin, so I
  have to be able to detect on each of these template if the plugin is
  already loaded or if I have to load it (or not call the .tableSorter()
  method).
 
  Any suggestion ?
 
  Thanks in advance,
 
  X+
 
 


 --
 Benjamin Sterling
 http://www.KenzoMedia.com
 http://www.KenzoHosting.com


[jQuery] Re: Another speed test

2007-07-11 Thread Rey Bango


Jack actually points out the fact that div div div is pointless. He 
also gives a lot of kudos to jQuery and I'm glad for that. He even 
mentioned John's nth child script and how well-written it is. I like the 
fact that he, in a roundabout way, calls out other libs on the use of 
pointless selectors and the tweaking towards XPath.


I would venture to say that when SlickSpeed was first posted by 
MooTools, very few developers actually compared the results in IE. IE is 
still the dominant browser and if you look at the performance of the 
libs in IE, you'll see that jQuery really performed well while others 
fell on their face.


While the results don't show us to the be the fastest, I think the post 
helps to validate John Resig's position that the selectors in these 
tests don't represent real-world examples and certainly shows the lack 
of consistent performance by other libs when using the leading browser.


In terms of performance, we're well within effective speed ranges so as 
you mentioned, Glen, 10ms is irrelevant. I see this as Jack's way of 
quieting the other groups and not specifically targeted at jQuery.


Rey...


Glen Lipka wrote:

http://extjs.com/blog/2007/07/10/css-selectors-speed-myths/

rant
div div div, we are slowest by like 50 ms, but div div we are not 
slowest, and within 9ms of the leader.

Who uses div div div?

  pun
  What divference does it make?
  /pun

Plus, some of the libraries are packed, and some are not.  (jQuery is not)

Would that change the results?

Are we really nitpicking about 10's of milliseconds?
No mention of file size again.  No mention of capabilities in the core.

/rant

Glen


--
BrightLight Development, LLC.
954-775- (o)
954-600-2726 (c)
[EMAIL PROTECTED]
http://www.iambright.com


[jQuery] Re: Another speed test

2007-07-11 Thread Glen Lipka

Actually, I am putting my money where my mouth is:
http://www.commadot.com/jquery/speedtest/

This shows library SIZE and it also uses an actual website.  (My blog, which
is typical of normal WordPress blogs).

I'm still playing with the selectors.  not sure why some didnt find
anything.

Glen

On 7/11/07, Rey Bango [EMAIL PROTECTED] wrote:



Jack actually points out the fact that div div div is pointless. He
also gives a lot of kudos to jQuery and I'm glad for that. He even
mentioned John's nth child script and how well-written it is. I like the
fact that he, in a roundabout way, calls out other libs on the use of
pointless selectors and the tweaking towards XPath.

I would venture to say that when SlickSpeed was first posted by
MooTools, very few developers actually compared the results in IE. IE is
still the dominant browser and if you look at the performance of the
libs in IE, you'll see that jQuery really performed well while others
fell on their face.

While the results don't show us to the be the fastest, I think the post
helps to validate John Resig's position that the selectors in these
tests don't represent real-world examples and certainly shows the lack
of consistent performance by other libs when using the leading browser.

In terms of performance, we're well within effective speed ranges so as
you mentioned, Glen, 10ms is irrelevant. I see this as Jack's way of
quieting the other groups and not specifically targeted at jQuery.

Rey...


Glen Lipka wrote:
 http://extjs.com/blog/2007/07/10/css-selectors-speed-myths/

 rant
 div div div, we are slowest by like 50 ms, but div div we are not
 slowest, and within 9ms of the leader.
 Who uses div div div?

   pun
   What divference does it make?
   /pun

 Plus, some of the libraries are packed, and some are not.  (jQuery is
not)

 Would that change the results?

 Are we really nitpicking about 10's of milliseconds?
 No mention of file size again.  No mention of capabilities in the core.

 /rant

 Glen

--
BrightLight Development, LLC.
954-775- (o)
954-600-2726 (c)
[EMAIL PROTECTED]
http://www.iambright.com



[jQuery] Re: Another speed test

2007-07-11 Thread Jörn Zaefferer


Glen Lipka wrote:

Actually, I am putting my money where my mouth is:
http://www.commadot.com/jquery/speedtest/

This shows library SIZE and it also uses an actual website.  (My blog, 
which is typical of normal WordPress blogs).


I'm still playing with the selectors.  not sure why some didnt find 
anything.
That looks like (after a run in FF2): MooTools 1.2dev is buggy or 
whatever, MochiKit out of the competition, and the rest is just the same.
In IE6 Ext performs better then jQuery, while the rest is too slow or 
too buggy. Wohoo.


--
Jörn Zaefferer

http://bassistance.de



[jQuery] Re: Another speed test

2007-07-11 Thread Rey Bango


Glen, you have a typo in the test. It should be jQuery v1.1.3.1! ;)

Glen Lipka wrote:

Actually, I am putting my money where my mouth is:
http://www.commadot.com/jquery/speedtest/

This shows library SIZE and it also uses an actual website.  (My blog, 
which is typical of normal WordPress blogs).


I'm still playing with the selectors.  not sure why some didnt find 
anything.


Glen

On 7/11/07, *Rey Bango*  [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] 
wrote:



Jack actually points out the fact that div div div is pointless. He
also gives a lot of kudos to jQuery and I'm glad for that. He even
mentioned John's nth child script and how well-written it is. I like the
fact that he, in a roundabout way, calls out other libs on the use of
pointless selectors and the tweaking towards XPath.

I would venture to say that when SlickSpeed was first posted by
MooTools, very few developers actually compared the results in IE. IE is
still the dominant browser and if you look at the performance of the
libs in IE, you'll see that jQuery really performed well while others
fell on their face.

While the results don't show us to the be the fastest, I think the post
helps to validate John Resig's position that the selectors in these
tests don't represent real-world examples and certainly shows the lack
of consistent performance by other libs when using the leading browser.

In terms of performance, we're well within effective speed ranges so as
you mentioned, Glen, 10ms is irrelevant. I see this as Jack's way of
quieting the other groups and not specifically targeted at jQuery.

Rey...


Glen Lipka wrote:
  http://extjs.com/blog/2007/07/10/css-selectors-speed-myths/
 
  rant
  div div div, we are slowest by like 50 ms, but div div we are not
  slowest, and within 9ms of the leader.
  Who uses div div div?
 
pun
What divference does it make?
/pun
 
  Plus, some of the libraries are packed, and some are
not.  (jQuery is not)
 
  Would that change the results?
 
  Are we really nitpicking about 10's of milliseconds?
  No mention of file size again.  No mention of capabilities in the
core.
 
  /rant
 
  Glen

--
BrightLight Development, LLC.
954-775- (o)
954-600-2726 (c)
[EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
http://www.iambright.com http://www.iambright.com




--
BrightLight Development, LLC.
954-775- (o)
954-600-2726 (c)
[EMAIL PROTECTED]
http://www.iambright.com


[jQuery] Re: Another speed test

2007-07-11 Thread Glen Lipka

oops, fixed.  Also, I fixed a mistake in the template.  I was including 2
heads/body tags.

If anyone has a page they wanted to test, I can make it live.

Send me
1. Source of the page without any JS. (Css paths should be absolute)
2. A list of selectors you want to test.  Should be specific to your page.
3. donate $1 to jQuery ;)

Glen

On 7/11/07, Rey Bango [EMAIL PROTECTED] wrote:



Glen, you have a typo in the test. It should be jQuery v1.1.3.1! ;)

Glen Lipka wrote:
 Actually, I am putting my money where my mouth is:
 http://www.commadot.com/jquery/speedtest/

 This shows library SIZE and it also uses an actual website.  (My blog,
 which is typical of normal WordPress blogs).

 I'm still playing with the selectors.  not sure why some didnt find
 anything.

 Glen

 On 7/11/07, *Rey Bango*  [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
 wrote:


 Jack actually points out the fact that div div div is pointless.
He
 also gives a lot of kudos to jQuery and I'm glad for that. He even
 mentioned John's nth child script and how well-written it is. I like
the
 fact that he, in a roundabout way, calls out other libs on the use
of
 pointless selectors and the tweaking towards XPath.

 I would venture to say that when SlickSpeed was first posted by
 MooTools, very few developers actually compared the results in IE.
IE is
 still the dominant browser and if you look at the performance of the
 libs in IE, you'll see that jQuery really performed well while
others
 fell on their face.

 While the results don't show us to the be the fastest, I think the
post
 helps to validate John Resig's position that the selectors in these
 tests don't represent real-world examples and certainly shows the
lack
 of consistent performance by other libs when using the leading
browser.

 In terms of performance, we're well within effective speed ranges so
as
 you mentioned, Glen, 10ms is irrelevant. I see this as Jack's way of
 quieting the other groups and not specifically targeted at jQuery.

 Rey...


 Glen Lipka wrote:
   http://extjs.com/blog/2007/07/10/css-selectors-speed-myths/
  
   rant
   div div div, we are slowest by like 50 ms, but div div we are
not
   slowest, and within 9ms of the leader.
   Who uses div div div?
  
 pun
 What divference does it make?
 /pun
  
   Plus, some of the libraries are packed, and some are
 not.  (jQuery is not)
  
   Would that change the results?
  
   Are we really nitpicking about 10's of milliseconds?
   No mention of file size again.  No mention of capabilities in the
 core.
  
   /rant
  
   Glen

 --
 BrightLight Development, LLC.
 954-775- (o)
 954-600-2726 (c)
 [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
 http://www.iambright.com http://www.iambright.com



--
BrightLight Development, LLC.
954-775- (o)
954-600-2726 (c)
[EMAIL PROTECTED]
http://www.iambright.com



[jQuery] POT: CSS Selector test

2007-07-09 Thread Benjamin Sterling
Came across this when running thru w3c.org and thought it was interesting:
http://www.css3.info/selectors-test/

I have FF2 running and a lot of the selectors failed and in IE7, even more
failed.

-- 
Benjamin Sterling
http://www.KenzoMedia.com
http://www.KenzoHosting.com


[jQuery] this is a test

2007-05-07 Thread Andy Matthews
 
 

 
Andy Matthews
Senior Coldfusion Developer

Office:  877.707.5467 x747
Direct:  615.627.9747
Fax:  615.467.6249
[EMAIL PROTECTED]
www.dealerskins.com http://www.dealerskins.com/ 
 
dealerskinslogo.bmp

[jQuery] Re: How to test if an event is already bound to an object ?

2007-04-30 Thread xavier

Thanks, very interesting and clarifying.

Actually, I suspect that the loop (or selector) didn't find any
element because the event handler I was looking for seems to be plug
on a parent element.

Anyway, I did it by filtering on the class attribute, that was a
cleaner option. Thanks to all.

X+

On Apr 29, 5:07 pm, Brandon Aaron [EMAIL PROTECTED] wrote:
 You should take a look at this short blog 
 post:http://www.learningjquery.com/2007/03/selecting-elements-by-propertie...

 --
 Brandon Aaron




[jQuery] Re: How to test if an event is already bound to an object ?

2007-04-28 Thread xavier

Hi,

The this.$events is never existing as far as I understand (based on
firebug), no matter if the link has an event or not.

I have events associated to the click that are created with the jquery
accordion plugin. I suppose they are normal events, and that's not why
they aren't seen.

Any idea?

Xavier

On Apr 27, 8:16 pm, Jeffrey Kretz [EMAIL PROTECTED] wrote:
 This is not a terribly elegant way to do it, but it does work.

 $('whatever_elements').each(function(i)
 {
 var hasclick = false;

 if (this.$events  this.$events['click'])
 {
 for (j in this.$events['click'])
 {
 hasclick = true;
 break;
 }
 }
 if (!hasclick)
 {
 jQuery(this).click( function(e) { /* do something
 else */ } );
 }
 });

 It tests for the existence of the jQuery click event, and if there are any
 functions subscribed to it.  Note that an unbound click event still exists,
 but it has no event handlers attached (which is what the for loop checks).

 JK

 -Original Message-
 From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On

 Behalf Of xavier
 Sent: Friday, April 27, 2007 10:42 AM
 To: jQuery (English)
 Subject: [jQuery] How to test if an event is already bound to an object ?

 Hello,

 I want to add a default javascript function to all my internal links
 that DON'T already have a behaviour.

 If i do :

   jQuery([EMAIL PROTECTED]/]).bind(click,function(){
 //jQuery(#main).empty().append(Loading...).load (/test);
 jQuery(#main).load (/xajax/+this.pathname,{},function()
 {this.style.opacity=1;}).fadeTo(slow,0.1);
 return false;
 });

 (it replaces all the normal links by an ajax call) Then it applies
 it also to links that have already a javascript event to it.

 Is it possible to select only the links that don't have any event
 bound to the click event ?

 Thanks in advance,

 Xavier



[jQuery] Re: How to test if an event is already bound to an object ?

2007-04-27 Thread Jeffrey Kretz

This is not a terribly elegant way to do it, but it does work.

$('whatever_elements').each(function(i)
{
var hasclick = false;

if (this.$events  this.$events['click'])
{
for (j in this.$events['click'])
{
hasclick = true;
break;
}
}
if (!hasclick)
{
jQuery(this).click( function(e) { /* do something
else */ } );
}
});

It tests for the existence of the jQuery click event, and if there are any
functions subscribed to it.  Note that an unbound click event still exists,
but it has no event handlers attached (which is what the for loop checks).

JK

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of xavier
Sent: Friday, April 27, 2007 10:42 AM
To: jQuery (English)
Subject: [jQuery] How to test if an event is already bound to an object ?


Hello,

I want to add a default javascript function to all my internal links
that DON'T already have a behaviour.

If i do :

  jQuery([EMAIL PROTECTED]/]).bind(click,function(){
//jQuery(#main).empty().append(Loading...).load (/test);
jQuery(#main).load (/xajax/+this.pathname,{},function()
{this.style.opacity=1;}).fadeTo(slow,0.1);
return false;
});

(it replaces all the normal links by an ajax call) Then it applies
it also to links that have already a javascript event to it.

Is it possible to select only the links that don't have any event
bound to the click event ?

Thanks in advance,

Xavier




[jQuery] Re: How to test if an event is already bound to an object ?

2007-04-27 Thread xavier

Well my question was rather looking for a dirty hack anyway...

I will use your way and then move to something cleaner, either using a
class or a rel attibute to define what can't be altered.

Thanks,

Xavier

On Apr 27, 8:16 pm, Jeffrey Kretz [EMAIL PROTECTED] wrote:
 This is not a terribly elegant way to do it, but it does work.

 $('whatever_elements').each(function(i)
 {
 var hasclick = false;

 if (this.$events  this.$events['click'])
 {
 for (j in this.$events['click'])
 {
 hasclick = true;
 break;
 }
 }
 if (!hasclick)
 {
 jQuery(this).click( function(e) { /* do something
 else */ } );
 }
 });

 It tests for the existence of the jQuery click event, and if there are any
 functions subscribed to it.  Note that an unbound click event still exists,
 but it has no event handlers attached (which is what the for loop checks).

 JK

 -Original Message-
 From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On

 Behalf Of xavier
 Sent: Friday, April 27, 2007 10:42 AM
 To: jQuery (English)
 Subject: [jQuery] How to test if an event is already bound to an object ?

 Hello,

 I want to add a default javascript function to all my internal links
 that DON'T already have a behaviour.

 If i do :

   jQuery([EMAIL PROTECTED]/]).bind(click,function(){
 //jQuery(#main).empty().append(Loading...).load (/test);
 jQuery(#main).load (/xajax/+this.pathname,{},function()
 {this.style.opacity=1;}).fadeTo(slow,0.1);
 return false;
 });

 (it replaces all the normal links by an ajax call) Then it applies
 it also to links that have already a javascript event to it.

 Is it possible to select only the links that don't have any event
 bound to the click event ?

 Thanks in advance,

 Xavier