[jQuery] Re: ajax xml question

2009-09-18 Thread David .Wu

terrific!!! thanks a lot

On 9月17日, 下午5時57分, lanxiazhi lanxia...@gmail.com wrote:
 specify content type to xml:

 header(Content-type: text/xml);
 if ($_GET['weather']) {
 ...


[jQuery] Re: ajax xml question

2009-09-18 Thread David .Wu

But I got one more question
http://www.google.com/ig/api?hl=zh-twweather=Changhua
This is the weather condition that response by my language, and the
value become garbage characters exclude English, any solution?

On 9月18日, 下午2時06分, David .Wu chan1...@gmail.com wrote:
 terrific!!! thanks a lot

 On 9月17日, 下午5時57分, lanxiazhi lanxia...@gmail.com wrote:

  specify content type to xml:

  header(Content-type: text/xml);
  if ($_GET['weather']) {
  ...


[jQuery] Re: ajax xml question

2009-09-18 Thread Steven Yang
I think you might have to check the encoding that google is usingI think
google should be using UTF-8. check the encoding on your side.

On Fri, Sep 18, 2009 at 2:11 PM, David .Wu chan1...@gmail.com wrote:


 But I got one more question
 http://www.google.com/ig/api?hl=zh-twweather=Changhua
 This is the weather condition that response by my language, and the
 value become garbage characters exclude English, any solution?

 On 9月18日, 下午2時06分, David .Wu chan1...@gmail.com wrote:
  terrific!!! thanks a lot
 
  On 9月17日, 下午5時57分, lanxiazhi lanxia...@gmail.com wrote:
 
   specify content type to xml:
 
   header(Content-type: text/xml);
   if ($_GET['weather']) {
   ...



[jQuery] Re: ajax xml question

2009-09-18 Thread David .Wu

I am using utf-8 too.

On 9月18日, 下午2時27分, Steven Yang kenshin...@gmail.com wrote:
 I think you might have to check the encoding that google is usingI think
 google should be using UTF-8. check the encoding on your side.

 On Fri, Sep 18, 2009 at 2:11 PM, David .Wu chan1...@gmail.com wrote:

  But I got one more question
 http://www.google.com/ig/api?hl=zh-twweather=Changhua
  This is the weather condition that response by my language, and the
  value become garbage characters exclude English, any solution?

  On 9月18日, 下午2時06分, David .Wu chan1...@gmail.com wrote:
   terrific!!! thanks a lot

   On 9月17日, 下午5時57分, lanxiazhi lanxia...@gmail.com wrote:

specify content type to xml:

header(Content-type: text/xml);
if ($_GET['weather']) {
...


[jQuery] Re: ajax xml question

2009-09-18 Thread David .Wu

As the matter of fact, I execute the weather.php like weather.php?
weather=1
and the character was right, so the problem is happend when ajax
delivery.

On 9月18日, 下午2時39分, David .Wu chan1...@gmail.com wrote:
 I am using utf-8 too.

 On 9月18日, 下午2時27分, Steven Yang kenshin...@gmail.com wrote:

  I think you might have to check the encoding that google is usingI think
  google should be using UTF-8. check the encoding on your side.

  On Fri, Sep 18, 2009 at 2:11 PM, David .Wu chan1...@gmail.com wrote:

   But I got one more question
  http://www.google.com/ig/api?hl=zh-twweather=Changhua
   This is the weather condition that response by my language, and the
   value become garbage characters exclude English, any solution?

   On 9月18日, 下午2時06分, David .Wu chan1...@gmail.com wrote:
terrific!!! thanks a lot

On 9月17日, 下午5時57分, lanxiazhi lanxia...@gmail.com wrote:

 specify content type to xml:

 header(Content-type: text/xml);
 if ($_GET['weather']) {
 ...


[jQuery] Re: tooltips not working on content loaded via ajax

2009-09-18 Thread Canadaka

A friend helped me solve the problem. I had to recall the tooltip
function in the response, I couldn't use load, so i switched to the
$.ajax method

$.ajax({
url: url,
cache: false,
dataType: html,
success: function(response){
var html = $(response);
html.find(a, img).easyTooltip();
$('#'+element).html(html);
},
error: function (xhr, desc, exceptionobj) {
$('#'+element).html(xhr.responseText);
}
});


On Sep 17, 12:54 am, Canadaka canad...@gmail.com wrote:
 BUMP, anyone ??

 On Sep 10, 11:52 pm, Canadaka canad...@gmail.com wrote:

  thanks for the response, I'm not sure how I can use live()
  Here is a snippit of the javascript in question.

  div id=tweets/div
  div id=statica href=# title=this is thetooltiptexttest/
  a/div

  script type=text/javascript src=http://ajax.googleapis.com/ajax/
  libs/jquery/1.3.2/jquery.min.js/script
  script type=text/javascript src=/includes/js/
  jquery.easyTooltip.js/script
  script type=text/javascript!--

  function ajax_request(element,url) {
    $('#'+element).html('span id=loadingloading.../span');
    $('#'+element).load(url);

  }

  $(document).ready(function() {
          ajax_request('tweets', '/includes/tweets.php?type=allmp=1');
          $(a,img).easyTooltip();

  });

  thetooltipfor the link in the static div works fine. But links
  that are displayed via the ajax_request in the tweets div have notooltip.

  On Sep 9, 6:11 am, Alex Weber alexwebe...@gmail.com wrote:

   I'm not sure I understand completely, if you mean that thetooltip
   doesnt work with elements dynamically generated via load(), then it
   could be a binding issue... try binding an alert() and see if that
   works.  in case it doesn't its because when the event was bound the
   elements didn't exist... the solution is to use live():

   $('.tooltipElement').live(..)

   On Sep 9, 1:46 am, Canadaka canad...@gmail.com wrote:

I have some simple tooltips on my site that load the content of the
title tag into thetooltip. I am currently using this 
pluginhttp://cssglobe.com/post/4380/easy-tooltip--jquery-pluginbutIhave
tried several others.

They all work fine for static elements, but the main content of my
pages are loaded by an ajax load() call. The tooltips don't work on
any this content loaded via ajax. Why is this happening and is there a
way to fix this? Or maybe atooltipplugin that will work for this?


[jQuery] Re: Ajax - Access data arguments in callback

2009-09-18 Thread Flamer

Thanks for your reply.

Does this not gives problems when I have an AJAX request with a
timeout after say 2 seconds, but in the meantime there's another
request using the same variable? Or is the sentData only accessible in
the click( function(){ } ) scope?

There is no other way of getting the data I sent with the request?

On 17 sep, 15:28, Nick Fitzsimons n...@nickfitz.co.uk wrote:
 2009/9/17 Flamer mkapp...@gmail.com:





  Hello,

  Is it possible to access the data arguments that are sent with the
  ajax function?

  Example:
  $('#mycheckbox').click( function() {
         $.get( '/ajax.php', { nr: this.id }, function( data, textStatus ) {
                 // Here I want to access the arguments I just sent with 
  ajax.php

                 // As example, something like this:
                 $('#'+arguments.nr).attr('checked', 'checked');
         } );

         return false;
  } );

 If I understand you correctly, then assigning your data object to a
 variable which can be accessed via a closure in the callback function
 would do it - something like:

 $('#mycheckbox').click( function() {
        var sentData = { nr: this.id };
        $.get( '/ajax.php', sentData, function( data, textStatus ) {
                // Here I want to access the arguments I just sent with 
 ajax.php

                // As example, something like this:
                $('#'+ sentData.nr).attr('checked', 'checked');
        } );

        return false;

 } );

 should be all you need.

 Regards,

 Nick.
 --
 Nick Fitzsimonshttp://www.nickfitz.co.uk/


[jQuery] Re: asynchronous validation + BabySteps

2009-09-18 Thread csetzkorn

Hi,

I would really appreciate any reply/comments. Looking forward to
hearing from you.

Thanks.

Regards,

Christian

On Sep 14, 10:34 am, csetzkorn c.setzk...@liv.ac.uk wrote:
 Hi,

 I am struggling a bit with this. I am using the 'jQuery BlockUI
 Plugin' and the 'BabySteps' plugin (http://blog.vokle.com/index.php/
 2008/08/22/babysteps/) where I go from step to step if the previous
 step validates ok. I have (simplified) code like this:

 step1.bindStep(step2, { nextValidator: step1_validator, transition:
 function(currStep, nextStep) { currStep.slideUp(); nextStep.slideDown
 (); } });

 function step1_validator() {

 $.ajax({
                 url: ../a/b,
                 type: POST,
                 dataType: text,
                 data: { },
                 async: true,
                 error: function(XMLHttpRequest, textStatus,
 errorThrown) {
                     showErrorMessage(Server error  + textStatus +  
 + errorThrown);
                 },
                 beforeSend:
                 function(data) {
                     $.blockUI({ message: 'Please wait ...' });
                 },
                 success: function(data) {
                     data = JSON.parse(data);
                     $.unblockUI();
                     if( !(data.message==) )
                     {
                         showErrorMessage(data.message);
                         return false;
                     }
                     else
                     {
                         return true;
                     }
                 }
             });

         }

 The step1_validator should return true or false depending on whether
 thevalidationis ok of not. I have to use server sidevalidationand
 make anasynchronousrequest. Ideally I would like my 'mother
 function' (step1_validator) to wait for theasynchronousrequest to
 finish and return true or false depending on 'if( !
 (data.message==) )'. I hope this makes sense. I can set async: to
 false but then $.blockUI({ message: 'Please wait ...' }); dose not
 work anymore.

 Looking forward to hearing from you.

 Best wishes,

 Christian


[jQuery] blockUI issue in IE8 (submitting patch)

2009-09-18 Thread Viraj Kanwade

Hi All,

I am using blockUI(2.14) in one of my projects.

A few days back, I upgraded to IE8 and the site stopped working. On
debugging, I found the issue to be in blockUI plugin.

Apparently, the reason seems to be that the plugin uses dynamic
functions like setExpression which are not supported in IE8 (I am
using 8.0.6001.18702).

I have generated the patch for the same. I could not find a way to
submit the patch for verification. So, I am adding it here.

Please let me know if this works fine.

Regards,
Viraj


225,230c225,236
 full ? s.setExpression('height','Math.max
(document.body.scrollHeight, document.body.offsetHeight) -
(jQuery.boxModel?0:'+opts.quirksmodeOffsetHack+') + px')
  : s.setExpression
('height','this.parentNode.offsetHeight + px');
 full ? s.setExpression('width','jQuery.boxModel 
document.documentElement.clientWidth || document.body.clientWidth +
px')
  : s.setExpression
('width','this.parentNode.offsetWidth + px');
 if (fixL) s.setExpression('left', fixL);
 if (fixT) s.setExpression('top', fixT);
---
 if(full) {
   s.height = Math.max(document.body.scrollHeight, 
 document.body.offsetHeight) - (jQuery.boxModel ? 0: 
 opts.quirksmodeOffsetHack) + px;
 } else {
   s.height = this.parentNode.offsetHeight + px;
 }
 if(full) {
   s.width = jQuery.boxModel  
 document.documentElement.clientWidth || document.body.clientWidth + px;
 } else {
   s.width = this.parentNode.offsetWidth + px;
 }
 if (fixL) s.left = fixL;
 if (fixT) s.top = fixT;
233c239
 if (full) s.setExpression
('top','(document.documentElement.clientHeight ||
document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah =
document.documentElement.scrollTop ?
document.documentElement.scrollTop : document.body.scrollTop) +
px');
---
 if (full) s.top = (document.documentElement.clientHeight || 
 document.body.clientHeight) / 2 - (this[0].offsetHeight / 2) + (blah = 
 document.documentElement.scrollTop ? document.documentElement.scrollTop : 
 document.body.scrollTop) + px;
236,240c242,245
   else if (!opts.centerY  full) {
   var top = (opts.css  opts.css.top) ? 
parseInt(opts.css.top) :
0;
   var expression = 
'((document.documentElement.scrollTop ?
document.documentElement.scrollTop : document.body.scrollTop) + '+top
+') + px';
 s.setExpression('top',expression);
   }
---
 else if (!opts.centerY  full) {
   var top = (opts.css  opts.css.top) ? parseInt(opts.css.top) : 
 0;
   s.top = ((document.documentElement.scrollTop ? 
 document.documentElement.scrollTop : document.body.scrollTop) + top) + px;
 }


[jQuery] Show div as overlay with jdialog

2009-09-18 Thread patrick_finger

Hello

Im a beginner in jquery and search for a solution to display a overlay-
Window. (ModalDialog, ModalPopup)
I found the jdialog-extension: 
http://www.gimiti.com/kltan/demo/jDialog/1.1/test.html

Looks very good, but i can't declare the overlay-content in a separate
file.
Instead i like to declare the overlay-content in the same page where
it's called from. (asp.net-Eventhandlers etc)

Is that possible or do you know another approach / another extension?

Thx




[jQuery] Re: Show div as overlay with jdialog

2009-09-18 Thread lanxiazhi
Try jquery-ui,it contains a dialog widget.


[jQuery] Multi Combined Selectors

2009-09-18 Thread ndes

hi all. i'm new here and i hope posting in right place. I'd like to
ask if and how I can add multicombined selectors like:
$(this).parent().parent().$(input:checkbox[class='list']).attr
('checked')

I know that the $(input:checkbox[ppb='list']) isn't right but i just
want to show you what i want to do.

I'm already inside a selector:
$(input:button[name='delete']).click(function() {
 if ($(this).parent().parent().$(input:checkbox[class='list']).attr
('checked')) {
 //dosomething
}
});

is this posible?
thanks in advance
N.


[jQuery] Re: is there a JQuery solution for multiple sticky tooltips?

2009-09-18 Thread rvdb

Ahh, wonderful! I hadn't thought of them as dialogs, but the JQuery UI
Dialog widget indeed seems to provide all I need here.

Thanks all for the suggestions!

Ron

On Sep 17, 10:38 pm, Karl Swedberg k...@englishrules.com wrote:
 Someone correct me if I'm wrong, but I think jQuery UI Dialog allows  
 for multiple dialogs open at a time. You might be able to get these to  
 work the way you want.

 --Karl

 
 Karl Swedbergwww.englishrules.comwww.learningjquery.com



[jQuery] Paste an image into a tag...

2009-09-18 Thread Hogsmill

This may or may not be possible, but if anyone knows a way to do it,
I'd love to hear from you.

Basically, I simply (?) want to copy an image (e.g. from ALT-Print
Screen or 'Copy Image'), and paste/drop it into an img tag on a page
so it appears on the page. I can then resize, drag-drop, etc. as
required.

I've had a rummage around the net, but can't find anything. Maybe it's
impossible?

Cheers,

Steve


[jQuery] Re: ajax xml question

2009-09-18 Thread lanxiazhi
Now you will need to change the header:
header('Content-Type: text/xml; charset=UTF-8');


[jQuery] Datepicker and Jquery updating the value of pulldown menu

2009-09-18 Thread pennfoli0

Hi,
I need help adding the jquery date picker to my existing code, but
not
reconstructing the whole HTML file.

my code,
!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 /
titlecalenar/title
script src=http://ajax.googleapis.com/ajax/libs/jquery/
1.3.2/
jquery.min.js type=text/javascript charset=utf-8/script
script src=http://ajax.googleapis.com/ajax/libs/jqueryui/
1.7.2/jquery-ui.min.js type=text/javascript charset=utf-8/
script
script type=text/javascript
$(function(){
// #datepickers
$(#datepicker).datepicker({showOn: 'button',
buttonImage: 'images/calendar.gif', buttonImageOnly: true});
});
/script
/head
body
pDepart:/p
table cellpadding=2 cellspacing=0 border=0
  tr
tdselect name=departureMonth
onchange=javascript:dmddChange
(document.hotForm.departureMonth,document.hotForm.departureDay);
  option value=0January/option
  option value=1February/option
  option value=2March/option
  option value=3April/option
  option value=4May/option
  option value=5June/option
  option value=6July/option
  option value=7August/option
  option value=8September/option
  option value=9October/option
  option value=10November/option
  option value=11December/option
/select/td
tdselect name=departureDay onchange=dmddChange
(document.hotForm.departureMonth,document.hotForm.departureDay)
  option value=11/option
  option value=22/option
  option value=33/option
  option value=44/option
  option value=55/option
  option value=66/option
  option value=77/option
  option value=88/option
  option value=99/option
  option value=1010/option
  option value=/option
  option value=1212/option
  option value=1313/option
  option value=1414/option
  option value=1515/option
  option value=1616/option
  option value=1717/option
  option value=1818/option
  option value=1919/option
  option value=2020/option
  option value=2121/option
  option value=/option
  option value=2323/option
  option value=2424/option
  option value=2525/option
  option value=2626/option
  option value=27 selected=selected27/option
  option value=2828/option
  option value=2929/option
  option value=3030/option
  option value=3131/option
/select/td
tda href=javascript:openCalendar('hotForm',
'departure');img src=http://affiliate.travelnow.com/
searchboximages/blueFormCalendar.gif border=0//a/td
  /tr
/table
pGoing to:/p
table cellpadding=2 cellspacing=0 border=0
  tr
tdselect name=departureMonth
onchange=javascript:dmddChange
(document.hotForm.departureMonth,document.hotForm.departureDay);
  option value=0January/option
  option value=1February/option
  option value=2March/option
  option value=3April/option
  option value=4May/option
  option value=5June/option
  option value=6July/option
  option value=7August/option
  option value=8September/option
  option value=9October/option
  option value=10November/option
  option value=11December/option
/select/td
tdselect name=departureDay onchange=dmddChange
(document.hotForm.departureMonth,document.hotForm.departureDay)
  option value=11/option
  option value=22/option
  option value=33/option
  option value=44/option
  option value=55/option
  option value=66/option
  option value=77/option
  option value=88/option
  option value=99/option
  option value=1010/option
  option value=/option
  option value=1212/option
  option value=1313/option
  option value=1414/option
  option value=1515/option
  option value=1616/option
  option value=1717/option
  option value=1818/option
  option value=1919/option
  option value=2020/option
  option value=2121/option
  option value=/option
  option value=2323/option
  option value=2424/option
  option value=2525/option
  option value=2626/option
  option value=27 selected=selected27/option
  option value=2828/option
  option value=2929/option
  option value=3030/option
  option value=3131/option
/select/td
tda href=javascript:openCalendar('hotForm',
'departure');img src=http://affiliate.travelnow.com/

[jQuery] Re: Multi Combined Selectors

2009-09-18 Thread lanxiazhi
I think what you want is this:
$(this).parent().parent().*find*(:checkbox.list)


[jQuery] Re: Browser Stop call's ajax.Error

2009-09-18 Thread nirazue...@gmail.com

Bump.

On Sep 16, 9:53 pm, nirazue...@gmail.com nirazue...@gmail.com
wrote:
 Thank you.
 Can you think up with a solution to this? How can I detect when the
 call is begin terminated?

 On Sep 14, 5:32 pm, MiKiTiE mikiji...@googlemail.com wrote:

  Probably because you're sending the data to the url, but stopping the
  process before it can produce a result.

  On Sep 13, 7:52 pm, nirazue...@gmail.com nirazue...@gmail.com
  wrote:

   Hi, I've noticed that when I click the Stop button on the browser, or
   navigate to another page, jQuery.ajax calls the error event.

   You can see the problem live at:http://www.pingmyport.com/

   Code:

      this.getJson = function(timeout) {
         if(this.XMLHttpRequest) this.XMLHttpRequest.abort();
         this.XMLHttpRequest = $.ajax({
            complete: function(){$(#kitLoader).hide();},
            data: {
               Address: him.Address,
               portNum: him.portNum,
               portType: him.portType
            },
            dataType: json,
            error: him.serviceUnavailable,
            success: him.processJson,
            timeout: timeout,
            type: POST,
            url: http://www.pingmyport.com/checkPort.php;
         });
      };


[jQuery] Re: ajax xml question

2009-09-18 Thread David .Wu

it's not work actually.

On 9月18日, 下午6時19分, lanxiazhi lanxia...@gmail.com wrote:
 Now you will need to change the header:
 header('Content-Type: text/xml; charset=UTF-8');


[jQuery] Re: Ajax parsererror

2009-09-18 Thread nowotny

On 27 Lip, 17:07, TCoakley ebun...@gmail.com wrote:
 I was able to get this to work perfectly by removing the dataType. It
 ran my success function and parsed as XML. Is this a bug?

Hi... I also run into that problem and the solution was the page
you're requesting HAS to return a Content-type: text/xml header
otherwise it'll throw an error...

--
nowotny


[jQuery] Re: ajax xml question

2009-09-18 Thread lanxiazhi
you may request the a.php directly in the browser ,and see if the charactors
display correctly.
2009/9/18 David .Wu chan1...@gmail.com


 it's not work actually.

 On 9月18日, 下午6時19分, lanxiazhi lanxia...@gmail.com wrote:
  Now you will need to change the header:
  header('Content-Type: text/xml; charset=UTF-8');



[jQuery] Re: Paste an image into a tag...

2009-09-18 Thread lanxiazhi
I think this is not possible,because the browser won't let you access the
clipboard for security concerns.
but ,you may provide a facility,that can read image from an url given by the
user,and display it.also allow user to upload images.that would be enough.


[jQuery] Re: How do I extract a part of received data

2009-09-18 Thread lanxiazhi
this :
var elem = $('#section_news', data);
is not the right syntax.


[jQuery] Re: ID naming conventions and $.scrollTo()

2009-09-18 Thread lanxiazhi
--
What would be another
way of clearly identifying an object without the id?

you can specify almost any attribute to  identify a object.
like this:
div identify='!...@#$%^+_)(*'!...@#$%^+_)(*/div

and use
$([identif...@#$%^+_)(*])
to fetch the element!


[jQuery] load with callback confusion

2009-09-18 Thread geegler

How come this code doesn't work?

$(span#myinfo).mouseover(function(){
$(span#mycontent).load(mytext.txt,function(){
var soffset = $(this).offset();
var stop = soffset.top;
var ihgt = $(div#footer).css(height);
var mtop = $(div#mydiv).css(top);
var mhgt = $(div#mydiv).outerHeight() + 50;
var ntop = stop - mhgt;
$(div#mydiv).css(top,ntop);
$(div#mydiv).fadeIn(slow);
});
});

This version works but, I don't want to display the div element until
the small text file has completed loading.

$(span#myinfo).mouseover(function(){
$(span#mycontent).load(mytext.txt);
var soffset = $(this).offset();
var stop = soffset.top;
var ihgt = $(div#footer).css(height);
var mtop = $(div#mydiv).css(top);
var mhgt = $(div#mydiv).outerHeight() + 50;
var ntop = stop - mhgt;
$(div#mydiv).css(top,ntop);
$(div#mydiv).fadeIn(slow);
});


[jQuery] Re: Ajax - Access data arguments in callback

2009-09-18 Thread Peter Edwards


Hi there,

The only way I could find to do this with the $.get function was to 
parse out the query string - the success callback should get a copy of 
the options object which was used to set up the ajax request, but the 
data parameter is NULL in this object for GET requests (it is populated 
by the data parameters in POST requests however).


For example (using your example with a few changes):

$(function(){
 $('input:checkbox').click( function() {
   $.get('/ajax.php',{'nr': $(this).attr(id) }, function( data, 
textStatus ) {
 // this contains the options object used in the ajax request - 
this.data is null in GET requests

 // parse out the query string used for the request
 var qs = this.url.substr((this.url.indexOf(?)+1));
 var nvp = qs.split();
 // make an object which will hold the key/value pairs
 var params = {};
 for (var i = 0; i  nvp.length; i++) {
   var p = nvp[i].split(=);
   params[p[0]] = p[1];
 }
 $('#'+params.nr).attr(checked, checked);
   });
   return false;
 });
});








on 18/09/2009 08:53 Flamer said::

Thanks for your reply.

Does this not gives problems when I have an AJAX request with a
timeout after say 2 seconds, but in the meantime there's another
request using the same variable? Or is the sentData only accessible in
the click( function(){ } ) scope?

There is no other way of getting the data I sent with the request?

On 17 sep, 15:28, Nick Fitzsimons n...@nickfitz.co.uk wrote:
  

2009/9/17 Flamer mkapp...@gmail.com:







Hello,
  
Is it possible to access the data arguments that are sent with the

ajax function?
  
Example:

$('#mycheckbox').click( function() {
   $.get( '/ajax.php', { nr: this.id }, function( data, textStatus ) {
   // Here I want to access the arguments I just sent with ajax.php
  
   // As example, something like this:

   $('#'+arguments.nr).attr('checked', 'checked');
   } );
  
   return false;

} );
  

If I understand you correctly, then assigning your data object to a
variable which can be accessed via a closure in the callback function
would do it - something like:

$('#mycheckbox').click( function() {
   var sentData = { nr: this.id };
   $.get( '/ajax.php', sentData, function( data, textStatus ) {
   // Here I want to access the arguments I just sent with ajax.php

   // As example, something like this:
   $('#'+ sentData.nr).attr('checked', 'checked');
   } );

   return false;

} );

should be all you need.

Regards,

Nick.
--
Nick Fitzsimonshttp://www.nickfitz.co.uk/



  


[jQuery] Re: load with callback confusion

2009-09-18 Thread Dan G. Switzer, II
The second argument for the load() function is data, not callback:
http://docs.jquery.com/Ajax/load#urldatacallback

Do this instead:

 $(span#mycontent).load(mytext.txt, {}, function(){
  // callback code here
});

-Dan

On Fri, Sep 18, 2009 at 5:51 AM, geegler jkp_fb_st...@myvws.net wrote:


 How come this code doesn't work?

 $(span#myinfo).mouseover(function(){
$(span#mycontent).load(mytext.txt,function(){
var soffset = $(this).offset();
var stop = soffset.top;
var ihgt = $(div#footer).css(height);
var mtop = $(div#mydiv).css(top);
var mhgt = $(div#mydiv).outerHeight() + 50;
var ntop = stop - mhgt;
$(div#mydiv).css(top,ntop);
$(div#mydiv).fadeIn(slow);
});
 });

 This version works but, I don't want to display the div element until
 the small text file has completed loading.

 $(span#myinfo).mouseover(function(){
$(span#mycontent).load(mytext.txt);
var soffset = $(this).offset();
var stop = soffset.top;
var ihgt = $(div#footer).css(height);
var mtop = $(div#mydiv).css(top);
var mhgt = $(div#mydiv).outerHeight() + 50;
var ntop = stop - mhgt;
$(div#mydiv).css(top,ntop);
$(div#mydiv).fadeIn(slow);
 });



[jQuery] Re: JCarouselLite - pause scrolling

2009-09-18 Thread dudal

Hi Steffan

I had the same problem and came up with the following modification:
http://www.dudal.com/jquery/jquery.jcarousellite.pauseOnHover.js (not
minified)

Example config (notice pauseOnHover):
$('#selector').jCarouselLite({
auto: 2000,
speed: 1500,
visible: 1,
circular: true,
pauseOnHover: true
});

That ensures that the carousel will not advance when the mouse is over
the carousel.

I hope that helps.

Best
Jesper Dudal
Dudal Webdesign
http://www.dudal.com


On 7 Sep., 18:26, Steffan A. Cline stef...@hldns.com wrote:
 on 9/6/09 11:54 PM, Jonathan Vanherpe (T  T NV) at jonat...@tnt.be wrote:





  Steffan A. Cline wrote:
  on 8/28/09 5:37 PM, Steffan Cline at stef...@hldns.com wrote:

  I have a carousel that auto scrolls images. I was asked if there is a way 
  to
  make it so that if you mouse over the carousel, it stops and when you 
  mouse
  out, it starts up again.

  Is this possible?

  Anyone?

  Thanks

  Steffan

  The plain jcarousel has this option:
 http://sorgalla.com/projects/jcarousel/examples/static_auto.html

  Jonathan

 Thanks. I saw that option but I have already integrated theliteversion :(
 I hope the author of theliteversion speaks up.

 Thanks

 Steffan

 ---
 T E L  6 0 2 . 7 9 3 . 0 0 1 4 | F A X  6 0 2 . 9 7 1 . 1 6 9 4
 Steffan A. Cline  
 stef...@execuchoice.net                             Phoenix, 
 Azhttp://www.ExecuChoice.net                                 USA
 AIM : SteffanC          ICQ : 57234309
 YAHOO : Steffan_Cline   MSN : stef...@hldns.com
 GOOGLE: Steffan.Cline             Lasso Partner Alliance Member
 ---


[jQuery] cluetips only loads the first tip but not the rest

2009-09-18 Thread prince

This is what I have in the head:

script type=text/javascript
$(document).ready(function() {
  $('a.tip1').cluetip();
  $('a.tip2').cluetip();
  $('a.tip3').cluetip();
});
/script


In the body I have:

a class=tip1 href=# title=Host Team rel=mylink1.htmllearn
more/a
a class=tip2 href=# title=Host Team rel=mylink2.htmllearn
more/a
a class=tip3 href=# title=Host Team rel=mylink3.htmllearn
more/a

It only loads the first tip, if I switch tip2 to the top where tip1 is
in the head it only loads tip2. Not sure what's going on... thanks for
any help in advance!


[jQuery] Re: blockUI issue in IE8 (submitting patch)

2009-09-18 Thread Mike Alsup

 I am using blockUI(2.14) in one of my projects.

 A few days back, I upgraded to IE8 and the site stopped working. On
 debugging, I found the issue to be in blockUI plugin.

 Apparently, the reason seems to be that the plugin uses dynamic
 functions like setExpression which are not supported in IE8 (I am
 using 8.0.6001.18702).


This has already been fixed.  BlockUI is currently at version 2.26.
You can get the latest here:

http://www.malsup.com/jquery/block/#download

Mike


[jQuery] Re: cluetips only loads the first tip but not the rest

2009-09-18 Thread Karl Swedberg

That's really odd. I don't recall having run across that problem before.

I just tested it out and had no problem:

http://plugins.learningjquery.com/cluetip/demo-more/temp.html

--Karl


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




On Sep 18, 2009, at 8:37 AM, prince wrote:



This is what I have in the head:

script type=text/javascript
$(document).ready(function() {
 $('a.tip1').cluetip();
 $('a.tip2').cluetip();
 $('a.tip3').cluetip();
});
/script


In the body I have:

a class=tip1 href=# title=Host Team rel=mylink1.htmllearn
more/a
a class=tip2 href=# title=Host Team rel=mylink2.htmllearn
more/a
a class=tip3 href=# title=Host Team rel=mylink3.htmllearn
more/a

It only loads the first tip, if I switch tip2 to the top where tip1 is
in the head it only loads tip2. Not sure what's going on... thanks for
any help in advance!




[jQuery] Re: cluetips only loads the first tip but not the rest

2009-09-18 Thread prince

It is odd, I just tried in FF and it works fine, I've been testing in
Google Chrome and it's still not working there, may be cache issue. I
was driving myself crazy, thank you :-)


[jQuery] Re: Paste an image into a tag...

2009-09-18 Thread Peter Edwards

Have you thought of using a rich text editor to do this such as
TinyMCE and FCKEditor - they both have paste from clipboard
functionality

On Fri, Sep 18, 2009 at 11:12 AM, Hogsmill i...@hogsmill.com wrote:

 This may or may not be possible, but if anyone knows a way to do it,
 I'd love to hear from you.

 Basically, I simply (?) want to copy an image (e.g. from ALT-Print
 Screen or 'Copy Image'), and paste/drop it into an img tag on a page
 so it appears on the page. I can then resize, drag-drop, etc. as
 required.

 I've had a rummage around the net, but can't find anything. Maybe it's
 impossible?

 Cheers,

 Steve



[jQuery] Re: Paste an image into a tag...

2009-09-18 Thread Dan G. Switzer, II
It's been a while since I've looked at either TinyMCE or FCKEditor (now
CKEditor) but non of the WYSIWYG editors based on the browser can do what
Hogsmill wants.
In order to paste an image from the clipboard, you'll need something that
can also upload the image to the server on the paste operation.

The product I've used in the past to accomplish this is XStandard--which
comes as either a Firefox add-on and an ActiveX control for IE. It does
require an client installation, but it's a very powerful XHTML-based editor
and works really well for us.

The images are uploaded to the server via a web service on the paste
operation--it even handles multiple images in the clipboard. We choose
XStandard, because users could copy an entire Word document into the
clipboard with multiple images and simply paste it into the XStandard editor
and the content would get pasted complete with all the images in the Word
document.

There are some Java-based rich text editor controls I found too, but they
were all much more expensive.

Also, if you *only* care about pasting a single image (and don't really need
the whole rich text portion) you could write a signed Java applet to do
this. For our help desk application, I wrote a signed Java applet that would
either take the screenshot for the user or allow pasting an image from the
clipboard to add as an attachment. I can't share the code, but it's
relatively straightforward (the biggest issue is handling clipboard
operations on the Mac.)

-Dan

On Fri, Sep 18, 2009 at 9:22 AM, Peter Edwards p...@bjorsq.net wrote:


 Have you thought of using a rich text editor to do this such as
 TinyMCE and FCKEditor - they both have paste from clipboard
 functionality

 On Fri, Sep 18, 2009 at 11:12 AM, Hogsmill i...@hogsmill.com wrote:
 
  This may or may not be possible, but if anyone knows a way to do it,
  I'd love to hear from you.
 
  Basically, I simply (?) want to copy an image (e.g. from ALT-Print
  Screen or 'Copy Image'), and paste/drop it into an img tag on a page
  so it appears on the page. I can then resize, drag-drop, etc. as
  required.
 
  I've had a rummage around the net, but can't find anything. Maybe it's
  impossible?
 
  Cheers,
 
  Steve
 



[jQuery] Re: JCarouselLite - pause scrolling

2009-09-18 Thread Steffan A. Cline

on 9/18/09 5:30 AM, dudal at jes...@dudal.com wrote:

 
 Hi Steffan
 
 I had the same problem and came up with the following modification:
 http://www.dudal.com/jquery/jquery.jcarousellite.pauseOnHover.js (not
 minified)
 
 Example config (notice pauseOnHover):
 $('#selector').jCarouselLite({
 auto: 2000,
 speed: 1500,
 visible: 1,
 circular: true,
 pauseOnHover: true
 });
 
 That ensures that the carousel will not advance when the mouse is over
 the carousel.
 
 I hope that helps.

Yes, it does. Awesome! I tried to get a hold of the author to ask about this
but he didn't answer the email. It would be nice to see your changes
committed to this project.

Thanks!!


 
 Best
 Jesper Dudal
 Dudal Webdesign
 http://www.dudal.com
 
 
 On 7 Sep., 18:26, Steffan A. Cline stef...@hldns.com wrote:
 on 9/6/09 11:54 PM, Jonathan Vanherpe (T  T NV) at jonat...@tnt.be wrote:
 
 
 
 
 
 Steffan A. Cline wrote:
 on 8/28/09 5:37 PM, Steffan Cline at stef...@hldns.com wrote:
 
 I have a carousel that auto scrolls images. I was asked if there is a way
 to
 make it so that if you mouse over the carousel, it stops and when you
 mouse
 out, it starts up again.
 
 Is this possible?
 
 Anyone?
 
 Thanks
 
 Steffan
 
 The plain jcarousel has this option:
 http://sorgalla.com/projects/jcarousel/examples/static_auto.html
 
 Jonathan
 
 Thanks. I saw that option but I have already integrated theliteversion :(
 I hope the author of theliteversion speaks up.
 
 Thanks
 
 Steffan
 


Thanks

Steffan




[jQuery] Re: How do I extract a part of received data

2009-09-18 Thread Frederik

Wrong syntax?  Please explain.

I try to use this instruction found on http://www.visualjquery.com/:
jQuery(expression, context)

 The core functionality of jQuery centers around this function. Everything in 
 jQuery is based upon this, or uses this in some way. The most basic use of 
 this function is to pass in an expression (usually consisting of CSS), which 
 then finds all matching elements.

 By default, if no context is specified, $() looks for DOM elements within the 
 context of the current HTML document. If you do specify a context, such as a 
 DOM element or jQuery object, the expression will be matched against the 
 contents of that context

 Example

 Finds all div elements within an XML document from an AJAX response.
 jQuery Code

 $(div, xml.responseXML);


Please do not tell me this is because this is for XML data only. I
read Ajax request may return HTML data and will process it as well.
In fact, I already use $get() (an AJAX calling function) that return
HTML.



On Sep 18, 8:07 am, lanxiazhi lanxia...@gmail.com wrote:
 this :
 var elem = $('#section_news', data);
 is not the right syntax.


[jQuery] Re: blockUI issue in IE8 (submitting patch)

2009-09-18 Thread Viraj Kanwade

Thank you Mike.

I downloaded the plugin from plugins.jquery.com

The available release there is 2.14.

Hence the confusion and wasted effort :(

Thank you for the plugin. Upgraded it and it works fine.

Regards,
Viraj

On Sep 18, 5:45 pm, Mike Alsup mal...@gmail.com wrote:
  I am using blockUI(2.14) in one of my projects.

  A few days back, I upgraded to IE8 and the site stopped working. On
  debugging, I found the issue to be in blockUI plugin.

  Apparently, the reason seems to be that the plugin uses dynamic
  functions like setExpression which are not supported in IE8 (I am
  using 8.0.6001.18702).

 This has already been fixed.  BlockUI is currently at version 2.26.
 You can get the latest here:

 http://www.malsup.com/jquery/block/#download

 Mike


[jQuery] getJson Request Header Accept always */*

2009-09-18 Thread vind

I am trying to use getJson to get json response from a remote site,
the remote site expects Accept : application/json.
Some how all my requests when observed using firebug shows Accept : */
*
I also tried the exmaple http://docs.jquery.com/Ajax/jQuery.getJSON
Although it returns json data , but the Accept is still */* , I
believe this would be because of format=json param in the above
example

I am using JQuery 1.3.2

How can i make getJson to pass Accept : application/json Request
Header

Thanks


[jQuery] Using append() - each element or string of HTML?

2009-09-18 Thread Kaitlyn

Just wondering from an efficiency standpoint:

I am building a widget out of javascript and so there is a lot of
HTML. Am I better off creating it as a string, then append() it into
the document, or should I build the widget itself using append() and
other related helper functions?


[jQuery] Re: JCarouselLite - pause scrolling

2009-09-18 Thread dudal

Hey Steffan

I'm glad you like it. I used to go with the full carousel version
just for this feature, but then I looked into the code and found that
it could be acomplished using only 3 lines of code or so. I posted it
on Ganeshjis website hoping that he will include it in his official
release.

/Jesper

On 18 Sep., 15:42, Steffan A. Cline stef...@hldns.com wrote:
 on 9/18/09 5:30 AM,dudalat jes...@dudal.com wrote:





  Hi Steffan

  I had the same problem and came up with the following modification:
 http://www.dudal.com/jquery/jquery.jcarousellite.pauseOnHover.js(not
  minified)

  Example config (notice pauseOnHover):
  $('#selector').jCarouselLite({
  auto: 2000,
  speed: 1500,
  visible: 1,
  circular: true,
  pauseOnHover: true
  });

  That ensures that the carousel will not advance when the mouse is over
  the carousel.

  I hope that helps.

 Yes, it does. Awesome! I tried to get a hold of the author to ask about this
 but he didn't answer the email. It would be nice to see your changes
 committed to this project.

 Thanks!!



  Best
  JesperDudal
 DudalWebdesign
 http://www.dudal.com

  On 7 Sep., 18:26, Steffan A. Cline stef...@hldns.com wrote:
  on 9/6/09 11:54 PM, Jonathan Vanherpe (T  T NV) at jonat...@tnt.be wrote:

  Steffan A. Cline wrote:
  on 8/28/09 5:37 PM, Steffan Cline at stef...@hldns.com wrote:

  I have a carousel that auto scrolls images. I was asked if there is a 
  way
  to
  make it so that if you mouse over the carousel, it stops and when you
  mouse
  out, it starts up again.

  Is this possible?

  Anyone?

  Thanks

  Steffan

  The plain jcarousel has this option:
 http://sorgalla.com/projects/jcarousel/examples/static_auto.html

  Jonathan

  Thanks. I saw that option but I have already integrated theliteversion :(
  I hope the author of theliteversion speaks up.

  Thanks

  Steffan

 Thanks

 Steffan


[jQuery] Re: blockUI issue in IE8 (submitting patch)

2009-09-18 Thread Mike Alsup

 I downloaded the plugin from plugins.jquery.com

 The available release there is 2.14.

 Hence the confusion and wasted effort :(

 Thank you for the plugin. Upgraded it and it works fine.


Sorry about the wasted effort, Viraj.  I thought I had updated that
page long ago, but apparently I did not.

Mike


[jQuery] Unable to manipulate List Items

2009-09-18 Thread dblaszczyk

For some reason when I dynamically create an unordered list I am
unable to get at it through the DOM right away. Here is my code:

var buildNavi = function(){
 var naviTemplate ='li class=preva href=#
title=PreviousPrevious/a/li/lili class=nexta href=#
title=NextNext/a/li';
 var naviCont = $(ul/ul)
 .css({'position' : 'absolute', 'top' : gHeight-50})
 .append(naviTemplate);
 gCont.append(naviCont);
 $(li.next a).click(function(){
  nextPage();
 });
 $(li.prev a).click(function(){
  prevPage();
 });
};

var buildGallery = function(){
 $(gCont).empty();
 var initialNum = randPerPage;
 var galUL = $(ul/ul)
 .addClass(gallery)
 .css({'overflow' : 'hidden', 'height' : contHeight, 'width' :
contWidth});
 gCont.css('overflow', 'hidden').append(galUL);
 $.get(settings.srcURL,
  {'Media' : settings.media},
  function (data){
   $(data).find(ThumbSrc).each(function(i){
var srcVal = $(this).text();
$('img').attr('src', srcVal)
.css({'margin' : iMargin})
.load(function(){
   $(li/li)
   .addClass(galleryThumb)
   .append($(this))
   .css({'left' : 0, 'top' : 0, 'position' : 'absolute'})
   .appendTo(galUL);
 })
 .hide(0,loadFirstPage(i));
   });
  });

  buildNavi();
 };

 var loadFirstPage = function(itemNum){
  if(itemNum=startPage){
 var imgWidth = $('ul.gallery li:eq('+itemNum+') img').width
();
 var imgHeight = $('ul.gallery li:eq('+itemNum+') img').height
();
 var setLeft = $.randomBetween(0,(gWidth-imgWidth));
 var setTop = $.randomBetween(0,(gHeight-imgHeight));

 $('ul.gallery li:eq('+itemNum+') img').fadeIn('slow');
 $('ul.gallery li:eq('+itemNum+')').show().animate({left :
setLeft,
 top : setTop, opacity : 'toggle'}, 'slow');
  }
 };

 buildGallery();

Is there someway to make sure that the UL is completely built up with
the images in place before running my loadFirstPage function?


[jQuery] Powerfull WYSIWYG editor with upload image capability

2009-09-18 Thread Rama Vadakattu

Can any one please recommend a powerful WYSIWYG (commercial/open
source) editor  which has a image upload capability.

I have been looking for it since morning but could not able to find
it.
I found CKeditor+CKFinder , but CKFinder is not available in  django/
python language. I tried to port to django but encountered several
problems.




--rama


[jQuery] Re: Powerfull WYSIWYG editor with upload image capability

2009-09-18 Thread Donny Kurnia


Rama Vadakattu wrote:

Can any one please recommend a powerful WYSIWYG (commercial/open
source) editor  which has a image upload capability.

I have been looking for it since morning but could not able to find
it.
I found CKeditor+CKFinder , but CKFinder is not available in  django/
python language. I tried to port to django but encountered several
problems.




--rama


You can use it in full javascript, it should be run regardless your 
backend language (PHP, Pythun, Ruby). You can even run it in html file.


--
Donny Kurnia
http://blog.abifathir.com
http://hantulab.blogspot.com
http://www.plurk.com/user/donnykurnia


[jQuery] Re: Browser sniffing - the correct way?

2009-09-18 Thread ryan.j

 comes to supporting CSS correctly. What exactly do you mean by
 negative vertical span margins?

i'd hazard a guess he meant something along the lines of...

span { margin: -12px 0 0 0; }

On Sep 17, 3:18 pm, Nick Fitzsimons n...@nickfitz.co.uk wrote:
 2009/9/17 ldexterldesign m...@ldexterldesign.co.uk:



  Thanks for your responses guys. I actually need to detect the Opera
  browser and serve up a load of new CSS. Opera doesn't support negative
  vertical span margins, so I'm gonna have to reduce the font-size of
  some text.

 As a general rule, Opera is one of the most reliable browsers when it
 comes to supporting CSS correctly. What exactly do you mean by
 negative vertical span margins? Whatever it is, if it's something
 that can reasonably be expected to work cross-browser (in that it is
 valid according to the relevant web standards, rather than relying on
 undefined behaviour in a few browsers) then I'd be extremely surprised
 to find that Opera didn't support it.

 If you can explain what you're trying to do I would imagine somebody
 can help. Hacks and browser-specific code should always be avoided
 except as an absolute last resort.

 Regards,

 Nick.
 --
 Nick Fitzsimonshttp://www.nickfitz.co.uk/


[jQuery] Re: Powerfull WYSIWYG editor with upload image capability

2009-09-18 Thread Rama Vadakattu

 you can't run CKFinder without a backend server.
http://ckfinder.com/download

Where do you store uploaded photos?
You need to store those photos at the server via back end language.

On Sep 18, 8:19 pm, Donny Kurnia donnykur...@gmail.com wrote:
 Rama Vadakattu wrote:
  Can any one please recommend a powerful WYSIWYG (commercial/open
  source) editor  which has a image upload capability.

  I have been looking for it since morning but could not able to find
  it.
  I found CKeditor+CKFinder , but CKFinder is not available in  django/
  python language. I tried to port to django but encountered several
  problems.

  --rama

 You can use it in full javascript, it should be run regardless your
 backend language (PHP, Pythun, Ruby). You can even run it in html file.

 --
 Donny 
 Kurniahttp://blog.abifathir.comhttp://hantulab.blogspot.comhttp://www.plurk.com/user/donnykurnia


[jQuery] Re: Browser sniffing - the correct way?

2009-09-18 Thread Brett Ritter

On Thu, Sep 17, 2009 at 9:53 AM, ldexterldesign
m...@ldexterldesign.co.uk wrote:
 browser and serve up a load of new CSS. Opera doesn't support negative
 vertical span margins, so I'm gonna have to reduce the font-size of
 some text.

And there you have a focus: You don't want to detect Opera, you want
to detect whether a browser supports negative vertical span margins.

I don't know which clause will do that :), but that's what you're
looking to do. That way your code will continue to work as desired in
the future when Opera address this issue and/or when another browser
displays the same issue.

-- 
Brett Ritter / SwiftOne
swift...@swiftone.org


[jQuery] Re: Browser sniffing - the correct way?

2009-09-18 Thread Nick Fitzsimons

2009/9/18 ryan.j ryan.joyce...@googlemail.com:

 comes to supporting CSS correctly. What exactly do you mean by
 negative vertical span margins?

 i'd hazard a guess he meant something along the lines of...

 span { margin: -12px 0 0 0; }


That's what was confusing me. Opera handles negative margins perfectly
well and has done for years - the only browser I'm aware of that can
have major problems with them is IE6 (and possibly 7).

-- 
Nick Fitzsimons
http://www.nickfitz.co.uk/


[jQuery] Re: href value

2009-09-18 Thread Rick Pasotto

On Thu, Sep 17, 2009 at 12:56:01PM -0400, brian wrote:
 
 Are you sure that this.href is not complete? I suspect it is and that
 the problem is that you're appending a URL that contains a query
 string to another query string. So, the various params are being mixed
 up with each other. You should urlencode the href before appending it
 as a query string.

While there are javascript functions to simulate php's urlencode I found
a better solution. The additional parameters were being placed each in
its own $_GET[] element. The solution was to loop through the $_GET
array and add each element to the initial url.

 On Thu, Sep 17, 2009 at 11:21 AM, Rick Pasotto r...@niof.net wrote:
 
  I have the following function defined:
 
  $(function () {
     $('a[href*=http:]').click(function() {
         open('/redirect.php?where=' + this.href); return false;
     });
  });
 
  When the href has only one GET parameter it works as expected however
  when there is more than one GET parameter it passes only the first.
 
  In other words, the following link:
 
  a 
  href=http://spreadsheets.google.com/viewform?hl=enamp;formkey=dDVlOFk2cGlpSmR1Vl8zWWZaY0oxOGc6MA;
  this form/a
 
  will pass only 'http://spreadsheets.google.com/viewform?hl=en' to my
  redirect.php script.
 
  I suspect it's a quoting problem. How do I get all the GET parameters to
  be treated as a single string?
 
  --
  Take a chance! All life is a chance. The man who goes farthest is
   generally the one who is willing to do and dare. -- Dale Carnegie
     Rick Pasotto    r...@niof.net    http://www.niof.net
 

-- 
We can hardly exert direct action on the energy and frugality of
our fellow men, except through public opinion, through an
intelligent expression of our likes and our dislikes. But we can
do a great deal for the creation of security, without which
capital, far from expanding, goes into hiding, takes flight, or is
destroyed; and consequently we see how almost suicidal is the
ardour for disturbing the public peace that the working classes
sometimes display. They must learn that capital has from the
beginning of time worked to free men from the yoke of ignorance,
want and tyranny. To frighten away capital is to rivet a triple
chain around the arms of the human race.
-- Frédéric Bastiat (1801-1850)
Rick Pasottor...@niof.nethttp://www.niof.net


[jQuery] Re: load with callback confusion

2009-09-18 Thread Michael Geary
The data parameter is optional (note the very faint square brackets around
it on the doc page), so that isn't the problem.

The problem, as it is so often, is 'this':

var soffset = $(this).offset();

In the working code, 'this' is the #myinfo element.

In the broken code, 'this' is the #mycontent element.

There are several ways to solve that. Here is one solution, along with a bit
of code simplification:

var $myinfo = $(#myinfo);
$myinfo.mouseover(function(){
   $(#mycontent).load(mytext.txt,function(){
   var stop = $myinfo.offset().top;
   var ihgt = $(#footer).css(height);
   var $mydiv = $(#mydiv);
   var mhgt = $mydiv.outerHeight() + 50;
   var ntop = stop - mhgt;
   $mydiv.css(top,ntop).fadeIn(slow);
   });
});

-Mike

On Fri, Sep 18, 2009 at 5:37 AM, Dan G. Switzer, II dswit...@pengoworks.com
 wrote:

 The second argument for the load() function is data, not callback:
 http://docs.jquery.com/Ajax/load#urldatacallback

 Do this instead:

  $(span#mycontent).load(mytext.txt, {}, function(){
// callback code here
 });

 -Dan

 On Fri, Sep 18, 2009 at 5:51 AM, geegler jkp_fb_st...@myvws.net wrote:


 How come this code doesn't work?

 $(span#myinfo).mouseover(function(){
$(span#mycontent).load(mytext.txt,function(){
var soffset = $(this).offset();
var stop = soffset.top;
var ihgt = $(div#footer).css(height);
var mtop = $(div#mydiv).css(top);
var mhgt = $(div#mydiv).outerHeight() + 50;
var ntop = stop - mhgt;
$(div#mydiv).css(top,ntop);
$(div#mydiv).fadeIn(slow);
});
 });

 This version works but, I don't want to display the div element until
 the small text file has completed loading.

 $(span#myinfo).mouseover(function(){
$(span#mycontent).load(mytext.txt);
var soffset = $(this).offset();
var stop = soffset.top;
var ihgt = $(div#footer).css(height);
var mtop = $(div#mydiv).css(top);
var mhgt = $(div#mydiv).outerHeight() + 50;
var ntop = stop - mhgt;
$(div#mydiv).css(top,ntop);
$(div#mydiv).fadeIn(slow);
 });





[jQuery] Re: get the hover color of a link

2009-09-18 Thread Dale Larsen

Okay I still see the problem with that.

I need to get the color without currently hovering over it.

I did a test where I set an onclick event to return the color of the
link.
It returns the hover color when your mouse is over but not when you
don't.

script type=text/javascript
$('.testMe a').click(function(){
alert($(this).css('color'));
});
$('.testMe a').click();
/script
style type=text/css
.testMe a:hover{
color:#FF6633;
}
/style
div class=testMe
aW3Schools 2/a
/div


On Sep 2, 4:57 pm, Dale Larsen dalelarse...@gmail.com wrote:
 Well, it works. I am not sure why my first implementation wasn't
 working.

 Thank you for your help!

 Kind regards,
 Dale Larsen

 On Aug 25, 6:04 am, Satyakaran satyaka...@gmail.com wrote:

  I think you need to change your approach.
  :hover is not set-able by jquery .

  I tried this

  script

  function hover1() {

  var h = $(':hover', '.test');

  $.each(
  h,
  function( intIndex, intVal ){
            alert($(this).css('color'))
          }
  )

  }

  /script

  div class=test
  a href='http://www.w3schools.com/'onclick=alert($('.test
  a:hover').css('color'));return false;W3Schools1/a
  a href='http://www.w3schools.com/'onclick=alert($('a:hover').css
  ('color'));return false;W3Schools2/a

  a href='http://www.w3schools.com/'onclick=javascript:hover1
  ();return false;W3Schools3/a
  /div

  Here on link 1 and  2 , I am getting the right output but not through
  a function I have tried in 3 link.

  On Aug 25, 4:57 am, Dale Larsen dalelarse...@gmail.com wrote:

   I need to get the css hover color of an element. Since hover is a
   pseudo class of a class or id, I do not see a way of returning the
   color.

   I tried:

   $('.contentArea a:hover').css('color');

   but it does not return the hover color.

   I understand that jQuery probably traverses the inline styles and
   there is no way to set the hover  pseudo class inline, hence the
   reason for the .hover function.

   Is it possible to find and return the hover color with jQuery. If so
   how?


[jQuery] Problem Clicking a next link

2009-09-18 Thread Chris Bennett

Hi,

I'm trying to add some keyboard navigation to an existing page.

The page has links one for 'Next' and one for 'Previous'

I've already gotten the keypress bits working properly, my next
problem is the .click() method.

Here's the code called by the keypresses:

$(a:contains('Previous')).click();
$(a:contains('Next')).click();

This returns no error code, although firefox does generate the
following warning:
Warning: Unknown pseudo-class or pseudo-element 'contains'.


[jQuery] re: 'gray dots' in jquery carousel

2009-09-18 Thread nick mander...

I've looked through all the 'better' tutorials online, and I've even
found other users trying to replicate what cnn.com had done with the
top right module titled 'video'.

All I really need the carousel to do is display the dots and not any
numbers or arrows, but all of my attempts have caused failure and
crashing of Safari (lord only knows).

Any insight or example using ANY existing carousels, as this has yet
to be implemented, would be ridiculously appreciated.

Thank you


[jQuery] Clear selection of text on ul element

2009-09-18 Thread googleuser

Hello,
I am trying to get/set only text  of list only element text value.
But for some reason I can not select it in clear way.

List something like:

ul
li id=myid  Here text that I want to modify
ul
li id=dfdfi don't want modify this/li
li id=dfdfi don't want modify this/li
/ul
/li
ul

Any suggestion?

Thanks in advance.


[jQuery] Re: Datepicker and Jquery updating the value of pulldown menu

2009-09-18 Thread Sean McKenna

updating the values of the pulldown menu ounce the user have choosen
a date from the Jquery datepicker

Something like this should work

in the datepicker include

onSelect: updateLinked

then (change as needed for your pull down ids)

// Update three select controls to match a date picker selection
// But need to get rid of leading zero on day and month first
function updateLinked(t_date) {
  var s_mo = t_date.substring(0, 1);
  if (s_mo == '0') {
   $('#month').val(t_date.substring(1, 2));
}
else {
 $('#month').val(t_date.substring(0, 2));
}
var s_day = t_date.substring(3,4);
if (s_day == '0') {
 $('#day').val(t_date.substring(4, 5));
}
else {
 $('#day').val(t_date.substring(3, 5));
}
$('#year').val(t_date.substring(6, 10));
}



On Sep 18, 3:21 am, pennfoli0 pennfo...@gmail.com wrote:
 Hi,
 I need help adding the jquery date picker to my existing code, but
 not
 reconstructing the whole HTML file.

 my code,
     !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 /
     titlecalenar/title
         script src=http://ajax.googleapis.com/ajax/libs/jquery/
 1.3.2/
 jquery.min.js type=text/javascript charset=utf-8/script
         script src=http://ajax.googleapis.com/ajax/libs/jqueryui/
 1.7.2/jquery-ui.min.js type=text/javascript charset=utf-8/
 script
     script type=text/javascript
         $(function(){
             // #datepickers
             $(#datepicker).datepicker({showOn: 'button',
 buttonImage: 'images/calendar.gif', buttonImageOnly: true});
         });
     /script
     /head
     body
     pDepart:/p
     table cellpadding=2 cellspacing=0 border=0
       tr
         tdselect name=departureMonth
 onchange=javascript:dmddChange
 (document.hotForm.departureMonth,document.hotForm.departureDay);
           option value=0January/option
           option value=1February/option
           option value=2March/option
           option value=3April/option
           option value=4May/option
           option value=5June/option
           option value=6July/option
           option value=7August/option
           option value=8September/option
           option value=9October/option
           option value=10November/option
           option value=11December/option
         /select/td
         tdselect name=departureDay onchange=dmddChange
 (document.hotForm.departureMonth,document.hotForm.departureDay)
           option value=11/option
           option value=22/option
           option value=33/option
           option value=44/option
           option value=55/option
           option value=66/option
           option value=77/option
           option value=88/option
           option value=99/option
           option value=1010/option
           option value=/option
           option value=1212/option
           option value=1313/option
           option value=1414/option
           option value=1515/option
           option value=1616/option
           option value=1717/option
           option value=1818/option
           option value=1919/option
           option value=2020/option
           option value=2121/option
           option value=/option
           option value=2323/option
           option value=2424/option
           option value=2525/option
           option value=2626/option
           option value=27 selected=selected27/option
           option value=2828/option
           option value=2929/option
           option value=3030/option
           option value=3131/option
         /select/td
         tda href=javascript:openCalendar('hotForm',
 'departure');img src=http://affiliate.travelnow.com/
 searchboximages/blueFormCalendar.gif border=0//a/td
       /tr
     /table
     pGoing to:/p
     table cellpadding=2 cellspacing=0 border=0
       tr
         tdselect name=departureMonth
 onchange=javascript:dmddChange
 (document.hotForm.departureMonth,document.hotForm.departureDay);
           option value=0January/option
           option value=1February/option
           option value=2March/option
           option value=3April/option
           option value=4May/option
           option value=5June/option
           option value=6July/option
           option value=7August/option
           option value=8September/option
           option value=9October/option
           option value=10November/option
           option value=11December/option
         /select/td
         tdselect name=departureDay onchange=dmddChange
 (document.hotForm.departureMonth,document.hotForm.departureDay)
           option value=11/option
           option value=22/option
           option value=33/option
           option value=44/option
           option 

[jQuery] Re: Browser sniffing - the correct way?

2009-09-18 Thread ldexterldesign

Yes - you're bang on. Well observed ;]

L

On Sep 18, 4:47 pm, ryan.j ryan.joyce...@googlemail.com wrote:
  comes to supporting CSS correctly. What exactly do you mean by
  negative vertical span margins?

 i'd hazard a guess he meant something along the lines of...

 span { margin: -12px 0 0 0; }

 On Sep 17, 3:18 pm, Nick Fitzsimons n...@nickfitz.co.uk wrote:

  2009/9/17 ldexterldesign m...@ldexterldesign.co.uk:

   Thanks for your responses guys. I actually need to detect the Opera
   browser and serve up a load of new CSS. Opera doesn't support negative
   vertical span margins, so I'm gonna have to reduce the font-size of
   some text.

  As a general rule, Opera is one of the most reliable browsers when it
  comes to supporting CSS correctly. What exactly do you mean by
  negative vertical span margins? Whatever it is, if it's something
  that can reasonably be expected to work cross-browser (in that it is
  valid according to the relevant web standards, rather than relying on
  undefined behaviour in a few browsers) then I'd be extremely surprised
  to find that Opera didn't support it.

  If you can explain what you're trying to do I would imagine somebody
  can help. Hacks and browser-specific code should always be avoided
  except as an absolute last resort.

  Regards,

  Nick.
  --
  Nick Fitzsimonshttp://www.nickfitz.co.uk/


[jQuery] Re: Browser sniffing - the correct way?

2009-09-18 Thread ldexterldesign

So the question is: how would I detect this? Can this be achieved with
jQuery as part of the .support function? (Sorry, the documentation at:
http://docs.jquery.com/Utilities/jQuery.support still leaves me what
to do with this function, as there are no examples :Z ).

Thanks,
L

On Sep 18, 5:01 pm, Brett Ritter swift...@swiftone.org wrote:
 On Thu, Sep 17, 2009 at 9:53 AM, ldexterldesign

 m...@ldexterldesign.co.uk wrote:
  browser and serve up a load of new CSS. Opera doesn't support negative
  vertical span margins, so I'm gonna have to reduce the font-size of
  some text.

 And there you have a focus: You don't want to detect Opera, you want
 to detect whether a browser supports negative vertical span margins.

 I don't know which clause will do that :), but that's what you're
 looking to do. That way your code will continue to work as desired in
 the future when Opera address this issue and/or when another browser
 displays the same issue.

 --
 Brett Ritter / SwiftOne
 swift...@swiftone.org


[jQuery] Jcarousel textscroller not displaying google reader feed link

2009-09-18 Thread pdxgeek

I'm trying to get  jcarousel to display a google reader feed that
aggregates several feeds into a category label, but it's not working
correctly.  I thought it had something to do with the URL encoding of
the link because the script works fine with other single feed links.
Any help greatly appreciated.

here's the sample format of a google reader link I'm referring to:

http://www.google.com/reader/public/atom/user%2F08980196621418069260%2Flabel%2Fweb%3A%20ux

the scrip works fine with single/normal feed links though, like the
following:
http://feeds.feedburner.com/adaptivepath


[jQuery] Re: MultiFile plugin taking no parameters

2009-09-18 Thread leofromrio


I am having the same exact problem but I can't find the answer anywhere.
Have you found a solution?
-- 
View this message in context: 
http://www.nabble.com/MultiFile-plugin-taking-no-parameters-tp23823347s27240p25513614.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: how to query for words with special (UTF-8 encoded) characters?

2009-09-18 Thread Dark

Hi:

If you're still interested in the solution of the autocomplete
encoding, I suggest you to visit this link:

http://www.autonecrologia.net/?p=422

My English isn't very well but I think you understand me

Bye

On 25 ago, 07:41, Adriano Varoli Piazza mora...@gmail.com wrote:
 On 24 ago, 17:46, Adriano Varoli Piazza mora...@gmail.com wrote:

  I'd like to bump this up. I'm trying to implement a dynamic form, and
  I need to query for words containing (in this particular case) ñ.

  Example:
  I want to query for the city 'Añatuya'.
  - typing in 'aña' doesn't find it.
  - typing in 'ana' displays the word, but without the 'aña' sequence
  highlighted. (other returned strings that do contain 'ana' are
  properly highlighted).

  - firebug tells me the query string sent 
  ishttp://localhost/alabern/autocomplete/prov.php?q=a%C3%B1alimit=1000;...

 I was able to solve this simply by using utf8_decode() (php here, if
 you didn't notice) on the q string passed to the action. Simpler than
 it appeared.

 --
 Saludos
 Adriano


[jQuery] cluetip with dynamic data from textarea

2009-09-18 Thread Margie

I am using the cluetip plugin to show a formatted version of text that
the user types into a text area.  So I have a textarea
id=description, and as the user types, they can at any time click a
preview button will call cluetip to display the popup.  Here is my
current cluetip call:

$('#id_preview_link').cluetip(
 {
   ajaxSettings: {dataType:'html',
  type:'POST',
  data:{'markup':$('#id_description')}
 }
 }
)

When I click my preview button to activate the clutip, the post data
that is sent is whatever was in #id_description at the type the cluetip
() code above was executed.  IE, it doesn't post the current value
that's in #id_description.

Can anyone tell me how to make the activation of the cluetip send the
current text that is in my #id_description field?

Thanks very much,

Margie


[jQuery] event.currentTarget with table rows and IE7

2009-09-18 Thread Philipp

Hi,

I got a problem using the following code:

$j = jQuery.noConflict();
$j(document).ready(function(){
$j('tr').mouseover(function(event) {
if (!event.currentTarget) {
alert('current target not given!');
return false;
}
alert(event.currentTarget.id);
});
});

When hovering a table data (td) element in Firefox everything works
fine: The id value of the row is displayed. In IE7 my error message is
displayed.

I would appreciate any ideas which would solve this problem.
Kind regards
 Philipp


[jQuery] jQuery Countdown help

2009-09-18 Thread Jason

I am attempting to use the jQuery Countdown plugin from
http://keith-wood.name/countdown.html, and i'm having trouble setting
the values to count down until. Any guidance would be greatly
appreciated.


$(function () {
var austDay = new Date();
austDay = new Date(austDay.getFullYear() + 1, 1 - 1, 26);
$('#count').countdown({until: austDay, layout: '{dn} {dl}, {hn} {hl},
{mn} {ml}, and {sn} {sl}'});
$('#year').text(austDay.getFullYear());
});


Cheers,
Jason


[jQuery] IE8 incorrect left positioning

2009-09-18 Thread Falcon

Hey all.

I found an interesting bug in IE8 today. See http://gomaroon.missouristate.edu
for an example.

We're animating a very wide div (for example, click on the Digital
wallpaper section, and there's a div with an id of
NormalWallpaperContainer that includes thumbnails of wallpapers).
The problem in IE8 is that the left positioning starts creeping off by
one pixel on each click after the second click, but only when IE is
maximized.

For example, if you're on the Desktop (Normal) category, once you
click to the right twice, the left property of the CSS on that div
should be -510px. In IE8, the animate function tries to set left to
-510, but IE sets itself to -509. Directly calling .css
(left,-510px) or .css(left,-510) both result in IE8 setting left
to -509px (and jQuery's position function returns that value as well).
Also, trying to do a direct set through JavaScript results in -509px
as well. Only when -511 is passed in will IE8 set itself correctly to
-510. Firefox, Safari, Chrome, Opera, etc. all exhibit the correct
behavior.

I'm working around this problem just fine (setting left to the desired
position - 1 when the position is incorrect), but thought this might
be something jQuery could compensate for in the future. Perhaps some
of you have some insight into this!

Thanks!


[jQuery] Quicksearch

2009-09-18 Thread Charlie

I am trying to use quicksearch on tables that have input boxes in each
of the table td and have found that the quicksearch does not
search the values of each of those input boxes.  Does anyone know a
way to get quicksearch to include the input boxes?

Thanks


[jQuery] How do you make text selectable when using IE browser?

2009-09-18 Thread amtames

Hi,

We recently had our site redeveloped by a professional firm. We
originally requested that users not be able to copy and paste text
from our site. This has created an outcry and we would like to have
text be selectable. I see that they achieved this by using jquery
which I am not familiar. I believe that I have found the snippet of
code that turns this ability off/on but I do not know how to write the
correct code to allow selection of text. This is an IE specific issue,
not a problem in Firefox.

I have done some investigation online and found this:

http://dev.jqueryui.com/ticket/4773

It looks cut and dry but placing this solution in the js file does
nothing.  Can you provide guidance on this issue?

Thanks!


[jQuery] Re: jQuery Countdown help

2009-09-18 Thread MorningZ

Any indication with what the error/is other than having trouble?

I've been using coding with this plugin the past few days and haven't
had any issue setting that date



On Sep 18, 4:12 pm, Jason stonesoupandboiledfr...@gmail.com wrote:
 I am attempting to use the jQuery Countdown plugin 
 fromhttp://keith-wood.name/countdown.html, and i'm having trouble setting
 the values to count down until. Any guidance would be greatly
 appreciated.

 $(function () {
         var austDay = new Date();
         austDay = new Date(austDay.getFullYear() + 1, 1 - 1, 26);
         $('#count').countdown({until: austDay, layout: '{dn} {dl}, {hn} {hl},
 {mn} {ml}, and {sn} {sl}'});
         $('#year').text(austDay.getFullYear());

 });

 Cheers,
 Jason


[jQuery] Deterministic or Non-Deterministic Event Handler execution?

2009-09-18 Thread Dr Stevens

Is it acceptable to assume that Event Handlers are excecuted in the
order they are bound?  I just wanted to hear what peoples thoughts
were on this.  Lets say I have two plugins which both bind an event
handler to the form submit event.  In order for them to co-exist, one
of the event handlers would need to execute first.  In other languages
and platforms I would consider making this kind of assumption to be
bad practice.  I would think the ideal thing to do would be to support
callbacks (or better yet, custom events) similar to the validate
plugin.

I'd love to hear peoples thoughts on this.


[jQuery] Re: How do you make text selectable when using IE browser?

2009-09-18 Thread donb

Most likely, they added a handler for the click event and thus can
cancel the copy keyup events anywhere in the page.  Lok through your
javascripts for keypress, keyup, keydown keywords that would clue you
to where this is being cancelled out.

On Sep 18, 4:53 pm, amtames matt.a...@tnmed.org wrote:
 Hi,

 We recently had our site redeveloped by a professional firm. We
 originally requested that users not be able to copy and paste text
 from our site. This has created an outcry and we would like to have
 text be selectable. I see that they achieved this by using jquery
 which I am not familiar. I believe that I have found the snippet of
 code that turns this ability off/on but I do not know how to write the
 correct code to allow selection of text. This is an IE specific issue,
 not a problem in Firefox.

 I have done some investigation online and found this:

 http://dev.jqueryui.com/ticket/4773

 It looks cut and dry but placing this solution in the js file does
 nothing.  Can you provide guidance on this issue?

 Thanks!


[jQuery] Re: Is there an onChange method?

2009-09-18 Thread Loony2nz

huh?  You lost me there.

On Sep 17, 5:55 pm, lanxiazhi lanxia...@gmail.com wrote:
 you code defined when to enable,disable a button/field,so add the code
 there.


[jQuery] (validate plugin) Is there an onChange method?

2009-09-18 Thread Loony2nz

I'd like to trap for a field going from invalid to valid.

something like,

onchange: function(){
   alert('Yay, the field is valid and you can follow instructions');

}

Is there something in the plugin that I can use to intercept this?

thanks!


[jQuery] Convert AJAX XML response to HTML

2009-09-18 Thread mahen

Hi,

Can someone help me with a  simple requirement. I want to use AJAX
where the response from server side would be an XML with root element
has two divs one for status with values success or failure and other
child is HTML which needs to replaced if first div is success. eg.

root
div id=statusSuccess/div
div id=response
   div
label for=SlotsOffered
id=SlotsOfferedLabelNumber of Slots/label
input id=SlotsOffered
name=SlotsOffered type=text value=1/
/div
   ..
   ..
/div
/root

So if there is status success we need to replace a tag in existing
HTML with response. Can some help me with it. Give me direction as to
how to do it.

Mahen


[jQuery] Re: ClueTip problem on initially hidden fields

2009-09-18 Thread Karl Swedberg

Hi Sarah,

Not sure what's causing that issue, but one workaround is to set the  
leftOffset option to 30 or so:


  $('span.tooltip[title]').cluetip({
splitTitle: '|',
arrows: true,
dropShadow: false,
cluetipClass: 'jtip',
leftOffset: 30
  });

(you don't need position: 'auto' since that's the default.)

I grabbed your markup and created a demo page for you to look at:

http://plugins.learningjquery.com/cluetip/demo-more/hidden-divs.html

Hope that helps,

--Karl


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




On Sep 16, 2009, at 12:24 PM, Sarah B. wrote:



I am using the clueTip plugin to show help hovers on my application.
It works like a charm, except when I have initially hidden fields on
the page.  For example, several fields default to
style=display:none; and then when an onchange event occurs on a
dropdown, these fields are shown.  When you mouseover the help image
to see the clueTip on these fields which were initially hidden, the
clueTip flashes and acts funny.

Here is the jQuery:
script type=text/javascript
$(document).ready(function() {
$('span.toolt...@title]').cluetip({
splitTitle: '|',
arrows: true,
dropShadow: false,
positionBy: 'auto',
cluetipClass: 'jtip'}
);
});
/script

Here is the html:
td  class=HiddenFields style=display:none;
span class=formatClassHeading/span
span class=tooltip title=Title of Tooltip|Description goes here
img src=images/help.gif width=13 height=14 alt= 
border=0
/spanbr
!--input or select HTML goes here--!
/td

I have updated the clueTip plugin to the latest version (1.0.4) and
jQuery version 1.3.2.  I am also including hoverIntent and bgiframe
plugins for the clueTip.

Has anyone ever had this problem or do you know how to fix it?




[jQuery] catching when a div is updated through js

2009-09-18 Thread macsig

Hello guys,
is there a way to catch when a div content is updated through
javascript?

I update a div content through rjs and I need to call tablesorter
every time the div is updated.


Thanks and have a nice weekend.

Sig


[jQuery] Re: Convert AJAX XML response to HTML

2009-09-18 Thread lanxiazhi
 $.ajax({
   type: POST,
   url: some.php,
   data: name=Johnlocation=Boston,
   success: function(msg){
 alert( Data Saved:  + msg );
   }
 });
http://docs.jquery.com/Ajax/jQuery.ajax#options


[jQuery] Re: event.currentTarget with table rows and IE7

2009-09-18 Thread Mr Speaker

The event you get from jQuery handlers is normalised. CurrentTarget is
just this in the function.

mouseover(event){
alert(this.id);
}

On Sep 19, 7:00 am, Philipp philipp.ma...@googlemail.com wrote:
 Hi,

 I got a problem using the following code:

 $j = jQuery.noConflict();
 $j(document).ready(function(){
         $j('tr').mouseover(function(event) {
                 if (!event.currentTarget) {
                         alert('current target not given!');
                         return false;
                 }
                 alert(event.currentTarget.id);
         });

 });

 When hovering a table data (td) element in Firefox everything works
 fine: The id value of the row is displayed. In IE7 my error message is
 displayed.

 I would appreciate any ideas which would solve this problem.
 Kind regards
  Philipp


[jQuery] Re: event.currentTarget with table rows and IE7

2009-09-18 Thread Mr Speaker

Woah, I just noticed (2 minutes after my reply) this post:
http://brandonaaron.net/blog/2009/05/12/jquery-edge-bind-with-a-different-this

That says in 1.3.3 that currentTarget will be normalised cross-browser
too.


On Sep 19, 7:00 am, Philipp philipp.ma...@googlemail.com wrote:
 Hi,

 I got a problem using the following code:

 $j = jQuery.noConflict();
 $j(document).ready(function(){
         $j('tr').mouseover(function(event) {
                 if (!event.currentTarget) {
                         alert('current target not given!');
                         return false;
                 }
                 alert(event.currentTarget.id);
         });

 });

 When hovering a table data (td) element in Firefox everything works
 fine: The id value of the row is displayed. In IE7 my error message is
 displayed.

 I would appreciate any ideas which would solve this problem.
 Kind regards
  Philipp


[jQuery] Re: catching when a div is updated through js

2009-09-18 Thread lanxiazhi
As far as I know,there is not such method.
but when the data come back through rjs,then you append it to the div,just
do one more thing:

$(table).trigger(update);


[jQuery] Re: Convert AJAX XML response to HTML

2009-09-18 Thread mahen

This I know. This does not fulfill my requirement

Mahen

On Sep 18, 9:59 pm, lanxiazhi lanxia...@gmail.com wrote:
  $.ajax({
    type: POST,
    url: some.php,
    data: name=Johnlocation=Boston,
    success: function(msg){
      alert( Data Saved:  + msg );
    }
  });http://docs.jquery.com/Ajax/jQuery.ajax#options


[jQuery] Re: catching when a div is updated through js

2009-09-18 Thread Macsig

Thanks for your reply.
unfortunately I don't understand what you mean. Could you please
explain it to me.

The rjs looks like

page.replace_html :content, :partial = list, :locals = { :elements
= @elements }

and the call I want to make is

jQuery('.scrolling_table').tablesorter({ sortList: [[0,0]] });


THANKS AGAIN


Sig

On Sep 18, 7:15 pm, lanxiazhi lanxia...@gmail.com wrote:
 As far as I know,there is not such method.
 but when the data come back through rjs,then you append it to the div,just
 do one more thing:

 $(table).trigger(update);


[jQuery] Re: Using append() - each element or string of HTML?

2009-09-18 Thread Michael Geary
You will get the fastest load time by building an HTML string and inserting
it. In a test case I wrote for the jQuery Cookbook, I got a *60X* faster
load time with a 1000-row table by using an HTML string instead of building
up the table with jQuery's DOM functions. You won't see that dramatic an
improvement in a more typical widget, but it can still be a big speedup.

Some specifics:

* Make sure your HTML has a single outermost container element, not a series
of sibling elements. Wrap the whole thing in a div if you have to.

* Instead of concatenating a string, append to an array with arrayname[++index]
= 'stuff'; and then .join('') the array.

* If you're looping over a lengthy JSON or JavaScript array, use the
forloop from the code below instead of
$.each().

* You can attach event handlers to elements in your HTML by using jQuery
selectors after appending the HTML into the DOM. Avoid selectors that select
many multiple elements (such as one per row or column in a long table); use
event delegation instead.

Here's the test code:

function esc( text ) {
return text
.replace( '', 'amp;' )
.replace( '', 'lt;' )
.replace( '', 'gt;' );
}

$(document).ready( function() {

function fillTable( names ) {
var e = esc;  // local reference to reduce name lookups
var html = [], h = -1;
html[++h] = 'table id=nameTable';
html[++h] = 'tbody';
for( var name, i = -1;  name = names[++i]; ) {
html[++h] = 'trtd class=name';
html[++h] = e(name.first);
html[++h] = ' ';
html[++h] = e(name.last);
html[++h] = '/tdtd class=address';
html[++h] = e(name.street);
html[++h] = 'br /';
html[++h] = e(name.city);
html[++h] = ', ';
html[++h] = e(name.state);
html[++h] = ' ';
html[++h] = e(name.zip);
html[++h] = '/td/tr';
}
html[++h] = '/tbody';
html[++h] = '/table';

$('#container')[0].innerHTML = html.join('');
}

$.getJSON( 'names/names-1000.json', function( json ) {
fillTable( json.names );
});
});

The names-1000.json file loaded by the code looks like this:

{
names: [
{
first: Belva,
last: Clegg,
street: 1327 Demyan Drives,
city: Ellerson Rapids,
state: ST,
zip: 13030
},
{
first: Suzette,
last: Grundy,
street: 6473 Beazer Dale,
city: Ahern,
state: LE,
zip: 91670
},
// ...997 more of these...
{
first: Libby,
last: Gladfelter,
street: 6942 Duplantis Parkway,
city: Anguiano Ridge,
state: NO,
zip: 50045
}
]
}

See the book when it comes out for more details :-) or fire away here with
any questions.

-Mike

On Fri, Sep 18, 2009 at 7:40 AM, Kaitlyn kaitlyn2...@gmail.com wrote:


 Just wondering from an efficiency standpoint:

 I am building a widget out of javascript and so there is a lot of
 HTML. Am I better off creating it as a string, then append() it into
 the document, or should I build the widget itself using append() and
 other related helper functions?



[jQuery] Re: catching when a div is updated through js

2009-09-18 Thread lanxiazhi
if use a ajax call,it's like this:
$.ajax({
   type: POST,
   url: some.php,
   data: name=Johnlocation=Boston,
   success: function(data){
 $(table).append(data);
 $(table).trigger(update);...
   }
 });

hope helps.


[jQuery] Re: cluetip with dynamic data from textarea

2009-09-18 Thread Margie

I'll add one more thing to this - I also tried using onActivate to
override the data I'm sending, like this:


script
var dataToSend = initialValue;
$('#id_preview_link').cluetip(
{
   ajaxSettings: {dataType:'html',
  type:'POST',
  onActivate: function(e) { dataToSend = zzz; return
true; },
  data:{'markup':dataToSend)}
 }
}
)
/script

So I'm just trying to override the data sent in the post by setting
dataToSend to zz. However I still find that the value initialValue
is sent in the post, rather than zzz.  Karl, if you have a second
could you comment?  I'm thinking there must be something obvious I'm
missing here.

Again, the basic thing I am doing is just trying to allow the user to
type into a textarea and then send what they've typed in the cluetip's
post, the above is just my attempt to debug why I can't send the new
value that's in the textarea after the user types into it.

Margie

On Sep 18, 1:58 pm, Margie margierogin...@gmail.com wrote:
 I am using the cluetip plugin to show a formatted version of text that
 the user types into a text area.  So I have a textarea
 id=description, and as the user types, they can at any time click a
 preview button will call cluetip to display the popup.  Here is my
 current cluetip call:

 $('#id_preview_link').cluetip(
  {
    ajaxSettings: {dataType:'html',
                   type:'POST',
                   data:{'markup':$('#id_description')}
                  }
  }
 )

 When I click my preview button to activate the clutip, the post data
 that is sent is whatever was in #id_description at the type the cluetip
 () code above was executed.  IE, it doesn't post the current value
 that's in #id_description.

 Can anyone tell me how to make the activation of the cluetip send the
 current text that is in my #id_description field?

 Thanks very much,

 Margie