[jQuery] Re: Ajax forms help

2010-01-11 Thread Ibatex
The beauty of json is that you can transfer alot of different data in
an organized way. You can very easily send back success/failure status
along with the html.

success: function(response) {
// Response was a success
if (response.status) {
//update my target div
$('#target_div').html(response.html);
// Response contains errors
} else {
// return the form with the errors

}

On Jan 10, 5:00 pm, Dave Maharaj :: WidePixels.com
d...@widepixels.com wrote:
 I need some help with a form.

 I submit the form fine, my problem is depending on the success or failure of
 the form being saved. I will try to explain as simple as possible

 form is in its own div form here . 

 div target saved data will appear here/div

 So what I need is i guess json success true or false response from the form
 being saved or not then in my success

 success: function(response) {
                         // Response was a success
                         if (response) {
                                 //update my target div
                         // Response contains errors
                         } else {
                                 // return the form with the errors

                         }

 But if I am returning json I cant return my normal html after the successful
 save, and if I return my response as html there is no way to tell the js
 what to do.
 The form or the target is html code

 How can I tell what the response was (true or false) and return the
 appropriate html code for the appropriate form or target?

 Thanks

 Dave


[jQuery] Foreign charachters in .post()

2010-01-11 Thread youradds
Hi,

Got a bit of a weird one here :/

The following code works fine:

  jQuery.post(/cgi-bin/review.cgi, {
Review_Rating: the_rating,
ID:  theID,
add_this_review: 1,
Review_Contents: contents,
Review_Subject: subject,
Review_ByLine: byline,
Review_GuestName: guestname,
Review_GuestEmail: guestemail,
add_review: 1,
SecurityImage: SecurityImage,
SessionID: SessionID
  }, function(response){

jQuery('#ajax_rate_indicator').fadeOut();
setTimeout(finishAjaxReview('the_rating_box', '+escape
(response)+'), 400);
  });

...*appart* from the fact stuff like:

ö =
ä =
ü =

..gets converted to:

ö =
ä =
ü =

I did a little bit of research, and found something about adding this
(but this seems to really be for a different jQuery function - which
is probably why its not working);

contentType: application/x-www-form-
urlencoded;charset=ISO-8859-15,

Can anyone suggest how I could fix this issue with foreign
charachters?

TIA

Andy


[jQuery] How to be able to preload jquery contents into hidden tabs for ie browser

2010-01-11 Thread samara

The problems im facing is when I use something like jcarousellite inside
tabs. It works fine in browsers other than ie. In ie, the carousel loads
fine in the active tab, but in the inactive ones it doesnt preload.
Basically when you click on a previously inactive tab, it displays nothing
until you click outside the tab. 

I have narrowed down the problem to this: My tabs use a css style where the
inactive tabs set the display to none. This somehow in ie causes whatever
jquery that is contained within not to load before hand. If I remove this
display: none property, all my carousels show fine, but ofcourse so do all
the tabs (i.e. they are no longer hidden when inactive, instead all are
shown as overlapping blocks on the page). How can I overcome this issue?
Note: all elements used are div elements
-- 
View this message in context: 
http://old.nabble.com/How-to-be-able-to-preload-jquery-contents-into-hidden-tabs-for-ie-browser-tp27107036s27240p27107036.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: Foreign charachters in .post()

2010-01-11 Thread youradds
I found a way to do this in the .cgi script - but obviously I'd prefer
to do it vai the AJAX submission, instead of having to encode it
properly at the server end :)

my $contents = $IN-param('Review_Contents');
   $contents =~ s/([\200-\377]+)/from_utf8({ -string = $1, -
charset = 'ISO-8859-1'})/eg;
$IN-param('Review_Contents' = $contents );


TIA

Andy

On Jan 11, 8:15 am, youradds andy.ne...@gmail.com wrote:
 Hi,

 Got a bit of a weird one here :/

 The following code works fine:

               jQuery.post(/cgi-bin/review.cgi, {
                 Review_Rating: the_rating,
                         ID:  theID,
                         add_this_review: 1,
                         Review_Contents: contents,
                         Review_Subject: subject,
                         Review_ByLine: byline,
                         Review_GuestName: guestname,
                         Review_GuestEmail: guestemail,
                         add_review: 1,
                         SecurityImage: SecurityImage,
                         SessionID:     SessionID
               }, function(response){

                 jQuery('#ajax_rate_indicator').fadeOut();
                 setTimeout(finishAjaxReview('the_rating_box', '+escape
 (response)+'), 400);
               });

 ...*appart* from the fact stuff like:

 ö =
 ä =
 ü =

 ..gets converted to:

 ö =
 ä =
 ü =

 I did a little bit of research, and found something about adding this
 (but this seems to really be for a different jQuery function - which
 is probably why its not working);

                         contentType: application/x-www-form-
 urlencoded;charset=ISO-8859-15,

 Can anyone suggest how I could fix this issue with foreign
 charachters?

 TIA

 Andy


[jQuery] Re: Generating a CSV of values from a bunch of Checkboxes with same id

2010-01-11 Thread Gordon
I think I should point out that you can't have more than one element
with the same ID, they are by definition unique.  The reason is that
the getElementById method depends on there being only one item with
the ID passed to it in the DOM.  If there is more than one item then
behaviour is undefined.

If you want to treat your checkboxes as a group, then give them the
same class instead.

input type=checkbox class=chkGenre rel=genre value=12
title=Rock /

On Jan 9, 1:57 pm, swfobject_fan guru4v...@gmail.com wrote:
 Hi,

 I'm using this piece of code to find a set of selected check boxes
 that are selected abd build a comma separated list from their values
 ('txt' custom attribute). Is this a jQuery standard method?

 e.g
 input type=checkbox id=chkGenre rel=genre value=12
 txt=Rock / br /
 input type=checkbox id=chkGenre rel=genre value=13 txt=Jazz /



 script type=text/javascript
 $(document).ready(function(){

         $(#tryme).click( function(){
                 var oChecked = $(input[rel='genre']:checked);
                 var checkedGenres = new Array;
                 for( var i=0; ioChecked.length; i++ ) {
                         checkedGenres[i] = oChecked[i].getAttribute('txt');
                 }

                 alert( checkedGenres.join(, ) );
                 $(#divGenres).text(checkedGenres.join(, ));
         });

 });

 /script


[jQuery] Problem with jquery tabs on live site

2010-01-11 Thread Coxy
I used jquery tabs on an html mock-up and everything worked perfectly,
click on tabs changes them.

I then tried to impliment tabs on the live site and there are some
differences. First when you click on a tab the tab text is replaced
with the words 'loading' and then the whole page is some how loaded
into the tab. The content is displayed below the inserted page, but is
completely ignored by jquery.

What could be the cause of this?


[jQuery] Re: Easy way to do this in jQuery?

2010-01-11 Thread Nalum
Hello Nick,
I've put up a very basic view of what you're looking for here
http://pastebin.com/f4f2a029e

Hope this helps you get what you're looking for.

If you need more help let me know.

Nalum

On Jan 10, 11:25 pm, Nick Le Mouton nood...@planetslackers.com
wrote:
 Hi everyone,

 I've just started using jQuery and so far I'm impressed with the power
 and simplicity of it.

 At the moment I'm looking for a better way to do the shape dropdown
 selector onhttp://www.drugs.com/imprints.php. It's currently done
 with a bit of ddrive and some custom code, but I'd rather use a jQuery
 plugin if I can find one.

 Can anyone point me in the direction of a good plugin that will do
 this?

 Thanks
 Nick


[jQuery] Re: Problem with jquery tabs on live site

2010-01-11 Thread Šime Vidas

Have you considered giving us the link to the live site?


[jQuery] long-term browser support strategy

2010-01-11 Thread mikewse
What is jQuery's long-term strategy for browser support - cut off
browsers after a certain number of years or when going below a certain
market share?

[I'm asking because of the current trend (among some webdevs and also
library developers) advocating to remove IE6 support and force these
users to upgrade their browser. I work with several clients that do
not want to lead the way in this respect, and need to support IE6 as
long as it has a fair usage share, which may be for several more
years.]

Thanks
Mike


[jQuery] Displaying reviews using js widgets such as in freeindex.co.uk

2010-01-11 Thread SkilliPedia
Hi jQuery gurus,

I have a website where services, software,etc get reviewed. What i
want to do is enable users to display reviews in their own websites as
testimonials and as extra backlink for me.

I am looking for  a js widget that can do that. My web application is
coded in Java

I am looking for a similar solution similar to  freeindex.co.uk and
here is  a website displaying  reviews from freeindex:
http://www.zest4lifeuk.com/

Thanks


[jQuery] Superfish - any way to change the color?

2010-01-11 Thread zeebaah
Hello.
Ive just got the Superfish mod for my site but the blue color dosnt
look good with the design on my page and makes it impossible to read
the text in the menu, any way to change the color of the menu to red
like the old menu at (http://medielinjen.pgu.dk/joomla)
youll be able to see how the menu look at the menu point
(Arrangementslisten - 
http://medielinjen.pgu.dk/joomla/index.php?option=com_contentview=articleid=122Itemid=63)



Best regards
Zeebaah


[jQuery] Superfish Move sub items

2010-01-11 Thread NetReach Australia
Hi,
I'm using Superfish menu system on my website and I am attempting to
move the sub items across, but when I put a margin-left on it, it
moves both the sub items and the sub sub items. How can I have only
the sub items move?


[jQuery] Re: How to be able to preload jquery contents into hidden tabs for ie browser

2010-01-11 Thread Šime Vidas

You say, you have jQuery code inside the DIVs?
The code should be at the bottom of the page, right before you close
BODY.




NOTE! Instructions how to make it easier for us to help you:
1. Go here http://vidasp.net/HTML5-template.html
2. Copy the code into a text-editor.
3. Write a simple demo demonstrating your problem.
4. If you have an active hosting, put the demo online and reply the
link here.
Otherwise, copy the complete code and reply it here.


Re: [jQuery] Superfish - any way to change the color?

2010-01-11 Thread Charlie




modify the superfish.css to accomodate design

zeebaah wrote:

  Hello.
Ive just got the Superfish mod for my site but the blue color dosnt
look good with the design on my page and makes it impossible to read
the text in the menu, any way to change the color of the menu to red
like the old menu at (http://medielinjen.pgu.dk/joomla)
youll be able to see how the menu look at the menu point
(Arrangementslisten - http://medielinjen.pgu.dk/joomla/index.php?option=com_contentview=articleid=122Itemid=63)



Best regards
Zeebaah

  





[jQuery] Re: jcarousel issues

2010-01-11 Thread Šime Vidas

I am completely unable to help you based on your supplied info.


NOTE! Instructions how to make it easier for us to help you:
1. Go here http://vidasp.net/HTML5-template.html
2. Copy the code into a text-editor.
3. Write a simple demo demonstrating your problem.
4. If you have an active hosting, put the demo online and reply the
link here.
Otherwise, copy the complete code and reply it here.


[jQuery] Re: Superfish IE6 dies with opacity CSS attribute

2010-01-11 Thread Šime Vidas

You mean UL LI UL LI, instead of UL LI LI?
Because you're not supposed to put LIs inside LIs...


[jQuery] Re: Optimized jQuery

2010-01-11 Thread Scott Sauyet
On Jan 10, 8:14 pm, Adrian Lynch adely...@googlemail.com wrote:
 I get a bad feeling when I'm asked to go to a site using IE!

 Anyone had a look?

I couldn't see anything strange with IE.  What animations are causing
problems?

  -- Scott


[jQuery] Re: Problem with jquery tabs on live site

2010-01-11 Thread Coxy
Sorry, I wasn't sure if one was needed. Here is an example:

http://krautspotter.bungert.co.uk/article/goerlitzer-park.html

This loading of the whole page never happened with the static mock-up.
Also jquery seems to have created it's own tabs. I never called them
hrefs like #ui-tabs-22


[jQuery] Re: long-term browser support strategy

2010-01-11 Thread Šime Vidas

It would be really stupid (for a JS library) to cut off any browser
with market-share above 1%, especially IE6 which won't go below 1%
until maybe 2011.
You can be sure, they won't do that.

The big sites (Youtube, Facebook, ...) are doing a good job in asking
their visitors to upgrade, but IE6 is (reportedly) big in companies
where the regular employee cannot just upgrade if he wants to.


Re: [jQuery] Superfish Move sub items

2010-01-11 Thread Charlie




The sub menu ul's are absolute positioned at {left:-999} when not
visible, then at {left:0} when visible.

To adjust position you need to modify the {left:0} 

NetReach Australia wrote:

  Hi,
I'm using Superfish menu system on my website and I am attempting to
move the sub items across, but when I put a margin-left on it, it
moves both the sub items and the sub sub items. How can I have only
the sub items move?

  





Re: [jQuery] Re: Superfish IE6 dies with opacity CSS attribute

2010-01-11 Thread Charlie




UL LI LI will still work as CSS selector. The second LI is still a
descendant of the first one, regradless of it's parent and the css is
written that way. 

ime Vidas wrote:

  You mean UL LI UL LI, instead of UL LI LI?
Because you're not supposed to put LIs inside LIs...

  





[jQuery] Re: Superfish IE6 dies with opacity CSS attribute

2010-01-11 Thread Šime Vidas
It violates the standard and you should avoid such practice.

Proper nesting:

ul
liFirst
ul
liOne/li
liTwo/li
/ul
/li
liSecond/li
/ul

Please, put a demo of the problem online...


Re: [jQuery] Re: Superfish IE6 dies with opacity CSS attribute

2010-01-11 Thread Jonathan Vanherpe (T T NV)

Šime Vidas wrote:

It violates the standard and you should avoid such practice.

Proper nesting:

ul
 liFirst
 ul
 liOne/li
 liTwo/li
 /ul
 /li
 liSecond/li
/ul

Please, put a demo of the problem online...



It's perfectly ok to omit the ul's in your css selector, but the HTML 
has to be like you posted, yes. It's not exactly clear from his post 
what cubefree did, though.


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


Re: [jQuery] Re: Superfish IE6 dies with opacity CSS attribute

2010-01-11 Thread Charlie




my point is to not confuse someone with a css problem by having to
change css selectors that work, and is the basis for structure of the
css in superfish

jQuery would work also with same selector $("ul li li"). The html
needs to be vaild for sure but OP was css

ime Vidas wrote:

  It violates the standard and you should avoid such practice.

Proper nesting:

ul
liFirst
ul
liOne/li
liTwo/li
/ul
/li
liSecond/li
/ul

Please, put a demo of the problem online...

  





[jQuery] Re: Extracting content from a div?

2010-01-11 Thread youradds
Hi,

Thanks for the reply. I tested that code, and it works - the problem
is, there are newlines etc in the page too - how would I go about
that?

Also, all I really need is the erorr message ...i.e:

Gast Email der Rezension kann nicht den Wert 'undefined'

How would I go about this?

TIA!

Andy

On Jan 10, 7:39 am, Andrei Eftimie k3liu...@gmail.com wrote:
 I'm suspecting youdo an ajax call, you get a page, but only need a
 part of it injected into your own.
 There might be a better solution, but this should work.

 data =  '...div class=errorulliGast Email der Rezension kann
 nicht den Wert 'undefined'speichern./li/ul/div...';

 data = data.substring(data.indexOf('div class=error'));
 data = data.substring(0,data.indexOf('/div')+6);



 On Sat, Jan 9, 2010 at 1:49 PM, youradds andy.ne...@gmail.com wrote:

  Hi,

  I need to try and extract the following from a STRING (not the current
  page);

                         div class=error
                                 ul
                                         liGast Email der Rezension kann 
  nicht den Wert 'undefined'
                                         speichern./li
                                 /ul
                         /div

  How would I do this?  I had a look on google, but all they seem to be
  talking about is extracting from the current page, which I don't want :
  (

  TIA!

  Andy

 --
 Andrei Eftimiehttp://eftimie.com
 +40 758 833 281

 Puncthttp://designpunct.ro


[jQuery] Re: Extracting content from a div?

2010-01-11 Thread youradds
Hi,

Thanks for the reply. However, your code only seems to be any good
with the actual page content you are on, not the values of a string?
Remember, this data is coming through as a string (as a response from
a jQuery .post() function, so the returned HTML then holds errors
which may have occured - and I need to pick up on those :))

TIA

Andy



On Jan 9, 11:09 pm, Leonardo Balter leonardo.bal...@gmail.com wrote:
 2010/1/9 youradds andy.ne...@gmail.com



  Hi,

  Thanks. Ok, I have this string (for example):

  html
  head/head
  body

  bit of other junk here, and maybe other divs and stuff

                         div class=error
                                 ul
                                         liGast Email der Rezension
  kann nicht den Wert 'undefined'
                                         speichern./li
                                 /ul
                         /div

  some junk here

  /body
  /html

  So how exactly would I extract that from a string?

  TIA :)

  Andy

  On Jan 9, 1:32 pm, Leonardo Balter leonardo.bal...@gmail.com wrote:
   And you can simply use .text() method. This will return you only the text
   inside your selected element.

   Do you also need tips on getting the child elements on that div?

   --
   At,
   Leo Balterhttp://leobalter.net
   Blog técnico:http://blog.leobalter.net

 Based on jquery documentation:

 First, you can define your selectors, it's the easier way if you already
 work with CSSs:

 http://docs.jquery.com/Selectors

 You can use something like: $('.error  ul  li').text(); to match all li's
 inside the element with class set to 'error' (the . referees a element using
 class name right after the dot).

 You can also use $('.error ul li').text() to get each li descending from a
 ul than from a element with a class named 'error'. In our .text() method
 this won't make much diference than using the first selector.

 Now let's try some jquery methods without complicating our basic selector:

 We have the .find() and .children() methods

 From now I'm adapting the text from jquery documentation to our example:

 In most cases two selections made with and without find() are equivalent,
 such as $('.error').find('li') and $('.error ul li'). However, using a
 selector filter may lead to unexpected results:
 $('.error').find('li:first').length may be  1, (whereas $('.error
 li:first').length will never be  1) as there is an implicit each() done
 within find().

 In other words: you can try to select the first li of all div with the class
 attribute named 'error'.

 Now the .children(), this method will return all the immediate descendants
 elements within the selected element.

 Example: $('.error').children('ul').children('li') this will return exactly
 the directly children of the .error! .find() would return all descendants,
 not only the immediate ones.

 As said in the jquery documentation, it's important to refrain here: while
 .children() returns only the immediate descendants, .parents() will look at
 all ancestors.

 That's all,

 Have a good day.

 --
 At,
 Leo Balterhttp://leobalter.net
 Blog técnico:http://blog.leobalter.net


Re: [jQuery] Re: Extracting content from a div?

2010-01-11 Thread John Arrowwood
If the html is in a string, e.g. 's':

$(s).html() would return everything inside the outer div.

If it includes more than just that error, you can do something like:

$(s).find('div.error').html()

On Mon, Jan 11, 2010 at 6:42 AM, youradds andy.ne...@gmail.com wrote:

 Hi,

 Thanks for the reply. However, your code only seems to be any good
 with the actual page content you are on, not the values of a string?
 Remember, this data is coming through as a string (as a response from
 a jQuery .post() function, so the returned HTML then holds errors
 which may have occured - and I need to pick up on those :))

 TIA

 Andy



 On Jan 9, 11:09 pm, Leonardo Balter leonardo.bal...@gmail.com wrote:
  2010/1/9 youradds andy.ne...@gmail.com
 
 
 
   Hi,
 
   Thanks. Ok, I have this string (for example):
 
   html
   head/head
   body
 
   bit of other junk here, and maybe other divs and stuff
 
  div class=error
  ul
  liGast Email der Rezension
   kann nicht den Wert 'undefined'
  speichern./li
  /ul
  /div
 
   some junk here
 
   /body
   /html
 
   So how exactly would I extract that from a string?
 
   TIA :)
 
   Andy
 
   On Jan 9, 1:32 pm, Leonardo Balter leonardo.bal...@gmail.com wrote:
And you can simply use .text() method. This will return you only the
 text
inside your selected element.
 
Do you also need tips on getting the child elements on that div?
 
--
At,
Leo Balterhttp://leobalter.net
Blog técnico:http://blog.leobalter.net
 
  Based on jquery documentation:
 
  First, you can define your selectors, it's the easier way if you already
  work with CSSs:
 
  http://docs.jquery.com/Selectors
 
  You can use something like: $('.error  ul  li').text(); to match all
 li's
  inside the element with class set to 'error' (the . referees a element
 using
  class name right after the dot).
 
  You can also use $('.error ul li').text() to get each li descending
 from a
  ul than from a element with a class named 'error'. In our .text() method
  this won't make much diference than using the first selector.
 
  Now let's try some jquery methods without complicating our basic
 selector:
 
  We have the .find() and .children() methods
 
  From now I'm adapting the text from jquery documentation to our example:
 
  In most cases two selections made with and without find() are
 equivalent,
  such as $('.error').find('li') and $('.error ul li'). However, using a
  selector filter may lead to unexpected results:
  $('.error').find('li:first').length may be  1, (whereas $('.error
  li:first').length will never be  1) as there is an implicit each() done
  within find().
 
  In other words: you can try to select the first li of all div with the
 class
  attribute named 'error'.
 
  Now the .children(), this method will return all the immediate
 descendants
  elements within the selected element.
 
  Example: $('.error').children('ul').children('li') this will return
 exactly
  the directly children of the .error! .find() would return all
 descendants,
  not only the immediate ones.
 
  As said in the jquery documentation, it's important to refrain here:
 while
  .children() returns only the immediate descendants, .parents() will look
 at
  all ancestors.
 
  That's all,
 
  Have a good day.
 
  --
  At,
  Leo Balterhttp://leobalter.net
  Blog técnico:http://blog.leobalter.net




-- 
John Arrowwood
John (at) Irie (dash) Inc (dot) com
John (at) Arrowwood Photography (dot) com
John (at) Hanlons Razor (dot) com
--
http://www.irie-inc.com/
http://arrowwood.blogspot.com/


Re: [jQuery] How to be able to preload jquery contents into hidden tabs for ie browser

2010-01-11 Thread samara

I have found the solution to this and this may come in handy for anyone who
wants to use tabs (with display: none property) where the content requires
initialization at page load.

Simply change your hidden tab style in the css as follows:

.tabhide {
  position: absolute;
  top: -5000px;

}

I have tried other things such as visibility: hidden or even bottom:
-5000px, but this seemed to be best solution to render it properly in ie
browsers

samara wrote:
 
 The problems im facing is when I use something like jcarousellite inside
 tabs. It works fine in browsers other than ie. In ie, the carousel loads
 fine in the active tab, but in the inactive ones it doesnt preload.
 Basically when you click on a previously inactive tab, it displays nothing
 until you click outside the tab. 
 
 I have narrowed down the problem to this: My tabs use a css style where
 the inactive tabs set the display to none. This somehow in ie causes
 whatever jquery that is contained within not to load before hand. If I
 remove this display: none property, all my carousels show fine, but
 ofcourse so do all the tabs (i.e. they are no longer hidden when inactive,
 instead all are shown as overlapping blocks on the page). How can I
 overcome this issue?
 Note: all elements used are div elements
 

-- 
View this message in context: 
http://old.nabble.com/How-to-be-able-to-preload-jquery-contents-into-hidden-tabs-for-ie-browser-tp27107036s27240p27111679.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Reverse Xpath of a Node

2010-01-11 Thread Antonello Pasella
Is there a simple way (not multiple parent() and counting
prevSiblings) to know which is the XPath of and element selected by a
click (like firebug) ?


RE: [jQuery] Re: Ajax forms help

2010-01-11 Thread Dave Maharaj :: WidePixels.com
Right on...looks easy enough.

Is response.html saying to display it as html? I tried making an array to
pass as json from php then json_encode it so my arrr was $response =
array('status' = true , 'view' = 'all my html code went here')

But when I returned my view data from the array it was all slahsed // //
/ / / like that.

-Original Message-
From: Ibatex [mailto:mjgris...@gmail.com] 
Sent: January-11-10 4:35 AM
To: jQuery (English)
Subject: [jQuery] Re: Ajax forms help

The beauty of json is that you can transfer alot of different data in an
organized way. You can very easily send back success/failure status along
with the html.

success: function(response) {
// Response was a success
if (response.status) {
//update my target div
$('#target_div').html(response.html);
// Response contains errors
} else {
// return the form with the errors

}

On Jan 10, 5:00 pm, Dave Maharaj :: WidePixels.com
d...@widepixels.com wrote:
 I need some help with a form.

 I submit the form fine, my problem is depending on the success or 
 failure of the form being saved. I will try to explain as simple as 
 possible

 form is in its own div form here . 

 div target saved data will appear here/div

 So what I need is i guess json success true or false response from the 
 form being saved or not then in my success

 success: function(response) {
                         // Response was a success
                         if (response) {
                                 //update my target div
                         // Response contains errors
                         } else {
                                 // return the form with the errors

                         }

 But if I am returning json I cant return my normal html after the 
 successful save, and if I return my response as html there is no way 
 to tell the js what to do.
 The form or the target is html code

 How can I tell what the response was (true or false) and return the 
 appropriate html code for the appropriate form or target?

 Thanks

 Dave
No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 9.0.725 / Virus Database: 270.14.130/2607 - Release Date: 01/10/10
16:05:00



[jQuery] Re: Extracting content from a div?

2010-01-11 Thread youradds
Thanks, will give that a go :)

On Jan 11, 2:48 pm, John Arrowwood jarro...@gmail.com wrote:
 If the html is in a string, e.g. 's':

 $(s).html() would return everything inside the outer div.

 If it includes more than just that error, you can do something like:

 $(s).find('div.error').html()



 On Mon, Jan 11, 2010 at 6:42 AM, youradds andy.ne...@gmail.com wrote:
  Hi,

  Thanks for the reply. However, your code only seems to be any good
  with the actual page content you are on, not the values of a string?
  Remember, this data is coming through as a string (as a response from
  a jQuery .post() function, so the returned HTML then holds errors
  which may have occured - and I need to pick up on those :))

  TIA

  Andy

  On Jan 9, 11:09 pm, Leonardo Balter leonardo.bal...@gmail.com wrote:
   2010/1/9 youradds andy.ne...@gmail.com

Hi,

Thanks. Ok, I have this string (for example):

html
head/head
body

bit of other junk here, and maybe other divs and stuff

                       div class=error
                               ul
                                       liGast Email der Rezension
kann nicht den Wert 'undefined'
                                       speichern./li
                               /ul
                       /div

some junk here

/body
/html

So how exactly would I extract that from a string?

TIA :)

Andy

On Jan 9, 1:32 pm, Leonardo Balter leonardo.bal...@gmail.com wrote:
 And you can simply use .text() method. This will return you only the
  text
 inside your selected element.

 Do you also need tips on getting the child elements on that div?

 --
 At,
 Leo Balterhttp://leobalter.net
 Blog técnico:http://blog.leobalter.net

   Based on jquery documentation:

   First, you can define your selectors, it's the easier way if you already
   work with CSSs:

  http://docs.jquery.com/Selectors

   You can use something like: $('.error  ul  li').text(); to match all
  li's
   inside the element with class set to 'error' (the . referees a element
  using
   class name right after the dot).

   You can also use $('.error ul li').text() to get each li descending
  from a
   ul than from a element with a class named 'error'. In our .text() method
   this won't make much diference than using the first selector.

   Now let's try some jquery methods without complicating our basic
  selector:

   We have the .find() and .children() methods

   From now I'm adapting the text from jquery documentation to our example:

   In most cases two selections made with and without find() are
  equivalent,
   such as $('.error').find('li') and $('.error ul li'). However, using a
   selector filter may lead to unexpected results:
   $('.error').find('li:first').length may be  1, (whereas $('.error
   li:first').length will never be  1) as there is an implicit each() done
   within find().

   In other words: you can try to select the first li of all div with the
  class
   attribute named 'error'.

   Now the .children(), this method will return all the immediate
  descendants
   elements within the selected element.

   Example: $('.error').children('ul').children('li') this will return
  exactly
   the directly children of the .error! .find() would return all
  descendants,
   not only the immediate ones.

   As said in the jquery documentation, it's important to refrain here:
  while
   .children() returns only the immediate descendants, .parents() will look
  at
   all ancestors.

   That's all,

   Have a good day.

   --
   At,
   Leo Balterhttp://leobalter.net
   Blog técnico:http://blog.leobalter.net

 --
 John Arrowwood
 John (at) Irie (dash) Inc (dot) com
 John (at) Arrowwood Photography (dot) com
 John (at) Hanlons Razor (dot) com
 --http://www.irie-inc.com/http://arrowwood.blogspot.com/


[jQuery] Re: Displaying reviews using js widgets such as in freeindex.co.uk

2010-01-11 Thread Scott Sauyet
On Jan 10, 11:49 pm, SkilliPedia skillipe...@googlemail.com wrote:
 I have a website where services, software,etc get reviewed. What i
 want to do is enable users to display reviews in their own websites as
 testimonials and as extra backlink for me.

 I am looking for  a js widget that can do that. My web application is
 coded in Java

I think doing this in jQuery would be a really heavy-weight solution.
Requiring your users to include jQ on their page just to add your
widget seems rather much, especially as this probably doesn't need to
do too much.  The example you point to formats everything server-side
as a single call to document.write().  That would probably be the
easiest approach.

That said, if you do choose to use jQuery, I suppose you can add it
yourself in your script, with something like this:

var script = document.createElement(script);
script.src = http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/
jquery.min.js;
script.type = text/javascript;
document.getElementsByTagName(head)[0].appendChild(script);

From here you could request a JSONP call from your server in this
format:

callbackName({status: ok, reviews: [{rating: 7, reviewer:
Fred, comments: Loved it!}, {/* etc */}]});

with code that looks like this:

$.getJSON(http://api.flickr.com/services/feeds/photos_public.gne?
tags=cattagmode=anyformat=jsonjcallback=?,
function(data) {
if (data.status == ok) {
$.each(data.reviews, function(i, review){
// do something with review
});
} else {
// report error or ignore as you like
}
);

The trouble I see with doing it this way is that you will need hook
into the DOM on an arbitrary site, or proceed with additional
document.write statements in any case.  And if you have to do the
latter, why not simply format the server-side response as
document.write statements?

Good luck,

  -- Scott


[jQuery] Re: Ajax forms help

2010-01-11 Thread MorningZ
But if I am returning json I cant return my normal html

I don't understand why...

I pretty much exclusively use JSON back and forth in my jQuery AJAX
calls and have a standard JSON object i return:

{
   HasError: boolean,
   Message: string.
   Data: object,
   Count: integer
}

Many times i'll return HTML on the data property there  i think
the problem you are having is how you are creating the JSON return
string, maybe that's not the right way to do it in PHP ??  (to note,
i'm a .NET guy, i don't know what the PHP way is)

On Jan 11, 10:06 am, Dave Maharaj :: WidePixels.com
d...@widepixels.com wrote:
 Right on...looks easy enough.

 Is response.html saying to display it as html? I tried making an array to
 pass as json from php then json_encode it so my arrr was $response =
 array('status' = true , 'view' = 'all my html code went here')

 But when I returned my view data from the array it was all slahsed // //
 / / / like that.

 -Original Message-
 From: Ibatex [mailto:mjgris...@gmail.com]
 Sent: January-11-10 4:35 AM
 To: jQuery (English)
 Subject: [jQuery] Re: Ajax forms help

 The beauty of json is that you can transfer alot of different data in an
 organized way. You can very easily send back success/failure status along
 with the html.

 success: function(response) {
                         // Response was a success
                         if (response.status) {
                                 //update my target div
                                 $('#target_div').html(response.html);
                         // Response contains errors
                         } else {
                                 // return the form with the errors

                         }

 On Jan 10, 5:00 pm, Dave Maharaj :: WidePixels.com
 d...@widepixels.com wrote:
  I need some help with a form.

  I submit the form fine, my problem is depending on the success or
  failure of the form being saved. I will try to explain as simple as
  possible

  form is in its own div form here . 

  div target saved data will appear here/div

  So what I need is i guess json success true or false response from the
  form being saved or not then in my success

  success: function(response) {
                          // Response was a success
                          if (response) {
                                  //update my target div
                          // Response contains errors
                          } else {
                                  // return the form with the errors

                          }

  But if I am returning json I cant return my normal html after the
  successful save, and if I return my response as html there is no way
  to tell the js what to do.
  The form or the target is html code

  How can I tell what the response was (true or false) and return the
  appropriate html code for the appropriate form or target?

  Thanks

  Dave
 No virus found in this incoming message.
 Checked by AVG -www.avg.com
 Version: 9.0.725 / Virus Database: 270.14.130/2607 - Release Date: 01/10/10
 16:05:00


Re: [jQuery] How to apply limits to an animation

2010-01-11 Thread Jon Banner
have a look at the jCarousel plugin - i think that should do what you need.

http://sorgalla.com/jcarousel/

Jon

2010/1/9 JQNovice i...@chamonixmountainguides.com

 I am very new to JQuery but so far very happy with ease of use.

 I have created a series of thumbnails that slide as the left, right
 buttons are clicked:
 http://www.lisaauer.com/jquery_imageslide/

 I want the images to slide left or right only so far that there are
 always images filling the slide div and then stop. i.e. no white
 space.
 Or,
 Create a loop of images such that they keep repeating.

 Any assistance appreciated. Please remember you are talking with a
 novice!

 Thanks.



[jQuery] Re: Extracting content from a div?

2010-01-11 Thread youradds
Thanks - this works perfectly now:

  var test = jQuery(response).find('div.error ul li').html();


Thanks agian for the help everone - much appreciated

Cheers

Andy



On Jan 11, 2:48 pm, John Arrowwood jarro...@gmail.com wrote:
 If the html is in a string, e.g. 's':

 $(s).html() would return everything inside the outer div.

 If it includes more than just that error, you can do something like:

 $(s).find('div.error').html()



 On Mon, Jan 11, 2010 at 6:42 AM, youradds andy.ne...@gmail.com wrote:
  Hi,

  Thanks for the reply. However, your code only seems to be any good
  with the actual page content you are on, not the values of a string?
  Remember, this data is coming through as a string (as a response from
  a jQuery .post() function, so the returned HTML then holds errors
  which may have occured - and I need to pick up on those :))

  TIA

  Andy

  On Jan 9, 11:09 pm, Leonardo Balter leonardo.bal...@gmail.com wrote:
   2010/1/9 youradds andy.ne...@gmail.com

Hi,

Thanks. Ok, I have this string (for example):

html
head/head
body

bit of other junk here, and maybe other divs and stuff

                       div class=error
                               ul
                                       liGast Email der Rezension
kann nicht den Wert 'undefined'
                                       speichern./li
                               /ul
                       /div

some junk here

/body
/html

So how exactly would I extract that from a string?

TIA :)

Andy

On Jan 9, 1:32 pm, Leonardo Balter leonardo.bal...@gmail.com wrote:
 And you can simply use .text() method. This will return you only the
  text
 inside your selected element.

 Do you also need tips on getting the child elements on that div?

 --
 At,
 Leo Balterhttp://leobalter.net
 Blog técnico:http://blog.leobalter.net

   Based on jquery documentation:

   First, you can define your selectors, it's the easier way if you already
   work with CSSs:

  http://docs.jquery.com/Selectors

   You can use something like: $('.error  ul  li').text(); to match all
  li's
   inside the element with class set to 'error' (the . referees a element
  using
   class name right after the dot).

   You can also use $('.error ul li').text() to get each li descending
  from a
   ul than from a element with a class named 'error'. In our .text() method
   this won't make much diference than using the first selector.

   Now let's try some jquery methods without complicating our basic
  selector:

   We have the .find() and .children() methods

   From now I'm adapting the text from jquery documentation to our example:

   In most cases two selections made with and without find() are
  equivalent,
   such as $('.error').find('li') and $('.error ul li'). However, using a
   selector filter may lead to unexpected results:
   $('.error').find('li:first').length may be  1, (whereas $('.error
   li:first').length will never be  1) as there is an implicit each() done
   within find().

   In other words: you can try to select the first li of all div with the
  class
   attribute named 'error'.

   Now the .children(), this method will return all the immediate
  descendants
   elements within the selected element.

   Example: $('.error').children('ul').children('li') this will return
  exactly
   the directly children of the .error! .find() would return all
  descendants,
   not only the immediate ones.

   As said in the jquery documentation, it's important to refrain here:
  while
   .children() returns only the immediate descendants, .parents() will look
  at
   all ancestors.

   That's all,

   Have a good day.

   --
   At,
   Leo Balterhttp://leobalter.net
   Blog técnico:http://blog.leobalter.net

 --
 John Arrowwood
 John (at) Irie (dash) Inc (dot) com
 John (at) Arrowwood Photography (dot) com
 John (at) Hanlons Razor (dot) com
 --http://www.irie-inc.com/http://arrowwood.blogspot.com/


[jQuery] Re: Foreign charachters in .post()

2010-01-11 Thread youradds
Anyone got any suggestions? This  is the last bug I've gotta squish :/

TIA

Andy

On Jan 11, 9:18 am, youradds andy.ne...@gmail.com wrote:
 I found a way to do this in the .cgi script - but obviously I'd prefer
 to do it vai the AJAX submission, instead of having to encode it
 properly at the server end :)

         my $contents = $IN-param('Review_Contents');
        $contents =~ s/([\200-\377]+)/from_utf8({ -string = $1, -
 charset = 'ISO-8859-1'})/eg;
         $IN-param('Review_Contents' = $contents );

 TIA

 Andy

 On Jan 11, 8:15 am, youradds andy.ne...@gmail.com wrote:

  Hi,

  Got a bit of a weird one here :/

  The following code works fine:

                jQuery.post(/cgi-bin/review.cgi, {
                  Review_Rating: the_rating,
                          ID:  theID,
                          add_this_review: 1,
                          Review_Contents: contents,
                          Review_Subject: subject,
                          Review_ByLine: byline,
                          Review_GuestName: guestname,
                          Review_GuestEmail: guestemail,
                          add_review: 1,
                          SecurityImage: SecurityImage,
                          SessionID:     SessionID
                }, function(response){

                  jQuery('#ajax_rate_indicator').fadeOut();
                  setTimeout(finishAjaxReview('the_rating_box', '+escape
  (response)+'), 400);
                });

  ...*appart* from the fact stuff like:

  ö =
  ä =
  ü =

  ..gets converted to:

  ö =
  ä =
  ü =

  I did a little bit of research, and found something about adding this
  (but this seems to really be for a different jQuery function - which
  is probably why its not working);

                          contentType: application/x-www-form-
  urlencoded;charset=ISO-8859-15,

  Can anyone suggest how I could fix this issue with foreign
  charachters?

  TIA

  Andy




[jQuery] background-color always returns transparent

2010-01-11 Thread John
Hi,

I used jQuery 1.3.2 and Firefox for the following html

html
head
style type=text/css
.content .division .category.selected {
background: red;
}

/style
/head
body

div class=categories
div class=content
div class=body
   ul id=category-list
   li class=division
   ul
   li class=category selected
   div class=title
   a href=/suv class=category-
suvSUVs (6)/a
   /div

   /li

   li class=category category_69564
   div class=title
   a href=/4by4 class=category-
general4x4 (6)/a
   /div

   /li
   li class=category category_73293
   div class=title
   a href=/hybrid
class=category-hybridHybrid/a
   /div
   /li
  /ul
   /li
/ul
/div
/div
/div

/body
/html

I used the following css command to get back the background color:

$(#category-list  li.division:eq(0) ul  li:eq(0) a).css
(background-color);

but it always returned the value transparent instead of the red
color rgb(255,0,0).
I also tried backgroundColor and it did not work either
(transparent). How to get back
the correct background color?

Thanks in advance,

John


[jQuery] can anchor tag be used in jquery to define areas

2010-01-11 Thread Oliur
What I mean is, in normal HTML if you have a link to go to the top of
the page you write

a name=top id=top/a
.
..

a href=test.html#topgo top/a

When you type in your browser

http://localhost/lab2/class2.html#top

it takes you to the top of the page. This way you can also go to the
specific area in other pages too.

In jquery if you have such areas that are in a different page, how do
you trigger your click function to work? or can the anchor tag be
used ?

Thanks



Re: [jQuery] Re: Foreign charachters in .post()

2010-01-11 Thread Jonathan Vanherpe (T T NV)

this seems to answer your question somewhat:
http://stackoverflow.com/questions/26620/how-to-set-encoding-in-getjson-jquery

although I'd personally recommend to just use utf-8 for everything (so 
making your website and database use utf-8)


Jonathan

youradds wrote:

Anyone got any suggestions? This  is the last bug I've gotta squish :/

TIA

Andy

On Jan 11, 9:18 am, youraddsandy.ne...@gmail.com  wrote:

I found a way to do this in the .cgi script - but obviously I'd prefer
to do it vai the AJAX submission, instead of having to encode it
properly at the server end :)

 my $contents = $IN-param('Review_Contents');
$contents =~ s/([\200-\377]+)/from_utf8({ -string =  $1, -
charset =  'ISO-8859-1'})/eg;
 $IN-param('Review_Contents' =  $contents );

TIA

Andy

On Jan 11, 8:15 am, youraddsandy.ne...@gmail.com  wrote:


Hi,



Got a bit of a weird one here :/



The following code works fine:



   jQuery.post(/cgi-bin/review.cgi, {
 Review_Rating: the_rating,
 ID:  theID,
 add_this_review: 1,
 Review_Contents: contents,
 Review_Subject: subject,
 Review_ByLine: byline,
 Review_GuestName: guestname,
 Review_GuestEmail: guestemail,
 add_review: 1,
 SecurityImage: SecurityImage,
 SessionID: SessionID
   }, function(response){



 jQuery('#ajax_rate_indicator').fadeOut();
 setTimeout(finishAjaxReview('the_rating_box', '+escape
(response)+'), 400);
   });



...*appart* from the fact stuff like:



ö =
ä =
ü =



..gets converted to:



ö =
ä =
ü =



I did a little bit of research, and found something about adding this
(but this seems to really be for a different jQuery function - which
is probably why its not working);



 contentType: application/x-www-form-
urlencoded;charset=ISO-8859-15,



Can anyone suggest how I could fix this issue with foreign
charachters?



TIA



Andy








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


Re: [jQuery] Re: Foreign charachters in .post()

2010-01-11 Thread Jonathan Vanherpe (T T NV)

actually, putting this once somewhere in your script should fix it:
$.ajaxSetup({ scriptCharset: ISO-8859-1 , contentType: 
application/json; charset=ISO-8859-1});


but still, you'll make your life easier if you just go for a completely 
utf-8 workflow.


Jonathan


Jonathan Vanherpe (T  T NV) wrote:

this seems to answer your question somewhat:
http://stackoverflow.com/questions/26620/how-to-set-encoding-in-getjson-jquery


although I'd personally recommend to just use utf-8 for everything (so
making your website and database use utf-8)

Jonathan

youradds wrote:

Anyone got any suggestions? This is the last bug I've gotta squish :/

TIA

Andy

On Jan 11, 9:18 am, youraddsandy.ne...@gmail.com wrote:

I found a way to do this in the .cgi script - but obviously I'd prefer
to do it vai the AJAX submission, instead of having to encode it
properly at the server end :)

my $contents = $IN-param('Review_Contents');
$contents =~ s/([\200-\377]+)/from_utf8({ -string = $1, -
charset = 'ISO-8859-1'})/eg;
$IN-param('Review_Contents' = $contents );

TIA

Andy

On Jan 11, 8:15 am, youraddsandy.ne...@gmail.com wrote:


Hi,



Got a bit of a weird one here :/



The following code works fine:



jQuery.post(/cgi-bin/review.cgi, {
Review_Rating: the_rating,
ID: theID,
add_this_review: 1,
Review_Contents: contents,
Review_Subject: subject,
Review_ByLine: byline,
Review_GuestName: guestname,
Review_GuestEmail: guestemail,
add_review: 1,
SecurityImage: SecurityImage,
SessionID: SessionID
}, function(response){



jQuery('#ajax_rate_indicator').fadeOut();
setTimeout(finishAjaxReview('the_rating_box', '+escape
(response)+'), 400);
});



...*appart* from the fact stuff like:



ö =
ä =
ü =



..gets converted to:



ö =
ä =
ü =



I did a little bit of research, and found something about adding this
(but this seems to really be for a different jQuery function - which
is probably why its not working);



contentType: application/x-www-form-
urlencoded;charset=ISO-8859-15,



Can anyone suggest how I could fix this issue with foreign
charachters?



TIA



Andy











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


Re: [jQuery] background-color always returns transparent

2010-01-11 Thread Charlie




appears you are using 2 different css attributes. 'background' and
'background-color'

try changing style to:

.content .division .category.selected {
background-color: red;
}
or see what happens in jQuery with 
.css
("background");

John wrote:

  Hi,

I used jQuery 1.3.2 and Firefox for the following html

html
head
style type="text/css"
.content .division .category.selected {
background: red;
}

/style
/head
body

div class="categories"
div class="content"
div class="body"
   ul id="category-list"
   li class="division"
   ul
   li class="category selected"
   div class="title"
   a href="" class="category-
suv"SUVs (6)/a
   /div

   /li

   li class="category category_69564"
   div class="title"
   a href="" class="category-
general"4x4 (6)/a
   /div

   /li
   li class="category category_73293"
   div class="title"
   a href=""
class="category-hybrid"Hybrid/a
   /div
   /li
  /ul
   /li
/ul
/div
/div
/div

/body
/html

I used the following css command to get back the background color:

$("#category-list  li.division:eq(0) ul  li:eq(0) a").css
("background-color");

but it always returned the value "transparent" instead of the "red"
color rgb(255,0,0).
I also tried "backgroundColor" and it did not work either
("transparent"). How to get back
the correct background color?

Thanks in advance,

John

  





[jQuery] Re: Superfish IE6 dies with opacity CSS attribute

2010-01-11 Thread Šime Vidas
The selector ul li li is valid, of course.


[jQuery] Re: How to be able to preload jquery contents into hidden tabs for ie browser

2010-01-11 Thread Šime Vidas
LOL that's creative :)

It certainly is not the best solution, but hey if it works 


[jQuery] Re: Problem with jquery tabs on live site

2010-01-11 Thread Šime Vidas

I'm having a hard time finding the jQuery code that gets executed when
you click on a tab...


Re: [jQuery] can anchor tag be used in jquery to define areas

2010-01-11 Thread Charlie




"...how do you trigger your click function to work? or can the anchor
tag be used ?"

question isn't very clear about what you are trying to do. You can over
ride the href with a click function by using  " return false; "
which over rides browser default action of opening the link, or you can
work with the href property to reconstruct it if the hash fragment
"#top" isn't there.

be easier to help with better defintiion of objective



Oliur wrote:

  What I mean is, in normal HTML if you have a link to go to the top of
the page you write

a name="top" id="top"/a
.
..

a href=""go top/a

When you type in your browser

http://localhost/lab2/class2.html#top

it takes you to the top of the page. This way you can also go to the
specific area in other pages too.

In jquery if you have such areas that are in a different page, how do
you trigger your click function to work? or can the anchor tag be
used ?

Thanks


  





[jQuery] Re: Problem with jquery tabs on live site

2010-01-11 Thread Coxy
$(document).ready(function(){
  ...
 // Related Tabs on single view
 $(#relatedTabs).tabs();
});

It's in an external js: initialise.js


[jQuery] Re: Problem with jquery tabs on live site

2010-01-11 Thread MorningZ
Are you looking to make an AJAX request to load the tab?  i don't
think you are considering your markup...

change

div id=relatedTabs class=sidebarSection
p class=infoText sidebarTitlestrongRelated/strong/p
ul id=relatedTabBar
lia href=article/goerlitzer-
park.html#related-1spanArticles/span/a/li
lia href=article/goerlitzer-
park.html#related-2spanFiles/span/a/li
lia href=article/goerlitzer-
park.html#related-3spanLinks/span/a/li
/ul

to

p class=infoText sidebarTitlestrongRelated/strong/p
div id=relatedTabs class=sidebarSection
ul id=relatedTabBar
lia href=#related-1spanArticles/span/a/li
lia href=#related-2spanFiles/span/a/li
lia href=#related-3spanLinks/span/a/li
/ul



On Jan 11, 8:40 am, Coxy step...@bungert.co.uk wrote:
 Sorry, I wasn't sure if one was needed. Here is an example:

 http://krautspotter.bungert.co.uk/article/goerlitzer-park.html

 This loading of the whole page never happened with the static mock-up.
 Also jquery seems to have created it's own tabs. I never called them
 hrefs like #ui-tabs-22


[jQuery] Re: can anchor tag be used in jquery to define areas

2010-01-11 Thread Oliur
Apologies if my questions wasn't very clear.

I'll try to explain further.

I have used jquery tabs (or similar functionality) where user can
click on different tabs and see different content without any page
refresh. Say, I have three tabs  namely,

Home, About us, Faq

Home tab is visible by default, the rest two are hidden.

Now, from a different page I have a link to the Faq section. ( i.e -
click here to see the FAQ section. )

I am trying to figure out how would the user sees Faq section as they
click on the link. Problem is Home is the default tab not the FAQ one
and hence not visible by default.

Do I make any sense?

With normal html I'd have used anchor tag to and send the user to the
right place.







The reason why I am trying to figure this out is, I have built a
jquery tab where only one tab content can be seen at a time.

On Jan 11, 4:19 pm, Charlie charlie...@gmail.com wrote:
 ...how do you trigger your click function to work? or can the anchor tag be 
 used ?
 question isn't very clear about what you are trying to do. You can over ride 
 the href with a click function by using      return false;  which over 
 rides browser default action of opening the link, or you can work with the 
 href property to reconstruct it if the hash fragment  #top isn't there.
 be easier to help with better defintiion of objective
 Oliur wrote:What I mean is, in normal HTML if you have a link to go to the 
 top of the page you write a name=top id=top/a . .. a 
 href=test.html#topgo top/a When you type in your 
 browserhttp://localhost/lab2/class2.html#topit takes you to the top of the 
 page. This way you can also go to the specific area in other pages too. In 
 jquery if you have such areas that are in a different page, how do you 
 trigger your click function to work? or can the anchor tag be used ? Thanks


[jQuery] Re: Problem with jquery tabs on live site

2010-01-11 Thread Coxy
No I'm not, and in my static mock-up everything was ok. It does this
on the live site, and I want to find out why. Do you know how to stop
it?


Re: [jQuery] Download avatar 2009 for free

2010-01-11 Thread Marc Henson

Is there any chance you can stop spamming our group please?

Cheers

Marc

On 11 Jan 2010, at 16:28, avatar3 wrote:


Download avatar 2009
In the future, Jake, a paraplegic war veteran, is brought to another  
planet, Pandora, which is inhabited by the Na'vi, a humanoid race  
with their own language and culture. Those from Earth find  
themselves at odds with each other and the local culture.


Download avatar 2009






[jQuery] Re: Foreign charachters in .post()

2010-01-11 Thread youradds
You star - that works a charm :)

Thanks!

Andy

On Jan 11, 3:54 pm, Jonathan Vanherpe (T  T NV) jonat...@tnt.be
wrote:
 actually, putting this once somewhere in your script should fix it:
 $.ajaxSetup({ scriptCharset: ISO-8859-1 , contentType:
 application/json; charset=ISO-8859-1});

 but still, you'll make your life easier if you just go for a completely
 utf-8 workflow.

 Jonathan

 Jonathan Vanherpe (T  T NV) wrote:



  this seems to answer your question somewhat:
 http://stackoverflow.com/questions/26620/how-to-set-encoding-in-getjs...

  although I'd personally recommend to just use utf-8 for everything (so
  making your website and database use utf-8)

  Jonathan

  youradds wrote:
  Anyone got any suggestions? This is the last bug I've gotta squish :/

  TIA

  Andy

  On Jan 11, 9:18 am, youraddsandy.ne...@gmail.com wrote:
  I found a way to do this in the .cgi script - but obviously I'd prefer
  to do it vai the AJAX submission, instead of having to encode it
  properly at the server end :)

  my $contents = $IN-param('Review_Contents');
  $contents =~ s/([\200-\377]+)/from_utf8({ -string = $1, -
  charset = 'ISO-8859-1'})/eg;
  $IN-param('Review_Contents' = $contents );

  TIA

  Andy

  On Jan 11, 8:15 am, youraddsandy.ne...@gmail.com wrote:

  Hi,

  Got a bit of a weird one here :/

  The following code works fine:

  jQuery.post(/cgi-bin/review.cgi, {
  Review_Rating: the_rating,
  ID: theID,
  add_this_review: 1,
  Review_Contents: contents,
  Review_Subject: subject,
  Review_ByLine: byline,
  Review_GuestName: guestname,
  Review_GuestEmail: guestemail,
  add_review: 1,
  SecurityImage: SecurityImage,
  SessionID: SessionID
  }, function(response){

  jQuery('#ajax_rate_indicator').fadeOut();
  setTimeout(finishAjaxReview('the_rating_box', '+escape
  (response)+'), 400);
  });

  ...*appart* from the fact stuff like:

  =
  =
  =

  ..gets converted to:

  ö =
  ä =
  ü =

  I did a little bit of research, and found something about adding this
  (but this seems to really be for a different jQuery function - which
  is probably why its not working);

  contentType: application/x-www-form-
  urlencoded;charset=ISO-8859-15,

  Can anyone suggest how I could fix this issue with foreign
  charachters?

  TIA

  Andy

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


[jQuery] Re: Problem with jquery tabs on live site

2010-01-11 Thread MorningZ
yes, change the a tags in the code above as shown... but putting a
URL there you are telling the tabs plugin go get this via AJAX
request


On Jan 11, 11:43 am, Coxy step...@bungert.co.uk wrote:
 No I'm not, and in my static mock-up everything was ok. It does this
 on the live site, and I want to find out why. Do you know how to stop
 it?


[jQuery] Re: 2nd Trigger for images hover function

2010-01-11 Thread Jordan
Perfect! Thanks so much!

On Jan 8, 4:15 pm, Šime Vidas sime.vi...@gmail.com wrote:
 How many DIVs of class tv do you have? One?

 And you want an other DIV to trigger the cross-fade on the tv DIV?

 If that is the case...

     $(document).ready(function () {
         $('div.tv, #theOtherDiv').hover(function () {
                 var div = $('div.tv  div');
                 if (div.is(':animated')) {
                         div.stop().fadeTo(500, 1);
                 } else {
                         div.fadeIn(250);
                 }
         }, function () {
                 var div = $('div.tv  div');
                 if (div.is(':animated')) {
                         div.stop().fadeTo(1000, 0);
                 } else {
                         div.fadeOut(1000);
                 }
         });

[jQuery] Re: Problem with jquery tabs on live site

2010-01-11 Thread MorningZ
yes, change the a tags in the code above as shown... by putting a
URL there you are telling the tabs plugin go get this via AJAX
request

See:

http://jqueryui.com/demos/tabs/#ajax
-
Fetch external content via Ajax for the tabs by setting an href value
in the tab links. While the Ajax request is waiting for a response,
the tab label changes to say Loading..., then returns to the normal
label once loaded
-

you've got URL's in your href parameters, causing tabs to go AJAX


On Jan 11, 11:43 am, Coxy step...@bungert.co.uk wrote:
 No I'm not, and in my static mock-up everything was ok. It does this
 on the live site, and I want to find out why. Do you know how to stop
 it?


Re: [jQuery] Re: Problem with jquery tabs on live site

2010-01-11 Thread Charlie




when you put an actual url into tabs href it treats them as ajax tabs.
If you aren't using AJAX in them remove the url within the href and
replace with href=""



Coxy wrote:

  No I'm not, and in my static mock-up everything was ok. It does this
on the live site, and I want to find out why. Do you know how to stop
it?

  





[jQuery] Re: background-color always returns transparent

2010-01-11 Thread John
Thanks for your reply. The output of

.css (background);

is empty.

Also changed the css attribute as 'background-color', it still returns
'transparent'.

Thanks,

John

On Jan 11, 11:03 am, Charlie charlie...@gmail.com wrote:
 appears you are using 2 different css attributes. 'background' and 
 'background-color'
 try changing style to:
 .content .division .category.selected {
 background-color: red;
 }
 or see what happens in jQuery with.css (background);
 John wrote:Hi, I used jQuery 1.3.2 and Firefox for the following html html 
 head style type=text/css .content .division .category.selected { 
 background: red; } /style /head body div class=categories div 
 class=content div class=body ul id=category-list li 
 class=division ul li class=category selected div class=title a 
 href=/suv class=category- suvSUVs (6)/a /div /li li 
 class=category category_69564 div class=title a href=/4by4 
 class=category- general4x4 (6)/a /div /li li class=category 
 category_73293 div class=title a href=/hybrid 
 class=category-hybridHybrid/a /div /li /ul /li /ul /div 
 /div /div /body /html I used the following css command to get back 
 the background color: $(#category-list  li.division:eq(0) ul  li:eq(0) 
 a).css (background-color); but it always returned the value transparent 
 instead of the red color rgb(255,0,0). I also tried backgroundColor and 
 it did not work either (transparent). How to get back the correct 
 background color? Thanks in advance, John


[jQuery] Carousel outbound links not working in IE 6 and 7

2010-01-11 Thread catgack
Hello. We're having problems here and would be most appreciative of
any help at all please. On this site:  
http://64.202.116.174/~jonasmus/dev/index_copy.php
we have a carousel. Some of the items have external links that appear
on the status bar but in IE 6 and IE 7 the links do not function.
There doesn't appear to be any JS errors.

Thanks for any help!
Dave


[jQuery] (treeview) Need help with Treeview pre-1.4.1 and jquery.treeview.edit

2010-01-11 Thread Manfred
Hello,

at first I can say that Treeview is a great jQuery plugin!
I use the plugin a lot and have some questions now.

I found a newer Version pre-1.4.1 here:
http://view.jquery.com/trunk/plugins/treeview/jquery.treeview.js
Demo: http://view.jquery.com/trunk/plugins/treeview/demo/
Is this version still in development?

Very interesting in this version is the possibility to add and remove
a node. These features was added in the file jquery.treeview.edit.js:
http://view.jquery.com/trunk/plugins/treeview/jquery.treeview.edit.js

There are still some bugs here, e.g.:
- go to the test-page: 
http://view.jquery.com/trunk/plugins/treeview/demo/edit.html
- first, delete File 4
- then, delete File 3.1
- now, the icon in front of Folder 3 (closed at start) is not
correct

The good news: I found the bug, here is the new working code for
jquery.treeview.edit.js, please replace the old code:
if (parent.is(:not(:has()))  parent[0] != this) {
parent.parent()
.removeClass(CLASSES.collapsable)
.removeClass(CLASSES.expandable)
.removeClass(CLASSES.lastCollapsable)
.removeClass(CLASSES.lastExpandable);

parent.parent(:last-child).addClass(CLASSES.last);

parent.siblings(.hitarea).andSelf().remove();
}

But there are still problems with the add-function in this file: At
the moment I can only add new nodes directly in a ul-tag, that
means, that the parent node has already childs. But if I want to add a
new node on a node that hasn't already children, the current code
doesn't generate new necessary ul-tags first.

Can anybody help me with the correction of the add-function?

Another problem:
In the new http://view.jquery.com/trunk/plugins/treeview/jquery.treeview.js
you can find 'this.data(toggler, toggler);' in line 164. This works
only with jQuery 1.2.6 but with 1.3.2 I got this error message:
this.data is not a function

How can I make the version pre-1.4.1 compatible with jQuery 1.3.2?

Thank you very much for your help!
Greetings Manfred


[jQuery] Re: Problem with jquery tabs on live site

2010-01-11 Thread Coxy
In the included js (initialise.js):

$(document).ready(function(){
  ... // Code snipped

 // Related Tabs on single view
 $(#relatedTabs).tabs();
});


[jQuery] Need help with a required field from radio selection

2010-01-11 Thread jeffself
I've got a form with a radio group called 'legal_status'. There are
five radio buttons. The last one has an id='other_radio'. If this
button is selected, I have a textarea field that gets displayed. The
field has an id='legal_status_comment'. This textarea field is wrapped
by a div with an id='other_text_area' that is hidden until the
other_radio button is selected.

How do I write the rule to make the 'legal_status_comment' field to be
required if the 'other_radio' button has been selected?

Thanks!


Re: [jQuery] Re: can anchor tag be used in jquery to define areas

2010-01-11 Thread Nathan Klatt
On Mon, Jan 11, 2010 at 10:36 AM, Oliur o.r.chowdh...@gmail.com wrote:
 I am trying to figure out how would the user sees Faq section as they
 click on the link. Problem is Home is the default tab not the FAQ one
 and hence not visible by default.

Hopefully someone will post a better solution but what I do is check
for the hash in the URL then, if I find one, call
$(#+tabFromHash).click().

Nathan


Re: [jQuery] background-color always returns transparent

2010-01-11 Thread John Arrowwood
The short answer is because the background color of the item you have
selected is in fact transparent.

Your style makes the li tag red.  Then you query on a child element that
has no color specified.  The background color of the child element is
'transparent' which means that the color of something up the tree is what
you will see.

You will never see 'red' by looking at the child element.  But what you can
do (and jquery.color.js does this) is while you get 'transparent' then you
can look at the parent object.  You can walk up the tree until you get what
you are looking for.

But before you go down that road, why are you looking to see the color of
the element?  If you can describe what you are trying to do in more general
terms, someone may be able to give a better suggestion on how to accomplish
it.


On Mon, Jan 11, 2010 at 7:39 AM, John john.jian.f...@gmail.com wrote:

 Hi,

 I used jQuery 1.3.2 and Firefox for the following html

 html
 head
 style type=text/css
 .content .division .category.selected {
 background: red;
 }

 /style
 /head
 body

 div class=categories
 div class=content
 div class=body
   ul id=category-list
   li class=division
   ul
   li class=category selected
   div class=title
   a href=/suv class=category-
 suvSUVs (6)/a
   /div

   /li

   li class=category category_69564
   div class=title
   a href=/4by4 class=category-
 general4x4 (6)/a
   /div

   /li
   li class=category category_73293
   div class=title
   a href=/hybrid
 class=category-hybridHybrid/a
   /div
   /li
  /ul
   /li
/ul
 /div
 /div
 /div

 /body
 /html

 I used the following css command to get back the background color:

 $(#category-list  li.division:eq(0) ul  li:eq(0) a).css
 (background-color);

 but it always returned the value transparent instead of the red
 color rgb(255,0,0).
 I also tried backgroundColor and it did not work either
 (transparent). How to get back
 the correct background color?

 Thanks in advance,

 John




-- 
John Arrowwood
John (at) Irie (dash) Inc (dot) com
John (at) Arrowwood Photography (dot) com
John (at) Hanlons Razor (dot) com
--
http://www.irie-inc.com/
http://arrowwood.blogspot.com/


[jQuery] Dialog buttons for closing

2010-01-11 Thread roxstyle
i am having problems with the buttons used to close the dialog.

sample with dialog:
http://www.roxstyle.com/projects/blssi/cms/de-tool-v3/proj-awards.html

on this wireframe, if you click +Award a form opens. In the form, if
you click Select Project the  jquery ui-dialog opens.

there are two areas that have buttons for potential closing the
dialog, plus the icon in the top right. I can not figure out what
class, or function to add to these buttons to have them close the
dialog. I can not use the default buttonpane as it dynamically makes
a block level area that has only buttons, and this layout has other
elements besides the buttons.

i have tried the following, but it does not work.

// close modal universal TESTING
$(function modalClose() {
$(.modal-close).click(function() {
$(this).dialog('destroy');
return true;
});
});

i have tried a destroy funtion on the dialog
$(function() {
$(.updaterecip).hide();
$(#recipient).dialog({
bgiframe: true,
autoOpen: false,
height:510,
width:700,
resizable: false,
modal: true,
zIndex: 3200,
overlay: {
backgroundColor: '#000',
opacity: 0.4
},
title: 'Choose a Recipient for Award',
onClose:$(.updaterecip).show(),
destroy: function() {
$(.modal-close).click(function() {
$(this).dialog('destroy');
});
},
});


[jQuery] Re: background-color always returns transparent

2010-01-11 Thread John
Thanks for your reply. I will try to see if the background color on
the parent works or not.

As for checking the red color, I need to do a UI test and check if
the background color
is set correctly. That is to say, I am testing other people's code and
web page.

Thanks,

John

On Jan 11, 12:41 pm, John Arrowwood jarro...@gmail.com wrote:
 The short answer is because the background color of the item you have
 selected is in fact transparent.

 Your style makes the li tag red.  Then you query on a child element that
 has no color specified.  The background color of the child element is
 'transparent' which means that the color of something up the tree is what
 you will see.

 You will never see 'red' by looking at the child element.  But what you can
 do (and jquery.color.js does this) is while you get 'transparent' then you
 can look at the parent object.  You can walk up the tree until you get what
 you are looking for.

 But before you go down that road, why are you looking to see the color of
 the element?  If you can describe what you are trying to do in more general
 terms, someone may be able to give a better suggestion on how to accomplish
 it.



 On Mon, Jan 11, 2010 at 7:39 AM, John john.jian.f...@gmail.com wrote:
  Hi,

  I used jQuery 1.3.2 and Firefox for the following html

  html
  head
  style type=text/css
  .content .division .category.selected {
  background: red;
  }

  /style
  /head
  body

  div class=categories
  div class=content
  div class=body
        ul id=category-list
                li class=division
                        ul
                        li class=category selected
                                div class=title
                                        a href=/suv class=category-
  suvSUVs (6)/a
                                /div

                        /li

                            li class=category category_69564
                                div class=title
                                        a href=/4by4 class=category-
  general4x4 (6)/a
                                /div

                        /li
                        li class=category category_73293
                                div class=title
                                        a href=/hybrid
  class=category-hybridHybrid/a
                                /div
                        /li
               /ul
                /li
     /ul
  /div
  /div
  /div

  /body
  /html

  I used the following css command to get back the background color:

  $(#category-list  li.division:eq(0) ul  li:eq(0) a).css
  (background-color);

  but it always returned the value transparent instead of the red
  color rgb(255,0,0).
  I also tried backgroundColor and it did not work either
  (transparent). How to get back
  the correct background color?

  Thanks in advance,

  John

 --
 John Arrowwood
 John (at) Irie (dash) Inc (dot) com
 John (at) Arrowwood Photography (dot) com
 John (at) Hanlons Razor (dot) com
 --http://www.irie-inc.com/http://arrowwood.blogspot.com/


Re: [jQuery] Download avatar 2009 for free

2010-01-11 Thread Karl Swedberg
Really sorry. Someone was spoofing my email address. This has happened  
to a few others, too. Anyway, that account is banned now.




On Jan 11, 2010, at 11:56 AM, Marc Henson wrote:


Is there any chance you can stop spamming our group please?

Cheers

Marc

On 11 Jan 2010, at 16:28, avatar3 wrote:


Download avatar 2009
In the future, Jake, a paraplegic war veteran, is brought to  
another planet, Pandora, which is inhabited by the Na'vi, a  
humanoid race with their own language and culture. Those from Earth  
find themselves at odds with each other and the local culture.


Download avatar 2009








[jQuery] Re: background-color always returns transparent

2010-01-11 Thread John
Yes, indeed, the color on the 'li' tag is red.

Thanks,

John

On Jan 11, 12:54 pm, John john.jian.f...@gmail.com wrote:
 Thanks for your reply. I will try to see if the background color on
 the parent works or not.

 As for checking the red color, I need to do a UI test and check if
 the background color
 is set correctly. That is to say, I am testing other people's code and
 web page.

 Thanks,

 John

 On Jan 11, 12:41 pm, John Arrowwood jarro...@gmail.com wrote:

  The short answer is because the background color of the item you have
  selected is in fact transparent.

  Your style makes the li tag red.  Then you query on a child element that
  has no color specified.  The background color of the child element is
  'transparent' which means that the color of something up the tree is what
  you will see.

  You will never see 'red' by looking at the child element.  But what you can
  do (and jquery.color.js does this) is while you get 'transparent' then you
  can look at the parent object.  You can walk up the tree until you get what
  you are looking for.

  But before you go down that road, why are you looking to see the color of
  the element?  If you can describe what you are trying to do in more general
  terms, someone may be able to give a better suggestion on how to accomplish
  it.

  On Mon, Jan 11, 2010 at 7:39 AM, John john.jian.f...@gmail.com wrote:
   Hi,

   I used jQuery 1.3.2 and Firefox for the following html

   html
   head
   style type=text/css
   .content .division .category.selected {
   background: red;
   }

   /style
   /head
   body

   div class=categories
   div class=content
   div class=body
         ul id=category-list
                 li class=division
                         ul
                         li class=category selected
                                 div class=title
                                         a href=/suv class=category-
   suvSUVs (6)/a
                                 /div

                         /li

                             li class=category category_69564
                                 div class=title
                                         a href=/4by4 class=category-
   general4x4 (6)/a
                                 /div

                         /li
                         li class=category category_73293
                                 div class=title
                                         a href=/hybrid
   class=category-hybridHybrid/a
                                 /div
                         /li
                /ul
                 /li
      /ul
   /div
   /div
   /div

   /body
   /html

   I used the following css command to get back the background color:

   $(#category-list  li.division:eq(0) ul  li:eq(0) a).css
   (background-color);

   but it always returned the value transparent instead of the red
   color rgb(255,0,0).
   I also tried backgroundColor and it did not work either
   (transparent). How to get back
   the correct background color?

   Thanks in advance,

   John

  --
  John Arrowwood
  John (at) Irie (dash) Inc (dot) com
  John (at) Arrowwood Photography (dot) com
  John (at) Hanlons Razor (dot) com
  --http://www.irie-inc.com/http://arrowwood.blogspot.com/


[jQuery] Re: Problem with jquery tabs on live site

2010-01-11 Thread Coxy
Thanks all, I have my problem solved. My CMS (TYPO3) was set to prefix
local anchors (needed for the URL re-writing extension realurl) and
this was changing the href's by adding a whole url.

Since I can't turn of this function without switching of realurl I
just alter the anchors before calling tabs() with the following (for
those who also experience this when using TYPO3 with realurl):

// RealUrl uses local anchor prefixing. This must be removed from the
tab links before calling tabs();
$tabLinks   = $('#relatedTabBar li a');
$numOfTabs  = $tabLinks.length;

for (var index = 0; index  $numOfTabs; index ++)
{
$oldAnchor  = $tabLinks.attr('href');
$hashPos= $oldAnchor.indexOf('#');
$newAnchor  = $oldAnchor.substr($hashPos);
$tabLinks.attr('href', $newAnchor);
}

// Related Tabs on single view
$(#relatedTabs).tabs();

Thanks again for the help. Now I just have to replace the dummy tab
content with the real content!


[jQuery] Re: long-term browser support strategy

2010-01-11 Thread mikewse
You are echoing my own thoughts :-)

Still, I see stop supporting IE6 discussions even for JS libraries,
like it is doing the right thing to help evolve the web. I can
understand the reasoning although I don't agree with it. So, I think
it would be good if core devs could speak up on their long-term plan.
Without this, browsers that you and I need to support may well be gone
from the compatibility list in the next version. The only library that
seems to have done this homework is BBC's Glow, whose browser
deprecation decision tree seems to suggest a worst case of 2% for
deprecation (although I think there is a bug in the last part of the
algorithm).
http://www.bbc.co.uk/guidelines/futuremedia/images/Decision_tree_for_browser_deprecation_100.pdf

Best regards
Mike

On Jan 11, 2:44 pm, Šime Vidas sime.vi...@gmail.com wrote:
 It would be really stupid (for a JS library) to cut off any browser
 with market-share above 1%, especially IE6 which won't go below 1%
 until maybe 2011.
 You can be sure, they won't do that.

 The big sites (Youtube, Facebook, ...) are doing a good job in asking
 their visitors to upgrade, but IE6 is (reportedly) big in companies
 where the regular employee cannot just upgrade if he wants to.


[jQuery] Re: Problem with jquery tabs on live site

2010-01-11 Thread Coxy
tabLinks= $('#relatedTabBar li a');
numOfTabs   = tabLinks.length;

for (index = 0; index  numOfTabs; index ++)
{
oldAnchor   = $(tabLinks[index]).attr('href');
hashPos = oldAnchor.indexOf('#');
newAnchor   = oldAnchor.substr(hashPos);
$(tabLinks[index]).attr('href', newAnchor);
}

Sorry code was wrong before


Re: [jQuery] Re: Displaying reviews using js widgets such as in freeindex.co.uk

2010-01-11 Thread Viz skillipedia
Thank you very much

I am, now, certain the document.write()  is all what in need: i process
the request in Java handler and  may be a bit of jsp scripting and all the
rest is easy

Thanks

On Mon, Jan 11, 2010 at 3:12 PM, Scott Sauyet scott.sau...@gmail.comwrote:

 On Jan 10, 11:49 pm, SkilliPedia skillipe...@googlemail.com wrote:
  I have a website where services, software,etc get reviewed. What i
  want to do is enable users to display reviews in their own websites as
  testimonials and as extra backlink for me.
 
  I am looking for  a js widget that can do that. My web application is
  coded in Java

 I think doing this in jQuery would be a really heavy-weight solution.
 Requiring your users to include jQ on their page just to add your
 widget seems rather much, especially as this probably doesn't need to
 do too much.  The example you point to formats everything server-side
 as a single call to document.write().  That would probably be the
 easiest approach.

 That said, if you do choose to use jQuery, I suppose you can add it
 yourself in your script, with something like this:

var script = document.createElement(script);
script.src = http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/
 jquery.min.js;
script.type = text/javascript;
document.getElementsByTagName(head)[0].appendChild(script);

 From here you could request a JSONP call from your server in this
 format:

callbackName({status: ok, reviews: [{rating: 7, reviewer:
 Fred, comments: Loved it!}, {/* etc */}]});

 with code that looks like this:

$.getJSON(http://api.flickr.com/services/feeds/photos_public.gne?
 tags=cattagmode=anyformat=jsonjcallback=http://api.flickr.com/services/feeds/photos_public.gne?%0Atags=cattagmode=anyformat=jsonjcallback=
 ?,
function(data) {
if (data.status == ok) {
$.each(data.reviews, function(i, review){
// do something with review
});
} else {
// report error or ignore as you like
}
);

 The trouble I see with doing it this way is that you will need hook
 into the DOM on an arbitrary site, or proceed with additional
 document.write statements in any case.  And if you have to do the
 latter, why not simply format the server-side response as
 document.write statements?

 Good luck,

  -- Scott




-- 
http://www.skillipeda.com
business web directory


[jQuery] Re: Problem with jquery tabs on live site

2010-01-11 Thread MorningZ
it can be easier than that, not so many variables to worry about  :)

right before

$(#relatedTabs).tabs();

put

$(#relatedTabs  ul a).attr(href, function() {
 if ($(this).attr(href).indexOf(#)  -1) { return # + $
(this).attr(href).split(#)[1]; } else { $(this).attr(href); }
});



On Jan 11, 2:11 pm, Coxy step...@bungert.co.uk wrote:
 tabLinks        = $('#relatedTabBar li a');
 numOfTabs       = tabLinks.length;

 for (index = 0; index  numOfTabs; index ++)
 {
         oldAnchor       = $(tabLinks[index]).attr('href');
         hashPos         = oldAnchor.indexOf('#');
         newAnchor       = oldAnchor.substr(hashPos);
         $(tabLinks[index]).attr('href', newAnchor);

 }

 Sorry code was wrong before


Re: [jQuery] Re: background-color always returns transparent

2010-01-11 Thread John Arrowwood
As a QA tester with a lot of test automation experience, a bit of advice:
Ask if the product would not ship if it wasn't red.  If the answer is no,
then you might not want to waste your time.  Unless you have automated
everything else about the functionality of the application, and are looking
for things to automate, but I would be surprised if you had gotten that far
already! :)

There are some other things you can do, too, to make it easier or faster.
If you want to discuss it off-list, email me at j...@irie-inc.com.

On Mon, Jan 11, 2010 at 9:54 AM, John john.jian.f...@gmail.com wrote:

 Thanks for your reply. I will try to see if the background color on
 the parent works or not.

 As for checking the red color, I need to do a UI test and check if
 the background color
 is set correctly. That is to say, I am testing other people's code and
 web page.

 Thanks,

 John

 On Jan 11, 12:41 pm, John Arrowwood jarro...@gmail.com wrote:
  The short answer is because the background color of the item you have
  selected is in fact transparent.
 
  Your style makes the li tag red.  Then you query on a child element
 that
  has no color specified.  The background color of the child element is
  'transparent' which means that the color of something up the tree is what
  you will see.
 
  You will never see 'red' by looking at the child element.  But what you
 can
  do (and jquery.color.js does this) is while you get 'transparent' then
 you
  can look at the parent object.  You can walk up the tree until you get
 what
  you are looking for.
 
  But before you go down that road, why are you looking to see the color of
  the element?  If you can describe what you are trying to do in more
 general
  terms, someone may be able to give a better suggestion on how to
 accomplish
  it.
 
 
 
  On Mon, Jan 11, 2010 at 7:39 AM, John john.jian.f...@gmail.com wrote:
   Hi,
 
   I used jQuery 1.3.2 and Firefox for the following html
 
   html
   head
   style type=text/css
   .content .division .category.selected {
   background: red;
   }
 
   /style
   /head
   body
 
   div class=categories
   div class=content
   div class=body
 ul id=category-list
 li class=division
 ul
 li class=category selected
 div class=title
 a href=/suv class=category-
   suvSUVs (6)/a
 /div
 
 /li
 
 li class=category category_69564
 div class=title
 a href=/4by4 class=category-
   general4x4 (6)/a
 /div
 
 /li
 li class=category category_73293
 div class=title
 a href=/hybrid
   class=category-hybridHybrid/a
 /div
 /li
/ul
 /li
  /ul
   /div
   /div
   /div
 
   /body
   /html
 
   I used the following css command to get back the background color:
 
   $(#category-list  li.division:eq(0) ul  li:eq(0) a).css
   (background-color);
 
   but it always returned the value transparent instead of the red
   color rgb(255,0,0).
   I also tried backgroundColor and it did not work either
   (transparent). How to get back
   the correct background color?
 
   Thanks in advance,
 
   John
 
  --
  John Arrowwood
  John (at) Irie (dash) Inc (dot) com
  John (at) Arrowwood Photography (dot) com
  John (at) Hanlons Razor (dot) com
  --http://www.irie-inc.com/http://arrowwood.blogspot.com/




-- 
John Arrowwood
John (at) Irie (dash) Inc (dot) com
John (at) Arrowwood Photography (dot) com
John (at) Hanlons Razor (dot) com
--
http://www.irie-inc.com/
http://arrowwood.blogspot.com/


[jQuery] Re: Why mootools animations is more smooth than jquery?

2010-01-11 Thread Scott Sauyet
On Jan 6, 9:15 pm, Acaz Souza acazso...@gmail.com wrote:
 Is just for learning this interesting point.

 What the matematics logic of both in animation framework.

 They use the same logic?

This is the original question:

| MooTools:http://www.jsfiddle.net/4vnya/
| jQuery:http://www.jsfiddle.net/eFbwJ/36/
| (Compare the code, the effects. You decide.)

First of all, the two links are reversed:

MooTools:  http://www.jsfiddle.net/eFbwJ/36/
jQuery:  http://www.jsfiddle.net/4vnya/

That simply obfuscates any issues that exist.

Second, the visual effect generated is different.  Note that in the
jQuery one, the image receiving the click ends up on the top of the
stack.  In the Mootools one, they are stacked in source code order.

Third, running in FF (the only place I've tested so far), the jQuery
is doing extra work in rotating the images, which doesn't happen in
the MooTools version.  (MooTools has

 '-webkit-transform': 'rotate(' + RandRange(-30,30) + 'deg)',

whereas jQuery has both

 '-webkit-transform': 'rotate(' + RandRange(-30,30) + 'deg)',

and

 '-moz-transform': 'rotate(' + RandRange(-30,30) + 'deg)'

.)

Fourth, the different background images will certainly have some
noticeable impact on how animations appear.

Fifth, the MooTools code has what looks like an easing algorithm
applied:

images.each(function(img){
img.set('morph', {
transition: 'back:out'
});
}

but no jQuery equivalent is used.

Sixth (and this might be the cause of the second one) the MooTools
effect is staggered across the images, while the jQuery ones run
simultaneously.  This uses the 40ms increments with this code
structure:

images.each(function(img, i){
(function(){
// animation code here.
}).delay(40 * i, img);
});

Finally, although these two animations both move the images
approximately the same amount, the transformations they apply are very
different.  When the MooTools example collapses the images, they move
to locations within +- 20 pixels from the location of the clicked
image, and are not rotated.  When the jQuery example collapses the
images, they move to the same location as the clicked image, and are
rotated to between -20 and 20 degrees.

In other words, these two animations are far too different to use for
comparing the libraries.

  -- Scott


[jQuery] Argh!! IE8!

2010-01-11 Thread Valerij
Hey guys, I have this popup menu that works.. great! In Chrome,
Safari, Firefox AND it USED to work in IE8, until I added just 1 div.

I believe this is the part that causes it;
$(document).click(function(d){
if($(#acc+a).is(:visible)){
var b=#acc
}else{
if($(#frd+a).is(:visible)){
var b=#frd
}else{
if($(#gam+a).is(:visible)){
var b=#gam
}
}
}
var c=b+a;
if(!$(d.target).closest(c).size()){
$(c).hide(fast)
}
});

What this does, is first to check if any of my 3 popup menus are open,
if one of them is open, it will check of click came outside the popup
menu, and if it was, the open popup menu will.. close itself.

This works in all the browsers great even after I added this div, but
in IE8 it suddenly stopped.

a id=acc class=baritem href=javascript:void(0);div
class=textupMy Account/div/a
a id=frd class=baritem href=javascript:void(0);div
class=textupMy Friends/div/a
a id=gam class=baritem href=javascript:void(0);div
class=textupMy Games/div/a

div id=acc_menu class=popup
a href=##stuff/a
/div
div id=frd_menu class=popup
a href=##stuff/a
/div
div id=gam_menu class=popup
a href=##stuff/a
/div


After I added the div class=textup in the menu, it stopped
working, If I remove it, it works! Now when I click anywhere outside
the popup menu, the first menu STARTS to go up, but then half way it
closes down

On this page; http://ferok.com/labs/test.html

Is there a fix for this?


[jQuery] Re: background-color always returns transparent

2010-01-11 Thread John
Thanks. I am not a QA tester, but the product maker instead. :-)

I work on the open source project Tellurium automated testing
framework to do functional testing and we
use a lot of jQuery.

Thanks,

John

On Jan 11, 2:31 pm, John Arrowwood jarro...@gmail.com wrote:
 As a QA tester with a lot of test automation experience, a bit of advice:
 Ask if the product would not ship if it wasn't red.  If the answer is no,
 then you might not want to waste your time.  Unless you have automated
 everything else about the functionality of the application, and are looking
 for things to automate, but I would be surprised if you had gotten that far
 already! :)

 There are some other things you can do, too, to make it easier or faster.
 If you want to discuss it off-list, email me at j...@irie-inc.com.



 On Mon, Jan 11, 2010 at 9:54 AM, John john.jian.f...@gmail.com wrote:
  Thanks for your reply. I will try to see if the background color on
  the parent works or not.

  As for checking the red color, I need to do a UI test and check if
  the background color
  is set correctly. That is to say, I am testing other people's code and
  web page.

  Thanks,

  John

  On Jan 11, 12:41 pm, John Arrowwood jarro...@gmail.com wrote:
   The short answer is because the background color of the item you have
   selected is in fact transparent.

   Your style makes the li tag red.  Then you query on a child element
  that
   has no color specified.  The background color of the child element is
   'transparent' which means that the color of something up the tree is what
   you will see.

   You will never see 'red' by looking at the child element.  But what you
  can
   do (and jquery.color.js does this) is while you get 'transparent' then
  you
   can look at the parent object.  You can walk up the tree until you get
  what
   you are looking for.

   But before you go down that road, why are you looking to see the color of
   the element?  If you can describe what you are trying to do in more
  general
   terms, someone may be able to give a better suggestion on how to
  accomplish
   it.

   On Mon, Jan 11, 2010 at 7:39 AM, John john.jian.f...@gmail.com wrote:
Hi,

I used jQuery 1.3.2 and Firefox for the following html

html
head
style type=text/css
.content .division .category.selected {
background: red;
}

/style
/head
body

div class=categories
div class=content
div class=body
      ul id=category-list
              li class=division
                      ul
                      li class=category selected
                              div class=title
                                      a href=/suv class=category-
suvSUVs (6)/a
                              /div

                      /li

                          li class=category category_69564
                              div class=title
                                      a href=/4by4 class=category-
general4x4 (6)/a
                              /div

                      /li
                      li class=category category_73293
                              div class=title
                                      a href=/hybrid
class=category-hybridHybrid/a
                              /div
                      /li
             /ul
              /li
   /ul
/div
/div
/div

/body
/html

I used the following css command to get back the background color:

$(#category-list  li.division:eq(0) ul  li:eq(0) a).css
(background-color);

but it always returned the value transparent instead of the red
color rgb(255,0,0).
I also tried backgroundColor and it did not work either
(transparent). How to get back
the correct background color?

Thanks in advance,

John

   --
   John Arrowwood
   John (at) Irie (dash) Inc (dot) com
   John (at) Arrowwood Photography (dot) com
   John (at) Hanlons Razor (dot) com
   --http://www.irie-inc.com/http://arrowwood.blogspot.com/

 --
 John Arrowwood
 John (at) Irie (dash) Inc (dot) com
 John (at) Arrowwood Photography (dot) com
 John (at) Hanlons Razor (dot) com
 --http://www.irie-inc.com/http://arrowwood.blogspot.com/


Re: [jQuery] Re: Ajax forms help

2010-01-11 Thread Michael Geary
The JSON part of your server response looks fine if you take out the two
line breaks - I assume those are just an artifact of posting with Outlook,
and your actual JSON response is all on one line.

But why does it have the HTML content repeated after the last } that closes
the JSON data? You don't want that.

Also:

 Is response.html saying to display it as html?

No! response.html says take the object named 'response' and give me its
property named 'html'. It has nothing to do with displaying anything or
specifying its format.

Here, let's take your JSON output and paste it into www.jsonlint.com so it's
easier to read:

{
data: {
title: ,
year_rec: {
year: 2010
},
description: ,
id: 0936d6115e4,
profile_id: 4b40eea7-2608-4a3b-9c24-7cb04adcd75b
},
status: true,
html: pthis is a good test\/p\r\n
}

You see, it's an object with three properties, named 'data', 'status', and
'html'. The 'data' property is itself an object with properties of its own.

So if you have a variable named 'response' (as in Ibatex's example), then
you can get to these various properties like so:

response.html (the HTML code)
response.data.id (the id)
response.data.year_rec.year (the year)

What you do with those is then up to you, as in Ibatex's earlier example.

BTW do you have the Fiddler debugging proxy server and its JSON plugin (and
standalone JSON viewer)? For the work you're doing now, you *need* these.

http://www.fiddler2.com/
http://www.fiddler2.com/Fiddler2/extensions.asp

-Mike

On Mon, Jan 11, 2010 at 11:41 AM, Dave Maharaj :: WidePixels.com 
d...@widepixels.com wrote:

 My response comes back from the server looking like this: (don’t think its
 right to begin with)


 {data:{title:,year_rec:{year:2010},description:,id:0936d6

 115e4,profile_id:4b40eea7-2608-4a3b-9c24-7cb04adcd75b},status:true,h
 tml:pthis is a good test\/p\r\n}pthis is a good test/p

 But how would I display only the html section and clean it so its not all
 slashed and escaped?

 Thanks

 Dave
 -Original Message-
 From: MorningZ [mailto:morni...@gmail.com]
 Sent: January-11-10 11:44 AM
 To: jQuery (English)
 Subject: [jQuery] Re: Ajax forms help

 But if I am returning json I cant return my normal html

 I don't understand why...

 I pretty much exclusively use JSON back and forth in my jQuery AJAX calls
 and have a standard JSON object i return:

 {
   HasError: boolean,
   Message: string.
   Data: object,
   Count: integer
 }

 Many times i'll return HTML on the data property there  i think the
 problem you are having is how you are creating the JSON return string,
 maybe
 that's not the right way to do it in PHP ??  (to note, i'm a .NET guy, i
 don't know what the PHP way is)

 On Jan 11, 10:06 am, Dave Maharaj :: WidePixels.com
 d...@widepixels.com wrote:
  Right on...looks easy enough.
 
  Is response.html saying to display it as html? I tried making an array
  to pass as json from php then json_encode it so my arrr was $response
  = array('status' = true , 'view' = 'all my html code went here')
 
  But when I returned my view data from the array it was all slahsed //
  // / / / like that.
 
  -Original Message-
  From: Ibatex [mailto:mjgris...@gmail.com]
  Sent: January-11-10 4:35 AM
  To: jQuery (English)
  Subject: [jQuery] Re: Ajax forms help
 
  The beauty of json is that you can transfer alot of different data in
  an organized way. You can very easily send back success/failure status
  along with the html.
 
  success: function(response) {
  // Response was a success
  if (response.status) {
  //update my target div
  $('#target_div').html(response.html);
  // Response contains errors
  } else {
  // return the form with the errors
 
  }
 
  On Jan 10, 5:00 pm, Dave Maharaj :: WidePixels.com
  d...@widepixels.com wrote:
   I need some help with a form.
 
   I submit the form fine, my problem is depending on the success or
   failure of the form being saved. I will try to explain as simple as
   possible
 
   form is in its own div form here . 
 
   div target saved data will appear here/div
 
   So what I need is i guess json success true or false response from
   the form being saved or not then in my success
 
   success: function(response) {
   // Response was a success
   if (response) {
   //update my target div
   // Response contains errors
   } else {
   // return the form with the errors
 
   }
 
   But if I am returning json I cant return my normal html after the
   successful save, and if I return my response as html there is no way
   

Re: [jQuery] Re: Ajax forms help

2010-01-11 Thread John Arrowwood
Your problem looks like it may be on the back-end.  Send the code that
generates the JSON.

On Mon, Jan 11, 2010 at 11:41 AM, Dave Maharaj :: WidePixels.com 
d...@widepixels.com wrote:

 My response comes back from the server looking like this: (don’t think its
 right to begin with)


 {data:{title:,year_rec:{year:2010},description:,id:0936d6

 115e4,profile_id:4b40eea7-2608-4a3b-9c24-7cb04adcd75b},status:true,h
 tml:pthis is a good test\/p\r\n}pthis is a good test/p

 But how would I display only the html section and clean it so its not all
 slashed and escaped?

 Thanks

 Dave
 -Original Message-
 From: MorningZ [mailto:morni...@gmail.com]
 Sent: January-11-10 11:44 AM
 To: jQuery (English)
 Subject: [jQuery] Re: Ajax forms help

 But if I am returning json I cant return my normal html

 I don't understand why...

 I pretty much exclusively use JSON back and forth in my jQuery AJAX calls
 and have a standard JSON object i return:

 {
   HasError: boolean,
   Message: string.
   Data: object,
   Count: integer
 }

 Many times i'll return HTML on the data property there  i think the
 problem you are having is how you are creating the JSON return string,
 maybe
 that's not the right way to do it in PHP ??  (to note, i'm a .NET guy, i
 don't know what the PHP way is)

 On Jan 11, 10:06 am, Dave Maharaj :: WidePixels.com
 d...@widepixels.com wrote:
  Right on...looks easy enough.
 
  Is response.html saying to display it as html? I tried making an array
  to pass as json from php then json_encode it so my arrr was $response
  = array('status' = true , 'view' = 'all my html code went here')
 
  But when I returned my view data from the array it was all slahsed //
  // / / / like that.
 
  -Original Message-
  From: Ibatex [mailto:mjgris...@gmail.com]
  Sent: January-11-10 4:35 AM
  To: jQuery (English)
  Subject: [jQuery] Re: Ajax forms help
 
  The beauty of json is that you can transfer alot of different data in
  an organized way. You can very easily send back success/failure status
  along with the html.
 
  success: function(response) {
  // Response was a success
  if (response.status) {
  //update my target div
  $('#target_div').html(response.html);
  // Response contains errors
  } else {
  // return the form with the errors
 
  }
 
  On Jan 10, 5:00 pm, Dave Maharaj :: WidePixels.com
  d...@widepixels.com wrote:
   I need some help with a form.
 
   I submit the form fine, my problem is depending on the success or
   failure of the form being saved. I will try to explain as simple as
   possible
 
   form is in its own div form here . 
 
   div target saved data will appear here/div
 
   So what I need is i guess json success true or false response from
   the form being saved or not then in my success
 
   success: function(response) {
   // Response was a success
   if (response) {
   //update my target div
   // Response contains errors
   } else {
   // return the form with the errors
 
   }
 
   But if I am returning json I cant return my normal html after the
   successful save, and if I return my response as html there is no way
   to tell the js what to do.
   The form or the target is html code
 
   How can I tell what the response was (true or false) and return the
   appropriate html code for the appropriate form or target?
 
   Thanks
 
   Dave
  No virus found in this incoming message.
  Checked by AVG -www.avg.com
  Version: 9.0.725 / Virus Database: 270.14.130/2607 - Release Date:
  01/10/10 16:05:00
 No virus found in this incoming message.
 Checked by AVG - www.avg.com
 Version: 9.0.725 / Virus Database: 270.14.130/2607 - Release Date: 01/11/10
 04:05:00




-- 
John Arrowwood
John (at) Irie (dash) Inc (dot) com
John (at) Arrowwood Photography (dot) com
John (at) Hanlons Razor (dot) com
--
http://www.irie-inc.com/
http://arrowwood.blogspot.com/


RE: [jQuery] Re: Ajax forms help

2010-01-11 Thread Dave Maharaj :: WidePixels.com
Very detailed response...thank you.

I will give it a try and try an alert on different sections of the response
and see what happens.

I am using firebug to examine the response. Will check the response and
repost and say if it its 1 solid line or broke.

Thanks...will post shortly.

Dave 

-Original Message-
From: Michael Geary [mailto:m...@mg.to] 
Sent: January-11-10 4:36 PM
To: jquery-en@googlegroups.com
Subject: Re: [jQuery] Re: Ajax forms help

The JSON part of your server response looks fine if you take out the two
line breaks - I assume those are just an artifact of posting with Outlook,
and your actual JSON response is all on one line.

But why does it have the HTML content repeated after the last } that closes
the JSON data? You don't want that.

Also:

 Is response.html saying to display it as html?

No! response.html says take the object named 'response' and give me its
property named 'html'. It has nothing to do with displaying anything or
specifying its format.

Here, let's take your JSON output and paste it into www.jsonlint.com so it's
easier to read:

{
data: {
title: ,
year_rec: {
year: 2010
},
description: ,
id: 0936d6115e4,
profile_id: 4b40eea7-2608-4a3b-9c24-7cb04adcd75b
},
status: true,
html: pthis is a good test\/p\r\n
}

You see, it's an object with three properties, named 'data', 'status', and
'html'. The 'data' property is itself an object with properties of its own.

So if you have a variable named 'response' (as in Ibatex's example), then
you can get to these various properties like so:

response.html (the HTML code)
response.data.id (the id)
response.data.year_rec.year (the year)

What you do with those is then up to you, as in Ibatex's earlier example.

BTW do you have the Fiddler debugging proxy server and its JSON plugin (and
standalone JSON viewer)? For the work you're doing now, you *need* these.

http://www.fiddler2.com/
http://www.fiddler2.com/Fiddler2/extensions.asp

-Mike


On Mon, Jan 11, 2010 at 11:41 AM, Dave Maharaj :: WidePixels.com
d...@widepixels.com wrote:


My response comes back from the server looking like this: (don't
think its
right to begin with)


{data:{title:,year_rec:{year:2010},description:,id:0936d6

115e4,profile_id:4b40eea7-2608-4a3b-9c24-7cb04adcd75b},status:true,h
tml:pthis is a good test\/p\r\n}pthis is a good test/p

But how would I display only the html section and clean it so its
not all
slashed and escaped?

Thanks

Dave

-Original Message-
From: MorningZ [mailto:morni...@gmail.com]
Sent: January-11-10 11:44 AM
To: jQuery (English)
Subject: [jQuery] Re: Ajax forms help

But if I am returning json I cant return my normal html

I don't understand why...

I pretty much exclusively use JSON back and forth in my jQuery AJAX
calls
and have a standard JSON object i return:

{
  HasError: boolean,
  Message: string.
  Data: object,
  Count: integer
}

Many times i'll return HTML on the data property there  i think
the
problem you are having is how you are creating the JSON return
string, maybe
that's not the right way to do it in PHP ??  (to note, i'm a .NET
guy, i
don't know what the PHP way is)

On Jan 11, 10:06 am, Dave Maharaj :: WidePixels.com
d...@widepixels.com wrote:
 Right on...looks easy enough.

 Is response.html saying to display it as html? I tried making an
array
 to pass as json from php then json_encode it so my arrr was
$response
 = array('status' = true , 'view' = 'all my html code went here')

 But when I returned my view data from the array it was all slahsed
//
 // / / / like that.

 -Original Message-
 From: Ibatex [mailto:mjgris...@gmail.com]
 Sent: January-11-10 4:35 AM
 To: jQuery (English)
 Subject: [jQuery] Re: Ajax forms help

 The beauty of json is that you can transfer alot of different data
in
 an organized way. You can very easily send back success/failure
status
 along with the html.

 success: function(response) {
 // Response was a success
 if (response.status) {
 //update my target div

$('#target_div').html(response.html);
 // Response contains errors
 } else {
 // return the form with the errors

 }

 On Jan 10, 5:00 pm, Dave Maharaj :: WidePixels.com
 

RE: [jQuery] Re: Ajax forms help

2010-01-11 Thread Dave Maharaj :: WidePixels.com
Ok so this is my js on the page:

$('#test').live('click', test);


function test() {

var data = $('#add_award').serialize();

$.ajax({
type: post,
url: /manage/awards/,
data: data,
dataType: 'json',
success: function(response){
   alert(response.data.id);


}
});

}

No alert happens.

The response shows up as:
{data:{title:,year_rec:{year:2010},description:,id:4cec63
725d2,profile_id:4b40eea7-2608-4a3b-9c24-7cb04adcd75b},status:true,h
tml:pthis is a good test\/p\r\n}pthis is a good test/p

Not sure why the html code gets repeated after the json part. I am using
cake and so far nobody has been able to assit me so im going on trial and
error.

So to test out the alert response I removed the html part leaving only data
and success  so I get a Firebug JSON tab in the response:

{data:{title:,year_rec:{year:2010},description:,id:4ff9c8
f01b8,profile_id:4b40eea7-2608-4a3b-9c24-7cb04adcd75b},status:true}

And alert(response.data.id); = 4ff9c8f01b8

So its just the darn HTML which is killing me here. Cant figure out how to
get just the HTML to apear in the JSON and not display after the code

Dave

 

-Original Message-
From: Michael Geary [mailto:m...@mg.to] 
Sent: January-11-10 4:36 PM
To: jquery-en@googlegroups.com
Subject: Re: [jQuery] Re: Ajax forms help

The JSON part of your server response looks fine if you take out the two
line breaks - I assume those are just an artifact of posting with Outlook,
and your actual JSON response is all on one line.

But why does it have the HTML content repeated after the last } that closes
the JSON data? You don't want that.

Also:

 Is response.html saying to display it as html?

No! response.html says take the object named 'response' and give me its
property named 'html'. It has nothing to do with displaying anything or
specifying its format.

Here, let's take your JSON output and paste it into www.jsonlint.com so it's
easier to read:

{
data: {
title: ,
year_rec: {
year: 2010
},
description: ,
id: 0936d6115e4,
profile_id: 4b40eea7-2608-4a3b-9c24-7cb04adcd75b
},
status: true,
html: pthis is a good test\/p\r\n
}

You see, it's an object with three properties, named 'data', 'status', and
'html'. The 'data' property is itself an object with properties of its own.

So if you have a variable named 'response' (as in Ibatex's example), then
you can get to these various properties like so:

response.html (the HTML code)
response.data.id (the id)
response.data.year_rec.year (the year)

What you do with those is then up to you, as in Ibatex's earlier example.

BTW do you have the Fiddler debugging proxy server and its JSON plugin (and
standalone JSON viewer)? For the work you're doing now, you *need* these.

http://www.fiddler2.com/
http://www.fiddler2.com/Fiddler2/extensions.asp

-Mike


On Mon, Jan 11, 2010 at 11:41 AM, Dave Maharaj :: WidePixels.com
d...@widepixels.com wrote:


My response comes back from the server looking like this: (don't
think its
right to begin with)


{data:{title:,year_rec:{year:2010},description:,id:0936d6

115e4,profile_id:4b40eea7-2608-4a3b-9c24-7cb04adcd75b},status:true,h
tml:pthis is a good test\/p\r\n}pthis is a good test/p

But how would I display only the html section and clean it so its
not all
slashed and escaped?

Thanks

Dave

-Original Message-
From: MorningZ [mailto:morni...@gmail.com]
Sent: January-11-10 11:44 AM
To: jQuery (English)
Subject: [jQuery] Re: Ajax forms help

But if I am returning json I cant return my normal html

I don't understand why...

I pretty much exclusively use JSON back and forth in my jQuery AJAX
calls
and have a standard JSON object i return:

{
  HasError: boolean,
  Message: string.
  Data: object,
  Count: integer
}

Many times i'll return HTML on the data property there  i think
the
problem you are having is how you are creating the JSON return
string, maybe
that's not the right way to do it in PHP ??  (to note, i'm a .NET
guy, i
don't know what the PHP way is)

On Jan 11, 10:06 am, Dave Maharaj :: WidePixels.com
d...@widepixels.com wrote:
 Right on...looks easy enough.

 Is response.html saying to display it as html? I tried making an
array
 to pass as json from php then json_encode it so my arrr was
$response
 = array('status' = true , 'view' = 'all my html code went here')

 But when I returned my view data from the array it was all slahsed
//
 // / / / like that.

 -Original Message-

RE: [jQuery] Re: Ajax forms help

2010-01-11 Thread Dave Maharaj :: WidePixels.com
I am using CakePHP to send the JSONfamiliar with that?
 
if ( $this-RequestHandler-isAjax() ) {
   
   Configure::write ( 'debug', 0 );
   $this-layout = 'ajax';
   $this-autoLayout = false;
   $this-autoRender = false;
 
$this-data['Award']['id'] = $this-Award-generateKey('11');
$this-data['Award']['profile_id'] = $this-Auth-User('id');

  
  $response['data'] = $this-data['Award'];
  $response['status'] = true;
  //$response['html'] = $this-render('dummy');
  
  
  $this-header('Content-Type: application/json');
  echo json_encode($response);
  return;
}



From: John Arrowwood [mailto:jarro...@gmail.com] 
Sent: January-11-10 4:45 PM
To: jquery-en@googlegroups.com
Subject: Re: [jQuery] Re: Ajax forms help


Your problem looks like it may be on the back-end.  Send the code that
generates the JSON.


On Mon, Jan 11, 2010 at 11:41 AM, Dave Maharaj :: WidePixels.com
d...@widepixels.com wrote:


My response comes back from the server looking like this: (don't
think its
right to begin with)


{data:{title:,year_rec:{year:2010},description:,id:0936d6

115e4,profile_id:4b40eea7-2608-4a3b-9c24-7cb04adcd75b},status:true,h
tml:pthis is a good test\/p\r\n}pthis is a good test/p

But how would I display only the html section and clean it so its
not all
slashed and escaped?

Thanks

Dave
-Original Message-
From: MorningZ [mailto:morni...@gmail.com]
Sent: January-11-10 11:44 AM
To: jQuery (English)
Subject: [jQuery] Re: Ajax forms help

But if I am returning json I cant return my normal html

I don't understand why...

I pretty much exclusively use JSON back and forth in my jQuery AJAX
calls
and have a standard JSON object i return:

{
  HasError: boolean,
  Message: string.
  Data: object,
  Count: integer
}

Many times i'll return HTML on the data property there  i think
the
problem you are having is how you are creating the JSON return
string, maybe
that's not the right way to do it in PHP ??  (to note, i'm a .NET
guy, i
don't know what the PHP way is)

On Jan 11, 10:06 am, Dave Maharaj :: WidePixels.com
d...@widepixels.com wrote:
 Right on...looks easy enough.

 Is response.html saying to display it as html? I tried making an
array
 to pass as json from php then json_encode it so my arrr was
$response
 = array('status' = true , 'view' = 'all my html code went here')

 But when I returned my view data from the array it was all slahsed
//
 // / / / like that.

 -Original Message-
 From: Ibatex [mailto:mjgris...@gmail.com]
 Sent: January-11-10 4:35 AM
 To: jQuery (English)
 Subject: [jQuery] Re: Ajax forms help

 The beauty of json is that you can transfer alot of different data
in
 an organized way. You can very easily send back success/failure
status
 along with the html.

 success: function(response) {
 // Response was a success
 if (response.status) {
 //update my target div

$('#target_div').html(response.html);
 // Response contains errors
 } else {
 // return the form with the errors

 }

 On Jan 10, 5:00 pm, Dave Maharaj :: WidePixels.com
 d...@widepixels.com wrote:
  I need some help with a form.

  I submit the form fine, my problem is depending on the success
or
  failure of the form being saved. I will try to explain as simple
as
  possible

  form is in its own div form here . 

  div target saved data will appear here/div

  So what I need is i guess json success true or false response
from
  the form being saved or not then in my success

  success: function(response) {
  // Response was a success
  if (response) {
  //update my target div
  // Response contains errors
  } else {
  // return the form with the
errors

  }

  But if I am returning json I cant return my normal html after
the
  successful save, and if I return my response as html there is no
way
  to 

RE: [jQuery] Re: Ajax forms help

2010-01-11 Thread Dave Maharaj :: WidePixels.com
Sorry for the number of back to back posts...just making progress somewhat.

OK! I got it part ways no more html after the JSON.
 
{data:{title:,year_rec:{year:2010},description:,id:6186d5
5b8f0,profile_id:4b40eea7-2608-4a3b-9c24-7cb04adcd75b},status:true,h
tml:pthis is a good test\/p\r\n}

Now to display the HTML but without all the \/p\r\n

Dave



From: John Arrowwood [mailto:jarro...@gmail.com] 
Sent: January-11-10 4:45 PM
To: jquery-en@googlegroups.com
Subject: Re: [jQuery] Re: Ajax forms help


Your problem looks like it may be on the back-end.  Send the code that
generates the JSON.


On Mon, Jan 11, 2010 at 11:41 AM, Dave Maharaj :: WidePixels.com
d...@widepixels.com wrote:


My response comes back from the server looking like this: (don't
think its
right to begin with)


{data:{title:,year_rec:{year:2010},description:,id:0936d6

115e4,profile_id:4b40eea7-2608-4a3b-9c24-7cb04adcd75b},status:true,h
tml:pthis is a good test\/p\r\n}pthis is a good test/p

But how would I display only the html section and clean it so its
not all
slashed and escaped?

Thanks

Dave
-Original Message-
From: MorningZ [mailto:morni...@gmail.com]
Sent: January-11-10 11:44 AM
To: jQuery (English)
Subject: [jQuery] Re: Ajax forms help

But if I am returning json I cant return my normal html

I don't understand why...

I pretty much exclusively use JSON back and forth in my jQuery AJAX
calls
and have a standard JSON object i return:

{
  HasError: boolean,
  Message: string.
  Data: object,
  Count: integer
}

Many times i'll return HTML on the data property there  i think
the
problem you are having is how you are creating the JSON return
string, maybe
that's not the right way to do it in PHP ??  (to note, i'm a .NET
guy, i
don't know what the PHP way is)

On Jan 11, 10:06 am, Dave Maharaj :: WidePixels.com
d...@widepixels.com wrote:
 Right on...looks easy enough.

 Is response.html saying to display it as html? I tried making an
array
 to pass as json from php then json_encode it so my arrr was
$response
 = array('status' = true , 'view' = 'all my html code went here')

 But when I returned my view data from the array it was all slahsed
//
 // / / / like that.

 -Original Message-
 From: Ibatex [mailto:mjgris...@gmail.com]
 Sent: January-11-10 4:35 AM
 To: jQuery (English)
 Subject: [jQuery] Re: Ajax forms help

 The beauty of json is that you can transfer alot of different data
in
 an organized way. You can very easily send back success/failure
status
 along with the html.

 success: function(response) {
 // Response was a success
 if (response.status) {
 //update my target div

$('#target_div').html(response.html);
 // Response contains errors
 } else {
 // return the form with the errors

 }

 On Jan 10, 5:00 pm, Dave Maharaj :: WidePixels.com
 d...@widepixels.com wrote:
  I need some help with a form.

  I submit the form fine, my problem is depending on the success
or
  failure of the form being saved. I will try to explain as simple
as
  possible

  form is in its own div form here . 

  div target saved data will appear here/div

  So what I need is i guess json success true or false response
from
  the form being saved or not then in my success

  success: function(response) {
  // Response was a success
  if (response) {
  //update my target div
  // Response contains errors
  } else {
  // return the form with the
errors

  }

  But if I am returning json I cant return my normal html after
the
  successful save, and if I return my response as html there is no
way
  to tell the js what to do.
  The form or the target is html code

  How can I tell what the response was (true or false) and return
the
  appropriate html code for the appropriate form or target?

  Thanks

 

[jQuery] Re: Displaying reviews using js widgets such as in freeindex.co.uk

2010-01-11 Thread Scott Sauyet
On Jan 11, 2:18 pm, Viz skillipedia skillipe...@googlemail.com
wrote:
 Thank you very much

You're welcome.

 I am, now, certain the document.write()  is all what in need: i process
 the request in Java handler and  may be a bit of jsp scripting and all the
 rest is easy

Note, though, that it might still be a good idea for the server to
offer a JSONP version anyway.  This way, JS-savvy users could
integrate the reviews into their site as they like, without using a
widget which might not fit at all with their design.  Just a thought.

Good luck,

  -- Scott


[jQuery] Re: Ajax forms help

2010-01-11 Thread MorningZ
Hmm, that's weird... i don't know why escaping/unescaping is an
issue... this is an actual working example of returned JSON from what
I am working on today:

stripped down a bit for brevity, and since Google Groups will break up
the Data line, it's really all one line (no line breaks like i
added)

{
 HasError:false,
 Mode:Cache_List,
 Message:,
 Data:table class=\Cache_Table\
   thead
   trthFile Name/th/tr
   /thead
   tbody
   trtd022308_Post_Attempt.xml/td/tr
   /tbody/table
}

and i just simply say

$(#Results).html(response.Data);

there's no action directly needed by me to unescape the class name
of the table


On Jan 11, 3:41 pm, Dave Maharaj :: WidePixels.com
d...@widepixels.com wrote:
 Sorry for the number of back to back posts...just making progress somewhat.

 OK! I got it part ways no more html after the JSON.

 {data:{title:,year_rec:{year:2010},description:,id:6186d5
 5b8f0,profile_id:4b40eea7-2608-4a3b-9c24-7cb04adcd75b},status:true,h
 tml:pthis is a good test\/p\r\n}

 Now to display the HTML but without all the \/p\r\n

 Dave

 

 From: John Arrowwood [mailto:jarro...@gmail.com]
 Sent: January-11-10 4:45 PM
 To: jquery-en@googlegroups.com
 Subject: Re: [jQuery] Re: Ajax forms help

 Your problem looks like it may be on the back-end.  Send the code that
 generates the JSON.

 On Mon, Jan 11, 2010 at 11:41 AM, Dave Maharaj :: WidePixels.com

 d...@widepixels.com wrote:

         My response comes back from the server looking like this: (don't
 think its
         right to begin with)

 {data:{title:,year_rec:{year:2010},description:,id:0936d6

 115e4,profile_id:4b40eea7-2608-4a3b-9c24-7cb04adcd75b},status:true,h
         tml:pthis is a good test\/p\r\n}pthis is a good test/p

         But how would I display only the html section and clean it so its
 not all
         slashed and escaped?

         Thanks

         Dave

         -Original Message-
         From: MorningZ [mailto:morni...@gmail.com]
         Sent: January-11-10 11:44 AM
         To: jQuery (English)
         Subject: [jQuery] Re: Ajax forms help

         But if I am returning json I cant return my normal html

         I don't understand why...

         I pretty much exclusively use JSON back and forth in my jQuery AJAX
 calls
         and have a standard JSON object i return:

         {
           HasError: boolean,
           Message: string.
           Data: object,
           Count: integer
         }

         Many times i'll return HTML on the data property there  i think
 the
         problem you are having is how you are creating the JSON return
 string, maybe
         that's not the right way to do it in PHP ??  (to note, i'm a .NET
 guy, i
         don't know what the PHP way is)

         On Jan 11, 10:06 am, Dave Maharaj :: WidePixels.com
         d...@widepixels.com wrote:
          Right on...looks easy enough.

          Is response.html saying to display it as html? I tried making an
 array
          to pass as json from php then json_encode it so my arrr was
 $response
          = array('status' = true , 'view' = 'all my html code went here')

          But when I returned my view data from the array it was all slahsed
 //
          // / / / like that.

          -Original Message-
          From: Ibatex [mailto:mjgris...@gmail.com]
          Sent: January-11-10 4:35 AM
          To: jQuery (English)
          Subject: [jQuery] Re: Ajax forms help

          The beauty of json is that you can transfer alot of different data
 in
          an organized way. You can very easily send back success/failure
 status
          along with the html.

          success: function(response) {
                                  // Response was a success
                                  if (response.status) {
                                          //update my target div

 $('#target_div').html(response.html);
                                  // Response contains errors
                                  } else {
                                          // return the form with the errors

                                  }

          On Jan 10, 5:00 pm, Dave Maharaj :: WidePixels.com
          d...@widepixels.com wrote:
           I need some help with a form.

           I submit the form fine, my problem is depending on the success
 or
           failure of the form being saved. I will try to explain as simple
 as
           possible

           form is in its own div form here . 

           div target saved data will appear here/div

           So what I need is i guess json success true or false response
 from
           the form being saved or not then in my success

           success: function(response) {
                                   // Response was a success
                                   if (response) {
                                           //update my target div
    

[jQuery] Effects/show callback in Internet Explorer

2010-01-11 Thread Mimi
Hello,
I am new to jQuery and over all web development.

I recently created a site using jQuery Effects/show (callback)
function, with a very basic show/hide effect.

$(button).click(function () {

 $(p).show(slow);
   });


However, it works fine in Safari and Firefox, but does not work at all
in Internet Explorer, even the latest version 8.  Since I am very much
an amateur, I probably did something very obviously wrong...

I think it's the way I tagged bio2 with out a class or id, but I've
tried different ways to go about it and it doesn't seem to work even
on Safari or Firefox if I change anything.

I've included my basic code below along with the link to the actual
site, in hopes that someone has a suggestion for me.
Any help or advice is greatly appreciated!

P.S. I downloaded jquery_latest.js and compressed it.  It's labled
jquery_latest.comp.js and linked as a separate file.

link to site: http://www.leylamccalla.com
(Firefox + Safari is how I would like it to work)





Code:

---

head

 script src=Scripts/jquery_latest_comp.js/script

 script
   $(document).ready(function(){
   $(bio).click(function () {$(bio2).show(1500);
 });
 });


  $(document).ready(function(){
$(clo).click(function () {$(bio2).hide(400);

 });
 });

 /script

 style


  #bio {position: absolute;
   width:115px;
   left: 110px;
   top: 63px;
   text-align: center;
   cursor:pointer;
   z-index:2;}


  bio2 {background-image:url(images/bio_back.jpg);
  background-repeat:no-repeat;
  width:805px;
  height:504px;
  position:absolute;}


  clo {position:absolute;
 width:20px;
 height:20px;
 left:750px;
 top:450px;
 z-index:2;
 color:#063;
cursor:pointer;}



  .content {position:absolute;
 left:0px;
 top: 135px;
 display:none;}

 /style


/head

body

 div id=bio

   bio
 a onClick=document.getElementById
('bio').style.color='#99';
  bio
 /a
/bio
 /div


  bio2 style=display: none class=content
 pTEXT HERE/p

   cloa onClick=document.getElementById
('bio').style.color='#000';X/a/clo
   /bio2


/body

Thanks so much!


[jQuery] Suckerfish/Superfish functionality in article content

2010-01-11 Thread SommelierLarry
Hello,

I am working on a music portal site with Joomla 1.5.15. (http://
www.mjamusic.com). On the page MJ's Gear I want to implement a
suckerfish/superfish style menu - within the article content  I
know that this is not the intended use for this so I am wondering if
there have been any successful implementations of this concept.

The line of text is:

Guitars  ||  Amplifiers  ||  Racks, Peddles  Boxes  || Speaker
Cabinets ||  Microphones  ||  Cableing  ||  other cool stuff

Ideally a user would mouseover a category and a list of linked entries
would fall down that they could click on and open an ajax popup window
with the article about each item so if the user were to mouse over
Guitars a list would float down showing something like the following

Guitars  ||  Amplifiers  ||  Racks, Peddles  Boxes  || Speaker
Cabinets ||  Microphones  ||  Cableing  ||  other cool stuff
Fender Stratocaster
Fender Telecaster
Gibson Les Paul
Gibson ES 335

I have tried setting up a new menu and module using the Superfish
module plugin , called MJ's Gear, populated it with the above
categories, plus sub-menu items. Then I tried to use the Modules
Anywhere plugin to slip it into the article content but that has not
worked.

Any ideas? Some php tweaks that a php novice could tackle? I'd really
like this functionality but I have never seen menu functionality
inside an article, am unsure if it can be done without custom
programming.

I look forward to hearing any ideas or the holy grail - a solution

Best regards,
Laurence


[jQuery] Simplemodal confirm dialog returns true/false

2010-01-11 Thread jason.le
Hello all,

I am currently using the simplemodal confirm dialog from Eric Martin.
What do I need to modify to have the confirm dialog return true if the
user clicks Yes, and false otherwise.

for example something like this:


[jQuery] Autocomplete selection blanks out input field

2010-01-11 Thread j...@verax
Hi,

I have been using the jquery autocomplete plug-in for some time now
and find it very useful. Lately I have come across the following
problem in one of my JSP pages.

The autocomplete suggestions are displayed and formatted properly. But
when I select the one that I want, the result briefly appears in the
input field and disappears. Simultaneously, the entered result
automatically triggers another jquery search.

The contents of my JSP page is given below. The same jquery code works
perfectly well with other JSPs. Can anyone help ?

--JSP
code

%@ include file=../common/include.jsp %
script
var cols = []; // column mappings : 0=Last name, 
1=First Name,
2=Title, 3 = Employee ID
$().ready(function() {
$('input#employeeLastName').flushCache();

$(#employeeLastName).autocomplete(jsp/common/getData.jsp?
dataType=EmployeeName,{
minChars: 1,
max: 1000,
width: 400,
delay: 1000,
selectFirst: false,
autoFill: false,
cacheLength: 20,
matchContains: false,
matchSubset: true,
mustMatch: true,
matchCase: true,
formatItem: function(row, i, max) {
cols = row[0].split(%);
return i + / + max + :  + 
cols[0] + ,  + cols[1] +  ( +
cols[2] + );
},
formatMatch: function(row) {
cols = row[0].split(%);
return cols[0] + ,  + cols[1];
},
formatResult: function(row) {
cols = row[0].split(%);
return cols[0] + ,  + cols[1] 
+  ( + cols[2] + );
}
});
$(#employeeLastName).result(function(event, 
row, formatted) {
if (row) {
cols = row[0].split(%);
$(this).next().val(cols[3]);
}
});
});
/script

tiles:importAttribute name=task /
tiles:importAttribute name=action /
tiles:importAttribute name=displayAction /
tiles:importAttribute name=showArchived /

style type=text/css
@import ${pageContext.request.contextPath}/css/employee/select.css;
/style


h1
fmt:message key=employee.label.title.select /
/h1
hr /

div id=employeeSelect
tiles:insert definition=successMessages /
tiles:insert definition=failureMessages /
ccrd:errors /

html:form action=${action} method=post 

label for=employee id=employeeLbl 
fmt:message key=employee.text.selectEmployee /
span class=taskfmt:message key=${task} /:/span
/label

html:text styleId=employeeLastName property=lastName
size=100
maxlength=200
/html:text
html:hidden property=employeeId /
BR/ BR/
div class=buttons
html:submit property=submit 
styleId=submitButtonfmt:message
key=button.submit//html:submit
html:submit property=cancel 
styleId=cancelButtonfmt:message
key=button.cancel//html:submit
/div

/html:form
/div

---end of jsp
code--




[jQuery] Re: Need help with a required field from radio selection

2010-01-11 Thread Jules
$(form).validate(
{
rules: {
legal_status_comment: {
required: function(element) {
return $
([name=legal_status]:checked).attr(id) == other_radio;
}
}
}
});

On Jan 12, 3:43 am, jeffself jeff.s...@gmail.com wrote:
 I've got a form with a radio group called 'legal_status'. There are
 five radio buttons. The last one has an id='other_radio'. If this
 button is selected, I have a textarea field that gets displayed. The
 field has an id='legal_status_comment'. This textarea field is wrapped
 by a div with an id='other_text_area' that is hidden until the
 other_radio button is selected.

 How do I write the rule to make the 'legal_status_comment' field to be
 required if the 'other_radio' button has been selected?

 Thanks!


[jQuery] Fade question

2010-01-11 Thread Dave Maharaj :: WidePixels.com
When i add a new record its inserted into a div. How can I make it so its
has a color then fades out. Kind of like a success message after you save
something only i am just fading out the color not the content.
 
jquery UI highlight is a good example of the idea i am looking for.
 
So I have my:
 
$(response.html).hide().prependTo('#sortable').slideDown('slow');
 
so i would like it to be yellow for example when the user first sees the new
record then slowly fade out leaving only the record.
 
Thanks
 
Dave


[jQuery] Re: Fade question

2010-01-11 Thread MorningZ
I used the color plugin for exactly that... works really well

http://plugins.jquery.com/project/color
http://dev.jquery.com/~john/ticket/fx-rewrite2/


On Jan 11, 5:35 pm, Dave Maharaj :: WidePixels.com
d...@widepixels.com wrote:
 When i add a new record its inserted into a div. How can I make it so its
 has a color then fades out. Kind of like a success message after you save
 something only i am just fading out the color not the content.

 jquery UI highlight is a good example of the idea i am looking for.

 So I have my:

 $(response.html).hide().prependTo('#sortable').slideDown('slow');

 so i would like it to be yellow for example when the user first sees the new
 record then slowly fade out leaving only the record.

 Thanks

 Dave


RE: [jQuery] Re: Fade question

2010-01-11 Thread Dave Maharaj :: WidePixels.com
Right on thanks...

I looked around but noting simple so I will def check it out.

Thanks.

Dave 

-Original Message-
From: MorningZ [mailto:morni...@gmail.com] 
Sent: January-11-10 7:30 PM
To: jQuery (English)
Subject: [jQuery] Re: Fade question

I used the color plugin for exactly that... works really well

http://plugins.jquery.com/project/color
http://dev.jquery.com/~john/ticket/fx-rewrite2/


On Jan 11, 5:35 pm, Dave Maharaj :: WidePixels.com
d...@widepixels.com wrote:
 When i add a new record its inserted into a div. How can I make it so 
 its has a color then fades out. Kind of like a success message after 
 you save something only i am just fading out the color not the content.

 jquery UI highlight is a good example of the idea i am looking for.

 So I have my:

 $(response.html).hide().prependTo('#sortable').slideDown('slow');

 so i would like it to be yellow for example when the user first sees 
 the new record then slowly fade out leaving only the record.

 Thanks

 Dave
No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 9.0.725 / Virus Database: 270.14.130/2607 - Release Date: 01/11/10
16:05:00



[jQuery] Re: Fade question

2010-01-11 Thread MorningZ
I forgot to add, that demo page doesn't exact have a bare bones
example of just the color part..

so here is one

http://jsbin.com/unuru/edit (code)
http://jsbin.com/unuru (run)

including the color.js pretty much let's one use the .animate
method with these CSS properties:
'backgroundColor', 'borderBottomColor', 'borderLeftColor',
'borderRightColor', 'borderTopColor', 'color', 'outlineColor'

On Jan 11, 6:35 pm, Dave Maharaj :: WidePixels.com
d...@widepixels.com wrote:
 Right on thanks...

 I looked around but noting simple so I will def check it out.

 Thanks.

 Dave

 -Original Message-
 From: MorningZ [mailto:morni...@gmail.com]
 Sent: January-11-10 7:30 PM
 To: jQuery (English)
 Subject: [jQuery] Re: Fade question

 I used the color plugin for exactly that... works really well

 http://plugins.jquery.com/project/colorhttp://dev.jquery.com/~john/ticket/fx-rewrite2/

 On Jan 11, 5:35 pm, Dave Maharaj :: WidePixels.com
 d...@widepixels.com wrote:
  When i add a new record its inserted into a div. How can I make it so
  its has a color then fades out. Kind of like a success message after
  you save something only i am just fading out the color not the content.

  jquery UI highlight is a good example of the idea i am looking for.

  So I have my:

  $(response.html).hide().prependTo('#sortable').slideDown('slow');

  so i would like it to be yellow for example when the user first sees
  the new record then slowly fade out leaving only the record.

  Thanks

  Dave
 No virus found in this incoming message.
 Checked by AVG -www.avg.com
 Version: 9.0.725 / Virus Database: 270.14.130/2607 - Release Date: 01/11/10
 16:05:00


[jQuery] Re: Simplemodal confirm dialog returns true/false

2010-01-11 Thread jason.le
After some research, I found out that there is no way to pause the
execution and wait for the user's response.
using callback does not really work in my case.
i guess I have to figure something out.


On Jan 11, 12:20 pm, jason.le luong_l...@yahoo.com wrote:
 Hello all,

 I am currently using the simplemodal confirm dialog from Eric Martin.
 What do I need to modify to have the confirm dialog return true if the
 user clicks Yes, and false otherwise.

 for example something like this:


RE: [jQuery] Effects/show callback in Internet Explorer

2010-01-11 Thread Andreas Möller
You've got errors in your presentation and, consequently, in your behaviour, as 
Jeffrey Zeldman would say, I reckon.

Here

 $(bio).click(function () {});

you are applying a selector which should select an element in your DOM with the 
tag bio. However, no such element exists - neither in HTML nor XHTML. 

The same applies to

  $(clo).click(function () {});
  $(bio2).hide(400);

Then, in your CSS, you do the same, basically, you're applying the same CSS 
selector as above, as the argument to the JQuery select function, but an 
element with the tag bio2 does not exist in HTML nor XHTML, and it probably 
never will.

  bio2 {}
  clo {}

However, you got it right with the class selector:
  
  .content {}

Then, in your HTML, you've got

  bio
  a onClick=document.getElementById
('bio').style.color='#99';
  bio
 /a
/bio

As said before, such an element does not exist in HTML nor XHTML, and it 
probably never will.

Same applies to

  bio2 style=display: none class=content
cloa onClick=document.getElementById
('bio').style.color='#000';X/a
/clo
/bio2

You need to remove the invalid tags, otherwise your markup will not be valid. 
So, depending on whether you have one (id) or many (class) elements in the DOM 
to which effects should be applied, you need to fix your markup first with

  div id=bio2/div

or 

div class=bio2/div

, then you need to fix your CSS and your JQuery with appropriate selectors, 
i.e.,

  #bio2 {}

or

  .bio2 {}

and 

  $(#bio2)

or

  $(.bio2)

.

Then: remove inline CSS (no good), inline JS (btw, when you're using JQuery, 
you should let JQuery do the job, so replace

a onClick=document.getElementById
('bio').style.color='#000';X/a

with something that works. Hey, you've already got it in your code, but darn, 
you've got the HTML and your CSS selectors wrong.


Best regards,

Andreas



[jQuery] Re: Using cluetip with image maps and area element

2010-01-11 Thread Khiet
Thanks,

I figure out the problem, nothing to do with cluetip or javascript. I
positionned 3 divs one on top of another, the areas beneath of all
were not detected in all browsers except IE.

On Jan 10, 1:56 pm, Khiet tkh...@gmail.com wrote:
 Hi,

 I am trying to use an image map with cluetip. Everything seems to work
 as expected on IE 8, but the tooltip refuses to display on all other
 browsers (Firefox, Chrome)
 I am not a Javascript expert, could someone help out and point me to
 the right direction? I also tried the plugin stickytooltip and the
 same difference between browsers happen, is there something special
 with image maps?

 You could consult the result 
 herehttp://montrealaikikai.qc.ca/site-www.montrealaikikai.qc.ca-20091214-...

 Here' how I initialize cluetip:

 script type=text/javascript src=includes/js/cluetip/lib/
 jquery.hoverIntent.js/script
 script type=text/javascript src=includes/js/cluetip/
 jquery.cluetip.js/script

 script type=text/javascript
 !--
 $(document).ready(function() {
  $.cluetip.setup({insertionElement: '.schedule'});
  $('.tip').cluetip(
   {
     cluetipClass:'default',
     attribute:'href',
     titleAttribute:'alt',
     local:true,
     hideLocal:true,
     sticky: true,
     mouseOutClose: true,
     closePosition:    'title',
     closeText: 'Close',
     arrows: true,
     hoverIntent: false,
     cursor: 'pointer',
     tracking:true,
     fx: {
                       open:       'slideDown', // can be 'show' or
 'slideDown' or 'fadeIn'
                       openSpeed:  '0.5'
     },
     // settings for when hoverIntent plugin is used
     hoverIntent: {
                       sensitivity:  1,
                       interval:     50,
                       timeout:      0
     }
   });});

 --
 /script

 And the image map element

       img name=schedule src=images/stories/general/schedule.png
 width=386 height=278 border=0 id=schedule usemap=#m_schedule
 alt= /
       map name=m_schedule
         area class=tip shape=rect coords=323,64,361,136
 href=#free-tooltip alt=Open practice period/
         area class=tip shape=rect coords=285,28,323,82
 href=#children-tooltip alt=Children  Teenagers class/
         area class=tip shape=rect coords=285,82,323,118
 href=#regular-tooltip alt=Regular class/
         area class=tip shape=rect coords=210,207,248,243
 href=#5k-tooltip alt=Dismarmament class/
         area class=tip shape=rect coords=247,171,285,207
 href=#regular-tooltip alt=Regular class/
         area class=tip shape=rect coords=210,136,248,172
 href=#regular-tooltip alt=Regular class/
         area class=tip shape=rect coords=173,136,211,172
 href=#regular-tooltip alt=Regular class/
         area class=tip shape=rect coords=136,242,174,278
 href=#4k-tooltip alt=Advanced class/
         area class=tip shape=rect coords=136,207,174,243
 href=#regular-tooltip alt=Regular class /
         area class=tip shape=rect coords=173,208,211,260
 href=#beginner-tooltip alt=Beginner class/
         area class=tip shape=rect coords=210,172,248,208
 href=#regular-tooltip alt=Regular class/
         area class=tip shape=rect coords=173,172,211,208
 href=#regular-tooltip alt=Regular class/
         area class=tip shape=rect coords=136,172,174,208
 href=#weapon-tooltip atl=Ken and Jo/
         area class=tip shape=rect coords=98,172,136,208
 href=#regular-tooltip alt=Regular class/
         area class=tip shape=rect coords=98,208,136,260
 href=#beginner-tooltip alt=Beginner class/
       /map
     /div
       div id=tips style=display: none;
         div id=regular-tooltipAny student of the dojo with a
 iregular/i membership could participate in this class./div
         div id=children-tooltipConsult the a 
 href=http://www.montrealaikikai.qc.ca/index.php?option=com_contenttask=viewid=111;calendar/a
 for active sessions./div
         div id=weapon-tooltipClass focused on study of aikido
 weapons. Any student of the dojo with a iregular/i membership
 could participate in this class. Each student should bring their own
 equipment. /div
         div id=4k-tooltipParticipants must be graded 4th kyu or
 more/div
         div id=5k-tooltipParticipants must be graded 5th kyu or
 more/div
         div id=beginner-tooltipConsult the a 
 href=http://www.montrealaikikai.qc.ca/index.php?option=com_contenttask=viewid=111;calendar/a
 for active sessions./div
         div id=free-tooltipNo formal class is given. All students
 are welcome./div
       /div


[jQuery] Re: Argh!! IE8!

2010-01-11 Thread RobG


On Jan 12, 5:51 am, Valerij valeri...@gmail.com wrote:
 Hey guys, I have this popup menu that works.. great! In Chrome,
 Safari, Firefox AND it USED to work in IE8, until I added just 1 div.
[...]

 This works in all the browsers great even after I added this div, but
 in IE8 it suddenly stopped.

 a id=acc class=baritem href=javascript:void(0);div
 class=textupMy Account/div/a

Your markup is invalid, div elements don't belong inside a elements.

[...]
 Is there a fix for this?

Start with valid markup: URL: http://validator.w3.org/ 


--
Rob


[jQuery] Re: long-term browser support strategy

2010-01-11 Thread RobG


On Jan 11, 10:47 pm, mikewse mike...@gmail.com wrote:
 What is jQuery's long-term strategy for browser support - cut off
 browsers after a certain number of years or when going below a certain
 market share?

 [I'm asking because of the current trend (among some webdevs and also
 library developers) advocating to remove IE6 support and force these
 users to upgrade their browser.

IE 6 use is 3 times that of Safari (all versions) depending on whose
statistics you believe. Why not drop support for Safari while you're
at it? And Opera and Chrome?

 I work with several clients that do
 not want to lead the way in this respect, and need to support IE6 as
 long as it has a fair usage share, which may be for several more
 years.]

That is a sensible decision - they should not care what browser their
visitors are using any more than the colour shoes they might be
wearing. If support for the quirks of a particular browser is already
built into a library, and the library architecture efficiently
implements capability and feature detection to work around them, why
go to the effort of removing support?


--
Rob


[jQuery] Filter xml data before display

2010-01-11 Thread stevo
Hi all,

I have an xml file that is dynamically generated at periodic intervals
onto disk. the information contained in this file is displayed in a
vertical scroller and this works fine.

I however need to filter the data based on the logged-in users
preferences. These preferences are stored in a database and retrieved
after the user logs in.

Only data in the xml file that match the user's preferences must be
displayed.

Thanks in advance.



[jQuery] iHwy creditcard2 validation extension fails on some Discover cards

2010-01-11 Thread dnfdrmn
Hi all,

We're working with Paypal sandbox generated Discover cards, and
they're not passing the iHwy credit card validation extension for
jQuery. This seems to be a PayPal issue, as PayPal is generating
invalid IIN ranges.

But in our research, we noticed that the iHwy extension isn't properly
validating *newer* Discover IIN range updates (two PDFs are available
online, from

An update that takes into account the new ranges -- 6011,
622126-622925, 644-649, 65 -- would be much appreciated.

regards,
dnfdrmn


[jQuery] any help on this!!!

2010-01-11 Thread JQueryNewbie
I cant get my color  change on my listitem. any help would be
appreciated. Thanks in advance.

head
title/title

script src=scripts/jquery-1.3.2.js type=text/javascript/
script
script type=text/javascript
$(document).ready(function() {
$(dt-link1).toggle(function() {
$('#jqdt').find('ol li:eq(0)').css(color,Blue);
   return false;
});
});
/script

/head
body

div id=jqdt
ol
lilist item 1 with dummy link to silly.pdf /li
lilist item 2 with class=goofy /li
lilist item 3 SURPRISE! /li
lilist item 4 with silly link to silly.pdf /li
/ol
/div

br/
   button id=dt-link1 type=buttontoggle first list item/button
   button id=dt-link2 type=buttontoggle first li even/button

/body


  1   2   >