[jQuery] Re: Validate Input of type File

2008-09-07 Thread Jörn Zaefferer
Yes, just check the input value. You could use the validation plugin
for that: http://bassistance.de/jquery-plugins/jquery-plugin-validation/

The demo here has two file inputs that get validated:
http://jquery.bassistance.de/validate/demo/errorcontainer-demo.html

Jörn

On Sat, Sep 6, 2008 at 11:39 PM, shapper [EMAIL PROTECTED] wrote:

 Hello,

 Is it possible to validate a input of type File?

 I mean that I would like to test if the user checked a file ...
 nothing else.

 Thanks,
 Miguel



[jQuery] Re: WYSIWYG input for Jeditable

2008-09-07 Thread Mika Tuupola



On Sep 7, 2008, at 6:01 AM, C.Everson wrote:

On Sat, 6 Sep 2008 16:38:55 +0300, Mika Tuupola wrote:

http://www.appelsiini.net/projects/jeditable/wysiwyg/wysiwyg.html

Selecting text and clicking the H1-3 does not work for me in IE7.


Look like a bug in jWYSIWYG plugin itself. Will investigate a bit.

Also FYI - where it says Weblog|Projects seems pushed down the  
page (half

off the black area at the top).


Argh. Update CSS on the site yesterday. Forgot old CSS to some of the  
demo pages. Fixed nod.



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



[jQuery] Re: Tabs ui links

2008-09-07 Thread Klaus Hartl

You need to ajaxify those links after the content has been loaded:

$(function() {
$('#example').tabs({
load: function(e, ui) {
$('a', ui.panel).click(function() {
$(ui.panel).load(this.href);
return false;
});
}
});
});

--Klaus


On Sep 1, 12:52 pm, Daniel Beard [EMAIL PROTECTED] wrote:
 Hi everyone,

 I am using jQuery UItabsversion 3.0. I am calling thetabscontent
 via Ajax, but the links inside thetabsdon't open inside thetabs,
 instead they load into a new page. Is there any way to make my links
 load via Ajax into the current tab?

 Thanks,

 Daniel


[jQuery] Re: A little help please....

2008-09-07 Thread Schalk Neethling

Hi there Michael and Chad,

Thanks for the help it worked perfect. Thanks for the suggestion 
regarding the subject of the mails.

Regards,
Schalk

Michael Geary wrote:
 Any time you get a jump like that at the beginning or end of an animation, a
 likely culprit is margin or padding on one of the elements you're animating.
 
 In this case, at least in FF3, the browser default margin on your H2
 elements seems to be causing it. I found that a bit surprising - usually the
 problem is caused by margin or padding on the actual container element that
 you're animating, not on an element inside it. Regardless, when I add this
 rule with the Web Developer Toolbar's Edit CSS command, the jump goes away:
 
 h2 { margin:0; padding:0; }
 
 BTW, you may get faster replies if you use a Subject line that tells what
 you're asking about. For example, a great subject for this message would
 have been:
 
 .slideToggle('slow') content jumps at end of animation
 
 There are probably quite a few of us who would have seen that and gone, Oh
 yeah, must be margin or padding as usual.
 
 -Mike
 
 From: Schalk Neethling

 This just got a little more interesting. In IE 6 and 7 the 
 content jumps down, in IE 8 and FF it jumps up and in Opera 
 9.5 it is perfect, hmmm

 Any thoughts?

 Thanks,
 Schalk

 Schalk Neethling wrote:
 Hi there,

 I had my first experience with jQuery today and I am experiencing a 
 little hick-up. When you go to www.satechevents.co.za you will find 
 two links under the site logo.

 When you click on either of these I use the slideToggle 
 method to hide 
 and show the relevant content. Everything works fine 
 except, when you 
 click on the link the content 'loads' and right at the end 
 jumps up a 
 couple of pixels.

 I am assuming this might have something to do with default browser 
 functions on links marked up as anchors. With this I tried 
 to use the 
 bind event and also returned false from the function in an 
 attempt to 
 prevent the default action and event bubbling as follows:

 $(#about-link).bind(click, (function() {
 $(#contact).hide();
 $(#about).slideToggle(slow);
 return false;
 }));

 Where am I going wrong? Any help or pointers much appreciated.
 Schalk

 
 


[jQuery] Re: .ajax POST question, script stops.

2008-09-07 Thread Ca-Phun Ung

[EMAIL PROTECTED] wrote:
 Whoa just looking that and all the documentation makes it look way
 over my head for a newbie ;).
   
Yup, I could imagine but it is quite simple when you realise what is 
involved. I did a write-up on this topic recently that might be of some 
help [1].

 If I did this, would binding with livequery not be needed anymore? As
 some of the docs ive read, they say things like using Event Delegation
 will make it where you no longer need to bind those events.
   
Correct.


[1] http://yelotofu.com/2008/08/javascript-event-delegation/


[jQuery] Float:left/right elements and smooth animation... possible?

2008-09-07 Thread René

I have a simple accordian-style menu working well. Taking care to
enclose inner, padded elements in divs ensures that everything
animates smoothly.

However, I've run into a problem that I've read about here, but
apparently without a solution (
http://groups.google.com/group/jquery-en/browse_thread/thread/144a0442d5e5fa1c/4021595523934962?lnk=gstq=float+animation+jumps#4021595523934962
).

Simply put, if you include an element in a list element with a
float:right... Then when that parent list element is expanded, it will
expand beyond the actual height of its contents (including the
float:right element), then abruptly snap back up to the actual height.

Has anyone found a way to solve this? (If it's hard to visualize, I'll
try to post an example, but presently all my working code is offline.)

...Rene


[jQuery] Re: Tablesorter 2.0.3 - Sorting af column of checkboxes (resorting)

2008-09-07 Thread hammerskov


Thank you both for taking the time to guide me in the right direction. I have
solved the problem, and you do need to create a new parser. The reason it
seemed to work when the page is loaded is because the textual representation
of a checked and un-checked checkbox is different. 

However, the parser is not as easy one would imagine. From the example that
tlphipps guided me to show how the format function takes one parameter 's'
containing the textual representation of a textbox. If you try to wrap this
(which I did) you do no get a reference to the actual checkbox and therefore
it doesn't work. 

If you go through the code and find the parser responsible for ip-addresses
you will notice that the format function actualy takes three parameters: s,
table, cell. If you wrap the cell and get the checkbox from it's child
elements we get the correct result. You still have to call
$(#myTable).trigger(update); before sorting.

 $.tablesorter.addParser({ 
// set a unique id 
id: 'checkboxes', 
is: function(s) { 
// return false so this parser is not auto detected 
return false; 
}, 
format: function(s,table,cell) { 
// format your data for normalization
var checked = 
$(cell).children(:checkbox).get(0).checked; 
return  checked  ? 1 : 0; 
}, 
// set type, either numeric or text 
type: 'numeric' 
}); 

$(function() { 
$(#myTable).tablesorter({
debug:true,
headers: { 
1: { 
sorter:'checkboxes' 
} 
} 
}); 
});
-- 
View this message in context: 
http://www.nabble.com/Tablesorter-2.0.3---Sorting-af-column-of-checkboxes-%28resorting%29-tp19308787s27240p19357296.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: fastfind menu question

2008-09-07 Thread roelof

Nobody who have a example for me ?

Roelof


On 6 sep, 19:04, roelof [EMAIL PROTECTED] wrote:
 Hello,

 For mij website i like to use this script.
 But i can't find how to implement this.

 Can someone tell me that,

 Roelof


[jQuery] preserve state of a toggle element after page reload

2008-09-07 Thread Jochen Kaechelin

Is there a way to store the status (hidden, visible) of a div for  
example
after a page reload?

I want to give the users the possibility to custumize the sidebar.
Hidden elements could be made visible again on a special settings site.

When the user enters the main site all sidebar elements are visible.  
Then the user
hides some elements and jumps to another page - and all elements are  
visble again.

Right now I use session to decide which elements are hidden/visble?

Is there also a Jquery way?

Thanx
  


[jQuery] Re: Everyone knows how to manipulate a SELECT with jQuery??

2008-09-07 Thread etnas

Ok,
this is exactily what I want.

It's true, sometimes 'simple' javascript may be the solution. However,
I'm trying to write all the javascript via jQuery but now, I'm
starting to see that, possibly, this way is not the best.

Thanks for all!

On 7 sep, 00:10, MorningZ [EMAIL PROTECTED] wrote:
 Sometimes simple javascript is the way  (other than wiring up the
 events anyways)

 Quick code (and tested) here

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

 i *think* that's what you were after


[jQuery] getJSON and (this)

2008-09-07 Thread Skeeter

Hi. Can anyone tell me while once I get inside the success function
$j(this) is no longer defined?

Thanks! :)

$j(a.complete).click(function () {
$j.getJSON(https://foobar?my=; + $j(this).attr(title),
function(data){
if (data.status == Completed) {
//Woohoo, it worked!
alert(Woohoo!);

//Now lets change the div style!
$j(this).parent().removeClass('foobar');

//Hey, that didn't do anything!

//This worked above, lets test and see if it contains a 
value.
alert($j(this).attr(title));

//undefined? =(
}
});


[jQuery] Re: [Validation plugin] Checkbox array problem

2008-09-07 Thread faizal iqbaal
hi All ,

an interesting find...am not sure if its a bug or not..but am open to
debate.

Looking at the jquery.append()...which is considerably slow for methe
same with jquery.html()

basically the latter jquery.html() internally routes back to the
query.append() method ..is this a bug 

cause i have noticed serious perfomace impications with it when the size of
the do increases manifold...say a list box with 2 options ...

anything i am missing out here

Thanks  Regards

Faizal



On Fri, Sep 5, 2008 at 4:29 AM, Jörn Zaefferer 
[EMAIL PROTECTED] wrote:

 See
 http://docs.jquery.com/Plugins/Validation/Reference#Fields_with_complex_names_.28brackets.2C_dots.29

 Jörn

 On Fri, Sep 5, 2008 at 12:56 AM, nonsense [EMAIL PROTECTED] wrote:
 
  Hi,
 
  I'm using Validation plugin (http://docs.jquery.com/Plugins/
  Validation) and I want to use it to check whether at least one
  checkbox is checked. Validating for one checkbox is working fine, but
  not for group.
 
  HTML code:
  input type=checkbox name=category[]
  input type=checkbox name=category[]
  input type=checkbox name=category[]
 
  I tried to add category[]: required to rules but no success.
 
  Could somebody show me a working example?
 
  Thanks in advance,
  nonsense
 




-- 
Thanks  Regards
Faizal
(001)919 889 1980
when nothing works , prayer does.


[jQuery] How to prevent multiple click sound in IE 6 using jQuery History plugin

2008-09-07 Thread Rob Anderson

I am hoping someone might be able to help with this problem.

I am using the jQuery history plugin and it is working fine, except
that in IE 6, I hear the 'start navigation' click sound twice when
navigating backwards and forwards between pages.

I have got as far as identifying the parts of the plugin code where
this is occurring, but do not know enough to stop prevent the annoying
double-click sound (it seems to fire once when the age is loaded and
again when the hidden iframe is populated).

Here is the relevant code segment and I have added two comments
indicating where the clicks occur:

-

load: function(hash) {
var newhash;

if ($.browser.safari) {
newhash = hash;
} else {
newhash = '#' + hash;
// First click heard in IE 6
location.hash = newhash;
}
this._curHash = newhash;

if ($.browser.msie) {
var ihistory = $(#jQuery_history)[0]; // TODO: need
contentDocument?
var iframe = ihistory.contentWindow.document;
iframe.open();
iframe.close();
// Second click heard in IE 6
iframe.location.hash = newhash;

this._callback(hash);
}

-

I note that the multiple click sounds occur in the jQuery History demo
as well, so don't think it is just my implementation.

Is there perhaps another way to load the new hsh location into the
iframe?

Any help much appreciated :)

Thanks, Rob


[jQuery] Re: Image enable or disable

2008-09-07 Thread [EMAIL PROTECTED]

hi,
thanks for the answer.
my answer is so:
how can i detect the client browser setting with javascript. example:
the client browser blocked Popups. this example i could solve it, but
what i need is right now, how can i know if the browser of the client
are enable images to display.

if u dont understand my question, pls tell me and i will describe it
again.
thanks and i hope for answer.

best wishes,
sarmad

On Sep 7, 1:54 am, spicyj [EMAIL PROTECTED] wrote:
 You'll likely find better help if you use proper grammar. I'm a bit
 confused as to what you're looking for. Possibly you want something
 like this?

 http://jquery.khurshid.com/ifixpng.php

 ~spicyj


[jQuery] Re: Jquery Problem in IE 6

2008-09-07 Thread Jani

Hi,

i used .html(), but IE6 is crashed.
i found the solution:
The problem with expression in css (max-height hack for IE):

JS: $(#chat_userlist).html(out); // here chrashed
CSS:
#chat_userlist .u .p img{
  width: 100%;
  height: auto;
  max-height:40px;
  _height:expression( this.scrollHeight  40? 40px : auto );   /*
-- the problem, remove this */
}

Solution:  remove expression, and run after .html() the max-height js
code.

Have a nice day.


On aug. 18, 11:47, Joe [EMAIL PROTECTED] wrote:
 Dear friends,

 i am working in a site, in which i have used jquery scripts.
 In Jquery the .html() is not working. I used .html() to print the
 output to one div from one file.
 If i use .html() inie6means the site in keep on loading.

 Please help me to fix the error.

 It is very Urgent


[jQuery] Re: Everyone knows how to manipulate a SELECT with jQuery??

2008-09-07 Thread Tzury

@ Lukas  MorningZ
If you don't use jQuery for the task, you my have to assure by
yourself that the code will work under all the browsers.


On Sep 7, 1:39 am, Lukas Polak [EMAIL PROTECTED] wrote:
 you don't need to use jQuery. I've just been solving problem about how
 can I get value of SELECT by jQuery and I've realized that there is
 another, easier path. Just use simple JS:
 function getID()
 {
   return  document.getElementById('test').selectedIndex; // this  
 command find out index of actually selected option}

 if you want to increase it or decrease it, just use simple math :)
 function Increase()
 {
   var id = getID();
   id++;
   if (id  maxID) id = minID;
   upd(id);

 }

 function Decrease()
 {
   var id = getID();
   id--;
   if (id  minID) id = maxID;
   upd(id);}

 and then just update text in label  - you can use simple JS as well:
 function upd(newID)
 {
 document.getElementById('the_previous_or_next_option_value').innerHTML =
 document,getElementById('test').options[newID].text;

 }

 It may works.

 etnas  wrote / napísal(a):

  Hi!
  Everyone knows how to manipulate the OPTIONS of a SELECT with jQuery??

  I have, for example, this SELECT:

  select id=test
    option value=1Option 1/option
    option value=2Option 2/option
    option value=3Option 3/option
  /select

  And I have 2 buttons on the document:

  input type=button name=pre id=pre value=previous option /
  input type=button name=post id=post value=post option /

  Ok!; I need to change the selected option in the SELECT when I push
  the 'pre' or the 'post' button and send the new value of the previous
  or next option to a label:

  label id=the_previous_or_next_option_value/label

  Thanks for your comments!


[jQuery] Re: Everyone knows how to manipulate a SELECT with jQuery??

2008-09-07 Thread MorningZ

 If you don't use jQuery for the task, you my have to assure by
yourself that the code will work under all the browsers.

jQuery does a lot of things, but it doesn't do close to everything...
not even close...  it's not the magic bullet for cross-browser

and in this particular case of manipulating select options, this
ability, and javascript, has worked for many many years


[jQuery] Re: IE and GoogleMaps in a modal window

2008-09-07 Thread Eric Martin

djn - I gave it a quick try and it seemed to work for me in IE7. Were
you having problems in IE7 or IE6?

-Eric


On Sep 6, 5:53 am, Dejan Kozina [EMAIL PROTECTED] wrote:
 Hello list.

 Is there somebody here that could help me understand a strange thing
 about IE rendering a Google Map inside of a modal overlay?

 I've just put together a simple one-page website for a local event  
 athttp://www.krasnopolje.com(valid HTML and CSS). Clicking on the
 'GoogleMaps' link with scripting enabled opens a modal window (I used
 theSimpleModalplugin) and the map is drawn into it.

 Now the IE mistery: the browser we all learned to curse won't draw the
 images composing the map unless there is a rendered element in the
 document body besides the main div (#container) where everything else
 is. I had to put a paragraph with nbsp; on line 137 of the source:
 without it every sane browser (FF, Opera, Safari, Chrome) would draw the
 map as requested, only IE would draw the map background, the navigation
 gadgets, the Google logo and all, but not the actual pictures that the
 map is made of.

 After some testing I found that the elements that trigger the correct
 behaviour can be an empty paragraph (even without the nbsp;), an empty
 span, a single character or an empty anchor (a name=whatever); elements
 that do not are non rendered stuff like script, style, floated elements
 or those with display: none.

 Does this make some sense to any of you?

 Do not waste too much time about it... The site is already out and
 working fine (and it was a pro-bono thing anyway). I'm just curious
 what's going on with that paragraph.

 djn

 --
 -
 Dejan Kozina Web design studio
 Dolina 346 (TS) - I-34018 Italy
 tel./fax: +39 040 228 436 - cell.: +39 348 7355 225 skype: 
 dejankozinahttp://www.kozina.com/ - e-mail: [EMAIL PROTECTED]


[jQuery] Re: A little help please....

2008-09-07 Thread Klaus Hartl

On Sep 7, 2:02 am, Michael Geary [EMAIL PROTECTED] wrote:
 There are probably quite a few of us who would have seen that and gone, Oh
 yeah, must be margin or padding as usual.

I think most probably the culprit is a collapsing margin, which
doesn't collapse anymore once the elements are animated. The CSS spec
defines several cases of when margins should or should not collapse.
And margins do also collapse for nested elements.


--Klaus


[jQuery] Re: How to prevent multiple click sound in IE 6 using jQuery History plugin

2008-09-07 Thread Klaus Hartl

Although there's a way to supress that sound:

http://www.julienlecomte.net/blog/2007/11/30/

you can't have both: By using this trick, you will break the back /
forward navigation buttons. Therefore, this trick should only be used
for a non-navigational purpose only.


--Klaus



On Sep 7, 12:25 pm, Rob Anderson [EMAIL PROTECTED] wrote:
 I am hoping someone might be able to help with this problem.

 I am using the jQuery history plugin and it is working fine, except
 that in IE 6, I hear the 'start navigation' click sound twice when
 navigating backwards and forwards between pages.

 I have got as far as identifying the parts of the plugin code where
 this is occurring, but do not know enough to stop prevent the annoying
 double-click sound (it seems to fire once when the age is loaded and
 again when the hidden iframe is populated).

 Here is the relevant code segment and I have added two comments
 indicating where the clicks occur:

 -

 load: function(hash) {
                 var newhash;

                 if ($.browser.safari) {
                         newhash = hash;
                 } else {
                         newhash = '#' + hash;
 // First click heard in IE 6
                         location.hash = newhash;
                 }
                 this._curHash = newhash;

                 if ($.browser.msie) {
                         var ihistory = $(#jQuery_history)[0]; // TODO: need
 contentDocument?
                         var iframe = ihistory.contentWindow.document;
                         iframe.open();
             iframe.close();
 // Second click heard in IE 6
             iframe.location.hash = newhash;

                         this._callback(hash);
                 }

 -

 I note that the multiple click sounds occur in the jQuery History demo
 as well, so don't think it is just my implementation.

 Is there perhaps another way to load the new hsh location into the
 iframe?

 Any help much appreciated :)

 Thanks, Rob


[jQuery] Re: .ajax POST question, script stops.

2008-09-07 Thread Ca-Phun Ung


Ca-Phun Ung wrote:
 OK so I was right - you do have a double equal sign in your code! Change:
 $(this).css(background-color) == p_color;

 to

 $(this).css(background-color) = p_color;
   
Actually, there shouldn't be an equal sign in the first place because 
the css() acts as both a getter and setter method - sorry I should have 
noticed this earlier :(

Try:

$(this).css('background-color', p_color);




[jQuery] Re: Best practices for using anchors (a) for jQuery tabs?

2008-09-07 Thread Paulus1950





Hello Klaus,

I found your post while surfing the web.
I too have problem with link anchors jumping to the top of a HTML
page.
Please visit: http://www.pictureframe.com.au/picture_frame_contact.html
Click  Send and you will see what I mean.
I am happy to pay for a fix to this issue.
Alternatively, can you suggest helpful links?

Best Regards,

Paul Nonnis.

www.pictureframe.com.au



















On Aug 10, 9:50 pm, Klaus Hartl [EMAIL PROTECTED] wrote:
 UI tabs for example uses hrefs with fragment identifiers that point to
 the related parts of the document (like in TOCs for example). That way
 it'll degrade gracefully in case JS is turned off.

 a id=tab_1 href=#content_1Stop/a

 To avoid the page jump you just need to make sure that the default
 link action is turned off:

 $('#tab_1').click(function() {
     return false;

 });

 --Klaus

 On Aug 8, 2:47 pm, John K [EMAIL PROTECTED] wrote:



  Hello, I was wondering what the most efficient ways of using anchor
  links when they are just being used for simple jQuery tabbed browsing.
  For example, say I have two tabs, and on the page load only the first
  content box is shown, with the html like so:

  div id=tabs
          ul
                  lia id=tab_1Stop/a/li
                  lia id=tab_2Look/a/li
          /ul

          div id=content_1
                  pLorem ipsum dolor/p
          /div

          div id=content_2 !-- not shown on page load --
                  pLorem ipsum dolor/p
          /div
  /div

  I use jQuery to show the relevant content div when either a link is
  clicked. That bit is fine.

  But as you'll notice, I have no 'href' link inside my a anchors.
  Therefore I have to add 'cursor: pointer' to my css to get the hand
  cursor to appear when you hover over the tab. This does throw up a
  warning in my html validation but not an error. So I'd like to know
  whether this is best practice for these kind of jQuery tabs.

  If I use a href=#Stop/a the page can jump to the top when I
  click on the tab, which doesn't look good.

  What would you use to make this as perfect as possible?- Hide quoted text -

 - Show quoted text -


[jQuery] jquery autocomplete local data

2008-09-07 Thread Julian

Greetings!
I`m using jquery auto complete plugin from
http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/
Initialized with local JSON data which i receive from server the data
is something like
var data = [{elem0:data0},{elem1:data1}]
After that i`m trying to  add new element to the data variable by
data.push({elem2:data2})
but the auto complete plugin works with the data which is initialized.
I don`t have access to add or remove new elements to the
variable which i initialize with atucomplete without unbind and call
autocomplete again.
Is there any other solutions?



[jQuery] animate width or height form auto to fixed size _and back_?

2008-09-07 Thread stephen friedrich

I built a box/panel that collapses to the left, but so that it keeps
visible with a small width.
By default (in expanded state) it should have width: auto.

Collapsing is easy:
   boxHeader.animate({width : '19px'}, 'fast');
However: Is there an easy way to expand it back?
It would be very nice if this would work, but it doesn't:
   boxHeader.animate({width : 'auto'}, 'fast');

What I have come up with so far seems clumsy and lengthy, which is not
really my impression of jQuery in general:

// Seems jquery cannot animate width/height with target auto.
var smallWidth = boxHeader.css('width'); // So first remember the
current (collapsed) width
boxHeader.css('width', 'auto'); // then temporarily set to auto
var newWidth = boxHeader.width(); // to calculate the desired width
boxHeader.css('width', smallWidth); // then set the collapsed width
again
boxHeader.animate({width : newWidth + px}, 'fast', // and animate to
the fixed expanded width
function() {boxHeader.css('width',
'auto');} // but set to auto again when animation is complete
);

Is there a better way?


[jQuery] Re: JScrollPane not working in some pages

2008-09-07 Thread csplrj

I got that working by putting height to the div tag

Bye for now

CSJakharia


[jQuery] Re: .ajax POST question, script stops.

2008-09-07 Thread [EMAIL PROTECTED]

It still has a very small bit of lag to it, but I think its a lot
faster with the event delgation.

Anyway we can clean this up a bit more?

\$('#pixel-grid').click(function(e) {
if ( \$(e.target).is('.button px') )
var color = \$(input#color_code).val();
\$(this).css({ backgroundColor:color });
color = color.substr(1);
var id_select = \$(this).attr(id);
var id_select = \$(e.target).parent('div').attr('id');
id_select = id_select.substr(1);
\$(#result).load('/pixel/pixel_creator.pl', 
{colorselect: color,
id_select: id_select});
});

On Sep 7, 1:32 am, Ca-Phun Ung [EMAIL PROTECTED] wrote:
 [EMAIL PROTECTED] wrote:
  Whoa just looking that and all the documentation makes it look way
  over my head for a newbie ;).

 Yup, I could imagine but it is quite simple when you realise what is
 involved. I did a write-up on this topic recently that might be of some
 help [1].

  If I did this, would binding with livequery not be needed anymore? As
  some of the docs ive read, they say things like using Event Delegation
  will make it where you no longer need to bind those events.

 Correct.

 [1]http://yelotofu.com/2008/08/javascript-event-delegation/


[jQuery] Re: .ajax POST question, script stops.

2008-09-07 Thread [EMAIL PROTECTED]

I think i've almost got it!

\$('#result').click(function(e) {
if ( \$(e.target).is('.button px') )
var color = \$(input#color_code).val();
\$(this).css({ backgroundColor:color });
color = color.substr(1);
var id_select = \$(this).attr(id);
alert ( id_select );
id_select = id_select.substr(1);
\$(#result).load('/pixel/pixel_creator.pl', 
{colorselect: color,
id_select: id_select});
});

However in this code, it's getting result my container for all the
div's instead of the div ID var id_select = \$(this).attr(id) =
result not the inner divs ID.

I need to keep playing with this, but I thin i've almost got it.

On Sep 7, 1:32 am, Ca-Phun Ung [EMAIL PROTECTED] wrote:
 [EMAIL PROTECTED] wrote:
  Whoa just looking that and all the documentation makes it look way
  over my head for a newbie ;).

 Yup, I could imagine but it is quite simple when you realise what is
 involved. I did a write-up on this topic recently that might be of some
 help [1].

  If I did this, would binding with livequery not be needed anymore? As
  some of the docs ive read, they say things like using Event Delegation
  will make it where you no longer need to bind those events.

 Correct.

 [1]http://yelotofu.com/2008/08/javascript-event-delegation/


[jQuery] Re: getJSON and (this)

2008-09-07 Thread Karl Swedberg

You're within the scope of another function.

If you want to keep a reference to the clicked link, you could do  
something like this:



$j(a.complete).click(function () {
   var $aComplete = $j(this); // -- hold onto to $j(this)
   $j.getJSON(https://foobar?my=; + $j(this).attr(title),
   function(data){
   if (data.status == Completed) {
//Woohoo, it worked!
alert(Woohoo!);

//Now lets change the div style!
			$aComplete.parent().removeClass('foobar'); // -- reference the  
clicked link ( $j(this) )


//Hey, that didn't do anything!

//This worked above, lets test and see if it contains a 
value.
   alert($aComplete.attr(title));  // --  
reference the clicked link ( $j(this) )


//undefined? =(
   }
   });

Doesn't look like you're doing anything with the data that you're  
retrieving, though. Was that left out for example brevity?



--Karl


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




On Sep 7, 2008, at 1:00 AM, Skeeter wrote:



Hi. Can anyone tell me while once I get inside the success function
$j(this) is no longer defined?

Thanks! :)

$j(a.complete).click(function () {
   $j.getJSON(https://foobar?my=; + $j(this).attr(title),
   function(data){
   if (data.status == Completed) {
//Woohoo, it worked!
alert(Woohoo!);

//Now lets change the div style!
$j(this).parent().removeClass('foobar');

//Hey, that didn't do anything!

//This worked above, lets test and see if it contains a 
value.
   alert($j(this).attr(title));

//undefined? =(
   }
   });




[jQuery] Re: preserve state of a toggle element after page reload

2008-09-07 Thread Karl Swedberg

You could use the cookie plugin and set a cookie for the visible state.

Here is a simple example:

http://test.learningjquery.com/cookie-menu.html

--Karl


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




On Sep 7, 2008, at 8:03 AM, Jochen Kaechelin wrote:



Is there a way to store the status (hidden, visible) of a div for
example
after a page reload?

I want to give the users the possibility to custumize the sidebar.
Hidden elements could be made visible again on a special settings  
site.


When the user enters the main site all sidebar elements are visible.
Then the user
hides some elements and jumps to another page - and all elements are
visble again.

Right now I use session to decide which elements are hidden/visble?

Is there also a Jquery way?

Thanx





[jQuery] Re: jquery autocomplete local data

2008-09-07 Thread Jörn Zaefferer
You can flush the cache, that should make modifications to the data
array visible: http://docs.jquery.com/Plugins/Autocomplete/flushCache

Jörn

On Sun, Sep 7, 2008 at 4:31 PM, Julian [EMAIL PROTECTED] wrote:

 Greetings!
 I`m using jquery auto complete plugin from
 http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/
 Initialized with local JSON data which i receive from server the data
 is something like
 var data = [{elem0:data0},{elem1:data1}]
 After that i`m trying to  add new element to the data variable by
 data.push({elem2:data2})
 but the auto complete plugin works with the data which is initialized.
 I don`t have access to add or remove new elements to the
 variable which i initialize with atucomplete without unbind and call
 autocomplete again.
 Is there any other solutions?




[jQuery] Re: scrollTo anchor or class in div

2008-09-07 Thread Ariel Flesler

ScrollTo doesn't bind, just scrolls, so no need to use LiveQuery to
call it.
Also, id's can't start with a number.

Example:

function scrollToID( id ) {
  $('#hold').scrollTo( '#'+id, 1000 );
}

$('#hold').load('someData.php', function(){
scrollToID( 'foo' );
});

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


On Sep 6, 11:57 pm, pedalpete [EMAIL PROTECTED] wrote:
 Thanks Ariel,

 I guess I should be using scrollTo rather than LocalScroll.

 Unfortunately I won't have a demo up for a few days.

 I started to wonder if part of the problem was that the scrollable
 list is returned via ajax, so I have tried using livequery, but still
 no scrolling.

 Here's the code I'm using now
 [code]
         function scrollToShow(trackid){
         $('#hold').livequery(function(){
         $('#hold').scrollTo($('.holdList #'+trackid));
         });
         }

 [/code]

 the id is a numeric value, so hopefully that won't be causing
 problems.

 Does the code look right to you?
 the  '#hold' is a non-scrolling div, and the '.holdList' is the
 scrolling div.
 I've also tried
 [code]
 $('.holdList').scrollTo($('.#'+trackid'));
 [/code]
 but that didn't work either.

 Thanks for your help,
 Pete
 On Sep 6, 6:16 pm, Ariel Flesler [EMAIL PROTECTED] wrote:

  That function is meant to start a scrolling animation ?

  LocalScroll is meant to be called to prepare the field, that is,
  bound events that will eventually trigger scrolling.
  ScrollTo is the one to call for an instant scroll.

  You either call LocalScroll at start, or ScrollTo manually if you want
  to do all that yourself.

  Note that the 'target' property needs to be the scrollable element.
  If you have a demo online, it'll be easier to pull this out.

  Cheers

  --
  Ariel Fleslerhttp://flesler.blogspot.com/

  On Sep 6, 7:59 pm, pedalpete [EMAIL PROTECTED] wrote:

   Thanks Karl, I didn't realize I shouldn't start an id with numeric
   characters, I've been doing it for a long time without issue.

   I've tried the changes you recommended, but still no scrolling.

   I added an 'a' to the beginning of the id, and now my code is

   [code]
           function scrollToShow(trackid){
                   $.localScroll({
                   target: '.holdList li#a'+trackid, //could be a
   selector or a jQuery
   object too.
                   queue:true,
                   duration:1000,
                   hash:true
           });
           }
   [/code]

   i've checked that I have the right class name for the list, and that
   the id's are in the html properly.

   On Sep 6, 2:03 am, Karl Rudd [EMAIL PROTECTED] wrote:

Use something like id=number1 rather than name=number1. (Just a
note, technically an id needs to start with a none numeric character).
Then use target: '#'number' + trackid

The name attribute is really only for form input elements.

Karl Rudd

On Sat, Sep 6, 2008 at 12:17 PM, pedalpete [EMAIL PROTECTED] wrote:

 I've got a div on my page with a scrollable list in it.
 When I load the page, I want the list to scroll to a specific item.
 Each item has a class and name, so I'm trying to address them with
 that.

 I've been toying with the flesler scroll plugins, but am not sure if
 they are what i should be using.

 .scrollTo kept throwing errors at me, but .localScroll doesn't error
 out, but doesn't scroll either.

 here's the code I'm using
 [code]
        function scrollToShow(showid){
                $.localScroll({
                target: '.holdList li.'+trackid, //could be a selector 
 or a jQuery
 object too.
                queue:true,
                duration:1000,
                hash:true
        });
        }
 [/code]

 the code for the list is pretty simplelike this
 [code]
 ul class=holdList
        li class=1 name=1first in list/li
        li class=2 name=2second in list/li
 /ul
 [/code]

 Any idea on a simple way to do this? Or if the .localScroll
 or .scrollTo allow scrolling in a div?


[jQuery] Re: jquery autocomplete local data

2008-09-07 Thread Julian

Thanks for the fast response, but after i use flushCache() there are
no results after i press key into the inputbox.
I ask this question because i use more than one input box with that
data, and after i update the JSON data i must unbind all inputs.
Greetings!


[jQuery] Re: .ajax POST question, script stops.

2008-09-07 Thread Ca-Phun Ung

[EMAIL PROTECTED] wrote:
 Anyway we can clean this up a bit more?

   \$('#pixel-grid').click(function(e) {
   if ( \$(e.target).is('.button px') )
   var color = \$(input#color_code).val();
   \$(this).css({ backgroundColor:color });
   color = color.substr(1);
   var id_select = \$(this).attr(id);
   var id_select = \$(e.target).parent('div').attr('id');
   id_select = id_select.substr(1);
   \$(#result).load('/pixel/pixel_creator.pl', 
 {colorselect: color,
 id_select: id_select});
   });
   
You're setting id_select twice - remove the first one. You could also 
try playing with the syntax to get it shorter.


[jQuery] Re: getJSON and (this)

2008-09-07 Thread Skeeter

Thank you! That worked great =)

Basically once I get the data back and it has the correct status, I
want to 'swap styles'. Right now, I just remove one, then add the one
I want.

Is it possible to fade between styles? It doesn't look like it to me,
because the fade() function does not seem to do anything.


Thank you!!


[jQuery] append ajax call result?

2008-09-07 Thread jasonpriem

I want to append the result of a load() call, rather than replacing
everything in the element, like this:
code
$(a).click(
function(){
$(this).append( load(./my_data.php) );
});
/code

I've tried
code
$(a).click(
function(){
$(this).append(
function() {
load(./word_data.php);
}
)
}
)
/code
which doesn't work.  Is there a way to do this?


[jQuery] $.post - timing problem

2008-09-07 Thread Christian

I have a little problem with the following code,

alert('start');
$.post(ajax.asp, { email: email },
function(data){
alert(Data Loaded:  + data);
});

// should wait until Data Loaded
alert('start2');

$.post(path.asp, { email: email }, validateReturn)

alert('after');

Output is:
start
start2
after
Data Loaded ...


I have to call a $.post function twice. How can I do it, that the next
$.post function have to wait until the first function is called and
the output is processed?


Bye


[jQuery] Re: IE and GoogleMaps in a modal window

2008-09-07 Thread Dejan Kozina

Hi Eric. Thank you for looking at it.
I have IE7 installed, plus IE6 and IE8 beta 2 as VirtualPC images. All
three show the mishap whet that last empty p is not present.

djn

Eric Martin wrote:
 djn - I gave it a quick try and it seemed to work for me in IE7. Were
 you having problems in IE7 or IE6?
 
 -Eric
 
 

-- 
-
Dejan Kozina Web design studio
Dolina 346 (TS) - I-34018 Italy
tel./fax: +39 040 228 436 - cell.: +39 348 7355 225 skype: dejankozina
http://www.kozina.com/  - e-mail: [EMAIL PROTECTED]


[jQuery] Re: $.post - timing problem

2008-09-07 Thread Michael Geary

$.post returns immediately. It does not wait for the data to be downloaded.
There is an option to force it to wait, but that is definitely not
recommend, since it locks up the browser (and *all* browser sessions from
the same browser instance) while waiting.

The callback function is where you put code that should run after the data
is returned.

To sequence your two posts properly, code it like this:

$.post(ajax.asp, { email: email },
function(data){
$.post(path.asp, { email: email }, validateReturn);
});

-Mike 

 -Original Message-
 From: jquery-en@googlegroups.com 
 [mailto:[EMAIL PROTECTED] On Behalf Of Christian
 Sent: Sunday, September 07, 2008 11:11 AM
 To: jQuery (English)
 Subject: [jQuery] $.post - timing problem
 
 
 I have a little problem with the following code,
 
 alert('start');
 $.post(ajax.asp, { email: email },
 function(data){
 alert(Data Loaded:  + data);
 });
 
 // should wait until Data Loaded
 alert('start2');
 
 $.post(path.asp, { email: email }, validateReturn)
 
 alert('after');
 
 Output is:
 start
 start2
 after
 Data Loaded ...
 
 
 I have to call a $.post function twice. How can I do it, that 
 the next $.post function have to wait until the first 
 function is called and the output is processed?
 
 
 Bye
 



[jQuery] Re: Validate Input of type File

2008-09-07 Thread shapper

Hi,

I tried and it is working ... well kind of. I am using FileStyle
JQuery plugin to style the file input:
http://www.appelsiini.net/projects/filestyle

So the generated code (note the error message that is working):

label for=PathFicheiro/label
input class=file style=display: inline; width: 320px;/
div style=background: transparent url(../../Assets/Image/PT/
FileUpload_Button.jpg) no-repeat scroll right center; overflow:
hidden; width: 20px; height: 15px; -moz-background-clip: -moz-initial;
-moz-background-origin: -moz-initial; -moz-background-inline-policy: -
moz-initial; display: inline; position: absolute;
input id=Path class= type=file value= name=Path
style=position: relative; height: 15px; width: 320px; display:
inline; cursor: pointer; opacity: 0; margin-left: -142px;/
label class=Error for=Path generated=trueSelect a
document/label
/div

The error message is in the HTML markup as you can see but it is not
visible.

Any idea of how to solve this?

Thanks,
Miguel

On Sep 7, 10:48 am, Jörn Zaefferer [EMAIL PROTECTED]
wrote:
 Yes, just check the input value. You could use the validation plugin
 for that:http://bassistance.de/jquery-plugins/jquery-plugin-validation/

 The demo here has two file inputs that get 
 validated:http://jquery.bassistance.de/validate/demo/errorcontainer-demo.html

 Jörn

 On Sat, Sep 6, 2008 at 11:39 PM, shapper [EMAIL PROTECTED] wrote:

  Hello,

  Is it possible to validate a input of type File?

  I mean that I would like to test if the user checked a file ...
  nothing else.

  Thanks,
  Miguel


[jQuery] Re: Determine if a Javascript has loaded?

2008-09-07 Thread bcbounders

OK... so here's what I've got so far.  I'm trying to work out the
jQuery so that if the iBegin weather widget is successfully loaded,
then the div id=weather is shown... otherwise, it's hidden.

script type=text/javascript
jQuery.ready(function(){
jQuery(#weather).replaceWith({
jQuery.ajax({
type: GET,
dataType: script,
url: 
http://weather.ibegin.com/js/us/ak/ninilchik/0/0/1/1/0/
custom.jsbackground_color=transparentcolor=093384width=200padding=0border_width=0border_color=transparentfont_size=18font_family=inheritshowicons=1,
success: function(){
jQuery(#weather).show()
},
error: function(){
jQuery(#weather).hide()
}
});
});
});
/script

But... what I've got isn't working.  And, being new to jQuery (and
Javascript), I'm not sure why it's not working... or even if this is
the best route to try and achieve what I want.

Can someone take a look and provide some feedback?  I'd really
appreciate it!

Thanks a lot!

 - John

On Sep 6, 10:49 am, bcbounders [EMAIL PROTECTED] wrote:
 Rene,

 Thanks so much for posting.

 I got the site up, using the iBegin weather widget on it's own.  If it
 helps, here's a link:  http://tinyurl.com/5n8mco

 I'll take a stab at doing what you suggest... wish me luck! :D  But...
 expect to hear more questions from me soon.

  - John


[jQuery] Re: $.post - timing problem

2008-09-07 Thread [EMAIL PROTECTED]

The function passed to $.post is a callback, meaning execution
continues in the main thread of operation until $.post returns, at
which point the callback function is executed.  To make your 2nd post
command wait until after the first is completed, your second post
command should be part of your callback function to the first post.
I.E. your code should be more like:

alert('start');
$.post(ajax.asp, { email: email },
function(data){
alert(Data Loaded:  + data);
   $.post(path.asp, { email: email }, validateReturn);
alert('after');
});

alert('continuing. . .')

this should produce:
start
continuing. . .
Data Loaded:. . .
after. . .

On Sep 7, 11:11 am, Christian [EMAIL PROTECTED] wrote:
 I have a little problem with the following code,

 alert('start');
 $.post(ajax.asp, { email: email },
             function(data){
                 alert(Data Loaded:  + data);
             });

 // should wait until Data Loaded
 alert('start2');

 $.post(path.asp, { email: email }, validateReturn)

 alert('after');

 Output is:
 start
 start2
 after
 Data Loaded ...

 I have to call a $.post function twice. How can I do it, that the next
 $.post function have to wait until the first function is called and
 the output is processed?

 Bye


[jQuery] Somebody know javascript function?

2008-09-07 Thread [EMAIL PROTECTED]

hi all,
i need to know, how can i indicate with javascript if the client
browser are enable ito display images. sohow can i to check that?
which functions are need for that?
the client has to be informed, if his browser has to be adjusted at
first, to be the images able to display.

pls help and thanks a lot.

best wishes,
sarmad


[jQuery] selectors in $.post return with HTML context

2008-09-07 Thread [EMAIL PROTECTED]

I'm having trouble using a subsequent selector on an HTML page
returned from $.post, while trying to write a Ubiquity command.

If I log or display ajdata, as returned from the $.post, it contains
the HTML page, as expected, and shows up as a jQuery object in
Firebug.

What I want to do is use a jQuery selector to extract a named textarea
within the returned HTML, so I plug in the object as the context and
provide a selector, as below:

jQuery.post(updateUrl, updateParams, function(ajdata) {
CmdUtils.log(jQuery(textarea[name=cloudsource], 
ajdata).val()) },
 html);

Firebug just gives me unknown for the response.  If I remove the
slector, and just pass ajdata to CmdUtils.log, then I see a jQuery
object in Firebug.

At first I thought my selector was in error, but even changing it to
obvious things like body, div, etc produced the same undefined
in Firebug, so I guess I'm misunderstanding how context works for
jQuery.  Any insight would be appreciated.


[jQuery] Re: Jquery Problem in IE 6

2008-09-07 Thread µseless

Sorry, i didnt realize that i was writing in spanish. Here is the
traduction:

I had a trhouble with the .html() method, it seems to dont perform
successfully the append of script tags. Althought this code seems to
run fine, even if the html_data contains script tags
$(document).ready(function() {
$.ajax({
type: POST,
url: someurl.php,
dataType: html,
success: function(html_data) {

$
('#changeMe').html(html_data);
}
});
});

in some cases use to crash my application, just after the execution of
the script in the html_data. I couldnt find the conditions of the
crash but i change the jQuery library 1.2.3 in the line 152
changin this:
head.removeChild( script );
for this:
try{
head.removeChild( script );
}
catch(e){
   }
and voila. fixed para ie6

pd: I try to include the 1.2.6 before do this, but it brought me a lot
of conflicts with the prototype library, so i decide to implement this
solution.

On 6 sep, 17:59, kara swisher [EMAIL PROTECTED] wrote:
 sarah palinhttp://www.gpirate.com/search?q=sarah+palin

 2008/9/6 µseless [EMAIL PROTECTED]



  tube un problema similar con el .html(), cuando metia codigo
  javascript dentro del contenido me tiraba errores.
  Estaba usando la version 1.2.3, la version 1.2.6 no la podia usar
  porque me traia conflictos que no pude solucionar con Prototype.
  Finalmente termine debugeando la version 1.2.3 de jQuery y cambie en
  la linea 152
  esto:
  head.removeChild( script );
  por esto:
                         try{
                                 head.removeChild( script );
                         }
                         catch(e){

                         }
  y voila. fixed para ie6

  Joe ha escrito:
   Dear friends,

   i am working in a site, in which i have used jquery scripts.
   In Jquery the .html() is not working. I used .html() to print the
   output to one div from one file.
   If i use .html() in ie6 means the site in keep on loading.

   Please help me to fix the error.

   It is very *Urgent*


[jQuery] Get ID from HTML variable

2008-09-07 Thread Cristiano

Hi,
I have a variable (data) with html content.
I need only get the innerHTML(?) from one element in content. The
element is a div with id.
Sample:
htmlbodytabletrtddiv.../divdiv id=myDivmore html
here/div/td/tr/table/body/html

I try create a element with the variable content but this dont work...

In HTML/javascript I do:
var myObj = document.createElement(div);
myObj.innerHTML = data;
var myDiv = myObj.getElementById(myDiv);

How make this in jQuery?

tks
Cristiano



[jQuery] animate width or height form auto to fixed size _and back_?

2008-09-07 Thread stephen friedrich

I built a box/panel that collapses to the left, but so that the header
keeps visible with a small width.
By default (in expanded state) it should have width: auto.

Collapsing is easy:
   boxHeader.animate({width : '19px'}, 'fast');
However: Is there an easy way to expand it back?
It would be very nice if this would work, but it doesn't:
   boxHeader.animate({width : 'auto'}, 'fast');

What I have come up with so far seems clumsy and lengthy, which is not
really my impression of jQuery in general:

// Seems jquery cannot animate width/height with target auto.
var smallWidth = boxHeader.css('width'); // So first remember the
current (collapsed) width
boxHeader.css('width', 'auto'); // then temporarily set to auto
var newWidth = boxHeader.width(); // to calculate the desired width
boxHeader.css('width', smallWidth); // then set the collapsed width
again
boxHeader.animate({width : newWidth + px}, 'fast', // and animate to
the fixed expanded width
function() {boxHeader.css('width',
'auto');} // but set to auto again when animation is complete
);

Is there a better way?


[jQuery] Re: jqMock - mock library for jqUnit / QUnit

2008-09-07 Thread Kenneth Ko

Hi Colin,

Really great to hear back from you!

Regarding your question, jqMock can test that functions on one particular 
object are executed in a particular order
(see section on Ordered and Unordered Expectations in user guide).
However, the ordering is maintained within the mock for that object, so there 
is currently no support for 
ordering among multiple mocks.

Totally agree about putting jqUnit back into Qunit, as it is much too hard to 
maintain 2 versions of what is essentially the same codebase.

At the moment, I'm not sure whether I should continue with jqMock, 
considering that you are the only person who has noticed it =)
I've spent way too much time on it already, and JS is moving so quickly these 
days,
such much other stuff to try out!

Thanks again for the feedback! Keep me posted on how it goes with QUnit.
I'm quite familiar with the QUnit codebase so I'd be happy to help out with 
anything.


cheers,
Ken

 

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Colin 
Clark
Sent: Thursday, 4 September 2008 6:30 AM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: jqMock - mock library for jqUnit / QUnit


Hey Kenneth,

On 20-Aug-08, at 5:54 AM, fuzziman wrote:
 I've recently released a mock library for the jqUnit framework.

 It is intended to be a lightweight javascript Mock Framework, and 
 allows dependent functions such as native alert dialogs to be mocked 
 and tested in isolation.

 I hope this library can be useful for real life usage. Please have a 
 look, there's really detailed documentation and a user guide. I'm 
 looking forward to any code reviews and feedback!

 Hosted on google code at  http://code.google.com/p/jqmock/ 
 http://code.google.com/p/jqmock/

This is really impressive! Very cool stuff, and with excellent documentation. 
I'll definitely be using it in my tests.

A quick question: I'd love to be able to use jqMock to test the sequence of a 
set of function calls. So, for example, I'd like to be able to test that one 
function is always called before another function. I've hacked this up in a 
very simplistic way, but this seems like a perfect use for mocks. Is this 
possible in the current version of jqMock?

And a comment: I've been talking a bit with Jörn Zaefferer about merging 
anything of interest from jqUnit into QUnit now it is supported as a top-level 
API. While I haven't heard back from him recently, I'm looking forward to the 
prospect of jqUnit going away entirely in place of QUnit, since I never 
intended it as a product in itself. I've offered to help in any way I can.

Keep up the good work. I'm looking forward to seeing the new features you add 
to jqMock in the future!

Colin

---
Colin Clark
Technical Lead, Fluid Project
http://fluidproject.org


NOTICE
This e-mail and any attachments are confidential and may contain copyright 
material of Macquarie Group Limited or third parties. If you are not the 
intended recipient of this email you should not read, print, re-transmit, store 
or act in reliance on this e-mail or any attachments, and should destroy all 
copies of them. Macquarie Group Limited does not guarantee the integrity of any 
emails or any attached files. The views or opinions expressed are the author's 
own and may not reflect the views or opinions of Macquarie Group Limited.



[jQuery] Re: Somebody know javascript function?

2008-09-07 Thread timothytoe

There was an earlier discussion:

http://groups.google.com/group/jquery-en/browse_thread/thread/4480f62e57bd7e82?tvc=2q=detect+whether+images

On Sep 7, 12:58 pm, [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:
 hi all,
 i need to know, how can i indicate with javascript if the client
 browser are enable ito display images. sohow can i to check that?
 which functions are need for that?
 the client has to be informed, if his browser has to be adjusted at
 first, to be the images able to display.

 pls help and thanks a lot.

 best wishes,
 sarmad


[jQuery] periodically call a function

2008-09-07 Thread Jochen Kaechelin

I often use rails' periodically_call_remote to update a div for
example and render a partial with the newest database entries.

How will the JQuery way look like?

Thanx







[jQuery] Re: Get ID from HTML variable

2008-09-07 Thread Michael Geary

Cristiano, try this:

var data = 'htmlbodytabletrtddiv.../divdiv id=myDivmore
html here/div/td/tr/table/body/html';

var html = $(data).find('#myDiv').html();

alert( html );  // alerts 'more html here'

-Mike

 -Original Message-
 From: jquery-en@googlegroups.com 
 [mailto:[EMAIL PROTECTED] On Behalf Of Cristiano
 Sent: Sunday, September 07, 2008 3:15 PM
 To: jQuery (English)
 Subject: [jQuery] Get ID from HTML variable
 
 
 Hi,
 I have a variable (data) with html content.
 I need only get the innerHTML(?) from one element in content. The
 element is a div with id.
 Sample:
 htmlbodytabletrtddiv.../divdiv id=myDivmore html
 here/div/td/tr/table/body/html
 
 I try create a element with the variable content but this dont work...
 
 In HTML/javascript I do:
 var myObj = document.createElement(div);
 myObj.innerHTML = data;
 var myDiv = myObj.getElementById(myDiv);
 
 How make this in jQuery?
 
 tks
 Cristiano
 



[jQuery] Re: selectors in $.post return with HTML context

2008-09-07 Thread Michael Geary

Can you post a link to a test page that illustrates what you're trying to do
and what isn't working? It's pretty hard to tell what might be wrong without
seeing things like the HTML that the $.post() returns.

-Mike

 From: [EMAIL PROTECTED]
 
 I'm having trouble using a subsequent selector on an HTML 
 page returned from $.post, while trying to write a Ubiquity command.
 
 If I log or display ajdata, as returned from the $.post, it 
 contains the HTML page, as expected, and shows up as a jQuery 
 object in Firebug.
 
 What I want to do is use a jQuery selector to extract a named 
 textarea within the returned HTML, so I plug in the object as 
 the context and provide a selector, as below:
 
 jQuery.post(updateUrl, updateParams, function(ajdata) {
   
 CmdUtils.log(jQuery(textarea[name=cloudsource], 
 ajdata).val()) },  html);
 
 Firebug just gives me unknown for the response.  If I 
 remove the slector, and just pass ajdata to CmdUtils.log, 
 then I see a jQuery object in Firebug.
 
 At first I thought my selector was in error, but even 
 changing it to obvious things like body, div, etc 
 produced the same undefined
 in Firebug, so I guess I'm misunderstanding how context works 
 for jQuery.  Any insight would be appreciated.
 



[jQuery] Re: Determine if a Javascript has loaded?

2008-09-07 Thread Brad

Here is a different approach. Include the javascript source for the
weather.ibegin.com in the body of your page. On load run a delayed
function to see if it has written its forecast to your page. I ran
this on a test page and it worked. I could never get the ibegin source
to fail, therefore I had to change the script source to something else
like http://foo.weather.ibegin.com/... to simulate failure. BTW, I was
playing with the widget, so my example gets a different forecast than
yours.

script

var ibeginHTML;
function ibeginLoaded() {
ibeginHTML = $(#ibegin div).html();
if (ibeginHTML == null) {
alert('Widget not loaded');
// You'd do something useful here like insert your 
missing widget
image
}
}

function ibeginTest() {
// Give the widget a few seconds to load
setTimeout('ibeginLoaded();',2000);
}

$().ready(function(){
ibeginTest();
});

/script
/head
body
 ... other content ...
div id=ibegin
script type=text/javascript src=http://foo.weather.ibegin.com/js/
us/nm/santa+fe/1/1/1/1/1/
custom.jsbackground_color=ffcolor=00width=175padding=10border_width=1border_color=00font_size=11font_family=Tahomashowicons=1/
scriptnoscripta href=http://weather.ibegin.com/;Weather
Information by iBegin/a/noscript
/div
 ... more content ...
/body
/html

On Sep 7, 3:55 pm, bcbounders [EMAIL PROTECTED] wrote:
 OK... so here's what I've got so far.  I'm trying to work out the
 jQuery so that if the iBegin weather widget is successfully loaded,
 then the div id=weather is shown... otherwise, it's hidden.

 script type=text/javascript
         jQuery.ready(function(){
                 jQuery(#weather).replaceWith({
                         jQuery.ajax({
                                 type: GET,
                                 dataType: script,
                                 url: 
 http://weather.ibegin.com/js/us/ak/ninilchik/0/0/1/1/0/
 custom.jsbackground_color=transparentcolor=093384width=200padding=0border_width=0border_color=transparentfont_size=18font_family=inheritshowicons=1,
                                 success: function(){
                                                 jQuery(#weather).show()
                                         },
                                 error: function(){
                                                 jQuery(#weather).hide()
                                         }
                         });
                 });
         });
 /script

 But... what I've got isn't working.  And, being new to jQuery (and
 Javascript), I'm not sure why it's not working... or even if this is
 the best route to try and achieve what I want.

 Can someone take a look and provide some feedback?  I'd really
 appreciate it!

 Thanks a lot!

  - John

 On Sep 6, 10:49 am, bcbounders [EMAIL PROTECTED] wrote:

  Rene,

  Thanks so much for posting.

  I got the site up, using the iBegin weather widget on it's own.  If it
  helps, here's a link:  http://tinyurl.com/5n8mco

  I'll take a stab at doing what you suggest... wish me luck! :D  But...
  expect to hear more questions from me soon.

   - John


[jQuery] Re: Determine if a Javascript has loaded?

2008-09-07 Thread Michael Geary

Your code has a syntax error in it. Install Firebug in your Firefox browser
and enable it for your page. Then reload the page and you'l get an error
message. It's referring to is the {} in the .replaceWith({...}) call.

But fixing that won't help, because the logic is wrong. The code seems to be
assuming that jQuery.ajax({...}) will return the requested data as its
return value. It doesn't do that. The data you request isn't ready when
.ajax() returns. Instead, it is passed as an argument to the success:
function.

Fixing that won't help either, because the URL you're requesting doesn't
return anything you can use in this manner.

Open your weather URL directly in a browser and do a View Source:

http://weather.ibegin.com/js/us/ak/ninilchik/0/0/1/1/0/custom.jsbackground_
color=transparentcolor=093384width=200padding=0border_width=0border_col
or=transparentfont_size=18font_family=inheritshowicons=1

You will see that the URL doesn't return an HTML fragment suitable for
insertion into the DOM with .replaceWith(). Instead, it returns JavaScript
code consisting of a bunch of document.write() calls.

The way this widget is normally used is that you pass that URL as the src=
attribute of a script tag, correct?

You would need to execute this script, which would be easy enough to do with
an eval(), but that won't help (are you tired of me saying that?), because
the document.write() calls *must* be made during the initial page load, e.g.
from a script tag in your document.

But there's another problem. You're trying to do a .ajax() GET across
domains. You can't do that.

Basically, unless the widget provider offers another format for their
widget, you need to do it their way: Use that URL in a script
type=text/javascript src=.../script just like they say to do.

The one viable option if you want more control would be to create a second
.html file which is a complete page that loads the widget in that manner. In
your main page, use an iframe src=thatfile.html/iframe to include that
second .html file as an IFRAME.

Once you get that working, you can add additional JS code inside the IFRAME
to detect whether the widget was loaded successfully and hide it if not.

But what does not loaded successfully mean here? If the weather site is
down, you may get a long timeout before you are able to figure out it wasn't
loaded. Then if you hid it, you'd have a blank box appear on your page which
would then disappear some number of seconds after the page loads. You'd
probably want to substitute some message instead of that.

-Mike

 -Original Message-
 From: jquery-en@googlegroups.com 
 [mailto:[EMAIL PROTECTED] On Behalf Of bcbounders
 Sent: Sunday, September 07, 2008 2:56 PM
 To: jQuery (English)
 Subject: [jQuery] Re: Determine if a Javascript has loaded?
 
 
 OK... so here's what I've got so far.  I'm trying to work out 
 the jQuery so that if the iBegin weather widget is 
 successfully loaded, then the div id=weather is shown... 
 otherwise, it's hidden.
 
 script type=text/javascript
   jQuery.ready(function(){
   jQuery(#weather).replaceWith({
   jQuery.ajax({
   type: GET,
   dataType: script,
   url: 
 http://weather.ibegin.com/js/us/ak/ninilchik/0/0/1/1/0/
 custom.jsbackground_color=transparentcolor=093384width=200
 padding=0border_width=0border_color=transparentfont_size=18
 font_family=inheritshowicons=1,
   success: function(){
   
 jQuery(#weather).show()
   },
   error: function(){
   
 jQuery(#weather).hide()
   }
   });
   });
   });
 /script
 
 But... what I've got isn't working.  And, being new to jQuery 
 (and Javascript), I'm not sure why it's not working... or 
 even if this is the best route to try and achieve what I want.
 
 Can someone take a look and provide some feedback?  I'd 
 really appreciate it!
 
 Thanks a lot!
 
  - John
 
 On Sep 6, 10:49 am, bcbounders [EMAIL PROTECTED] wrote:
  Rene,
 
  Thanks so much for posting.
 
  I got the site up, using the iBegin weather widget on it's 
 own.  If it 
  helps, here's a link:  http://tinyurl.com/5n8mco
 
  I'll take a stab at doing what you suggest... wish me luck! 
 :D  But...
  expect to hear more questions from me soon.
 
   - John
 



[jQuery] Re: periodically call a function

2008-09-07 Thread Sam Sherlock
theres this here
http://www.ngcoders.com/pquery/demos/ajax/

coded like so inside a document ready:
setInterval(function() { $.ajax({url: index.php?task=ajaxtimernd=+new
Date().getTime()+, success:
function(response){$(#idtime).html(response);}, dataType: html}) },1000)


I think the jquery spy plugin might be helpful in achieving your goal
http://leftlogic.com/lounge/articles/jquery_spy2/

2008/9/8 Jochen Kaechelin [EMAIL PROTECTED]


 I often use rails' periodically_call_remote to update a div for
 example and render a partial with the newest database entries.

 How will the JQuery way look like?

 Thanx








RE: Compilation on OpenVMS

2008-09-07 Thread Senn, Michael - Acision
 -Original Message-
 From: Gavin Henry [mailto:[EMAIL PROTECTED]
 Sent: Thursday, 4 September 2008 21:01
 To: Senn, Michael - Acision
 Cc: openldap-software@openldap.org
 Subject: Re: Compilation on OpenVMS

 Senn, Michael - Acision wrote:
  Good Morning,
 
  I am currently involved in an investigation to start using OpenLDAP
 on OpenVMS within our company. Part of this investigation has been
 digging through the mail lists, I find that there were some questions
 about compilation on OpenVMS back between 2000 and 2003. Since then it
 appears to have ED] wrote:

  How would I check if the value of a given text field is valid
  according to the rules specified with the Validation plugin (returning
  true or false) without triggering validation?