[jQuery] Re: google.load(jquery) and jquery plugins

2010-01-27 Thread barton
See I knew it was easy, just didn't think of that.
Thanks loads.

On Jan 27, 2:55 am, Peter Edwards p...@bjorsq.net wrote:
 Use google.setOnLoadCallback to add whatever plugins you need using
 jQuery's $.getScript function like this:

 google.load(jquery, 1);
 google.setOnLoadCallback(function() {

 $.getScript(http://inlinemultiselect.googlecode.com/files/jquery.inlinemultiselec...;,
 function(){
      $('select.normal').inlinemultiselect();
    });

 });

 on 26/01/2010 19:04 barton said::

  When I try to use google.load to load jquery I have problems loading
  other jquery plugins. Somehow I need to be able to wait for jquery to
  be loaded by the google Ajax api before doing the script type=text/
  javascript src=thePluginThatNeedsJquery/script
  I know that google has google.setOnLoadCallback(function() {
  but how do I do the script stuff inside that?

  The answer must be pretty obvious as I couldn't find anything when I
  searched the group but I don't see it.

  Thanks


[jQuery] google.load(jquery) and jquery plugins

2010-01-26 Thread barton
When I try to use google.load to load jquery I have problems loading
other jquery plugins. Somehow I need to be able to wait for jquery to
be loaded by the google Ajax api before doing the script type=text/
javascript src=thePluginThatNeedsJquery/script
I know that google has google.setOnLoadCallback(function() {
but how do I do the script stuff inside that?

The answer must be pretty obvious as I couldn't find anything when I
searched the group but I don't see it.

Thanks


[jQuery] Moving, sliding and fading text...

2009-09-08 Thread Barton

Hello,

I'm a newbie to jQuery and wanted to know if the following could be
replicated using jQuery instead of Flash?

www.cocoonurbanspa.gr - click your language, and you will then see the
element I would like to recreate

Thanks again,

Barton.


[jQuery] Re: iframe and xml

2009-06-10 Thread barton

Yes I have done that too. This is one of those because it's there
things. Also when I load the iframe via the src= the browser
interprets the xml (or at least Firefox does). To see the xml you have
to View|Page Source.

Also, the behavior of src=atom.xml and src=data:text/
xml;base64, (where  is the base64 encoded atom.xml) is
different. The latter does show the xml not the html rendering of it.

I am just curious why? Why can't I load the xml via load or some
other ajax function into an iframe and replace the html all
together. Is an iframe inherently an html container?

If I do $(body, doc).load(atom.xml) the xml is loaded like this:
body
feed xmlns=http://purl.org/atom/ns#; version=0.3

/feed
and that is OK.

Inquiring minds want to know:)
On Jun 10, 5:55 am, Paul Mills paul.f.mi...@gmail.com wrote:
 Hi,
 I'm confused as to why you are trying to load XML into an iframe using
 AJAX.
 Why not just set src=atom.xml and load the feed directly into the
 iframe?

 Paul

 On Jun 9, 9:13 pm, barton bartonphill...@gmail.com wrote:

  I have been trying to insert xml into an iframe. I can do it kinda.
  The problem is the iframe has html/html tags and if the xml has
  items that look like head tags like title etc they end up in the
  head. For example I have a atom file that looks like this:

  ?xml version=1.0 encoding=UTF-8?
  feed version=0.3 xmlns=http://purl.org/atom/ns#;
  titleGmail - Inbox for bartonphill...@gmail.com/title
  taglineNew messages in your Gmail Inbox/tagline
  fullcount4/fullcount
  link rel=alternate href=http://mail.google.com/mail; type=text/
  html /
  modified2009-06-07T22:20:48Z/modified
  entry
  titleTORNADO WARNING from 9News CustomCast/title
  summarySevere Weather Bulletin Click here to get additional current
  severe weather information This is .../summary
  link rel=alternate href=http://mail.google.com/mail?
  account_id=bartonphillips
  %40gmail.comamp;message_id=121bc3ef3abda1f1amp;view=convamp;extsrc=atom
  type=text/html /
  modified2009-06-07T19:43:10Z/modified
  issued2009-06-07T19:43:10Z/issued
  idtag:gmail.google.com,2004:1304851949303996913/id
  author
  name9News-CustomCast/name
  email9news-customc...@subs.myweather.net/email
  /author
  /entry
  .
  When I do this:
    var iframe = $(#frame)[0];
    var doc = iframe.contentDocument;
    if(!doc) doc = iframe.contentWindow.document;
    $(html, doc).load(atom.xml);

  The html head tag gets the titles rather than the
  feed version=0.3 xmlns=http://purl.org/atom/ns#; in the body?

  Is there a way to make the iframe look like an xml document instead of
  an html doc?


[jQuery] iframe and xml

2009-06-09 Thread barton

I have been trying to insert xml into an iframe. I can do it kinda.
The problem is the iframe has html/html tags and if the xml has
items that look like head tags like title etc they end up in the
head. For example I have a atom file that looks like this:

?xml version=1.0 encoding=UTF-8?
feed version=0.3 xmlns=http://purl.org/atom/ns#;
titleGmail - Inbox for bartonphill...@gmail.com/title
taglineNew messages in your Gmail Inbox/tagline
fullcount4/fullcount
link rel=alternate href=http://mail.google.com/mail; type=text/
html /
modified2009-06-07T22:20:48Z/modified
entry
titleTORNADO WARNING from 9News CustomCast/title
summarySevere Weather Bulletin Click here to get additional current
severe weather information This is .../summary
link rel=alternate href=http://mail.google.com/mail?
account_id=bartonphillips
%40gmail.comamp;message_id=121bc3ef3abda1f1amp;view=convamp;extsrc=atom
type=text/html /
modified2009-06-07T19:43:10Z/modified
issued2009-06-07T19:43:10Z/issued
idtag:gmail.google.com,2004:1304851949303996913/id
author
name9News-CustomCast/name
email9news-customc...@subs.myweather.net/email
/author
/entry
.
When I do this:
  var iframe = $(#frame)[0];
  var doc = iframe.contentDocument;
  if(!doc) doc = iframe.contentWindow.document;
  $(html, doc).load(atom.xml);

The html head tag gets the titles rather than the
feed version=0.3 xmlns=http://purl.org/atom/ns#; in the body?

Is there a way to make the iframe look like an xml document instead of
an html doc?


[jQuery] plug-in tablesorter bug/anomalies

2009-06-04 Thread barton

The tablesorter plug-in by  Christian Bach has what I think are a
couple of bugs/anomalies.
1) a column that starts with a zero is not identified as a 'digit'. I
think it should be.
2) a column that starts with an IP address that looks like 192.168.1.1
or 1.127.77.1 -- that is any IP with a single digit is not identified
as an IP address because the is function only looks for \d{2,3}
instead of \d{1,3}.
3) some of the examples in the source code are wrong.

Otherwise a great plug-in and worth the effort to debug.


[jQuery] Re: AJAX issue

2009-05-10 Thread barton

You might try this:
 $(data).find(item).each(function(i, item) {
   stuff = $item.find('[nodeName=content:encoded]')
...

Where 'data' is what comes back from the ajax call.

I couldn't find another way to get the data from a 'xx:yy' element. I
asked the question on the board here and this was the best answer I
got.

On May 9, 1:24 pm, Connor con...@letsbeglobal.com wrote:
 Hi,

 I've been experimenting with jQuery's AJAX capabilities. I was trying
 to create an effect that pulls data from an XML RSS feed and displays
 it. Long story short, I got everything to work, but I couldn't figure
 out how to pull data from a CDATA section like the following:

 item
 content:encoded![CDATA[p
 Some text
 /p
 ]]/content:encoded
 /item

 I wanted to put the Some Text in a variable. But I have no clue how.
 This is what my jquery looks like so far:

  $.ajax({
                  type: GET,
                  url: vid.xml,
                  dataType: xml,
                  success: function(xml) {

                      $(xml).find('item').each(function(){

                                                  var text = 
 $(this).children(content).text();

                      }); //close each(
                  }
              }); //close $.ajax(

 How would I go about targeting the p tag or the content inside?

 Thanks for any help,

 Connor


[jQuery] Re: $.get only reads a certain number of nodes from a local xml file before failing

2009-05-04 Thread barton

Check your xml very carefully, the load does not cope with or report
errors well. Try using $.ajax and add an 'error:' section. Then see if
you get an parser error, if so start removing nodes until the error
goes away, and then look very very carefully at the xml. I have had
this kind of problem many times. It would be nice if the parser could
give us some kind of better information as to where and what the error
was.

On May 3, 9:11 pm, nurikabe eaow...@gmail.com wrote:
 I'm having trouble reading a not-so-large local XML file.  The
 following code works fine for under 70 nodes:

     // load values from the xml file
     $.get('dic.xml', function(dicXml){
                   $('node', dicXml).each(function(){
                         var literal = $(this).find('literal').text();
                         // do something
                   });
     });

 But if I add more nodes to the xml file, it mysteriously fails.  (It
 won't read any nodes at all..)

 Is there some kind of size limit (memory, file, etc) when it comes to
 reading XML files with JQuery?  Or maybe there is a more preferred way
 to do this?

 BTW, my limited knowledge of JQuery and XML comes from this WebMonkey
 article:http://www.webmonkey.com/tutorial/Easy_XML_Consumption_using_jQuery?o...


[jQuery] Re: Is it possible to select on multiple attribute values?

2009-04-24 Thread barton

That is very interesting, can you explain it a bit. I can't find any
documentation on jQuery.expr[:] -- I can find it in the code but
don't really understand what/how it does/works. jQuery.expr[:] =
jQuery.expr.filters; but now I'm really lost.

On Apr 24, 6:13 pm, mkmanning michaell...@gmail.com wrote:
 You can always create your own selector:
 jQuery.extend(jQuery.expr[':'], {
     'values': function(a,i,m) {
                 return a.value  $.inArray(a.value,m[3].split(','))!=-1;
     }

 });

 Use like:
 $('input[name=fooA]:values(foo1,foo4)');

 On this markup it returns the first and last inputs:
 input type=text name=fooA value=foo1 /
 input type=text name=fooB value=foo2 /
 input type=text name=fooA value=foo3 /
 input type=text name=fooB value=foo4 /
 input type=text name=fooA value=foo4 /

 On Apr 24, 4:22 pm, machineghost machinegh...@gmail.com wrote:

  Hello,

  I already know that you can combine multiple attribute selectors, -
  style, by doing:
  $(*[name='someName'][value='someValue']);

  However, what I was wondering is, is there any way to combine multiple
  attribute selectors, ||-style, such that I could select:
  $(*[name='someName'][value='someValue']).add(*[name='someName']
  [value='someOtherValue']);
  with a single select?  I'm imagining a syntax of something like:
  $(*[name='someName'][value='someValue'||'someOtherValue']);
  (but, obviously, that syntax doesn't work).

  The repetition of [name='someName'] seems unnecessary to me, but I
  can't figure out any way to get around it without an or value= type
  selector.  Any help would be appreciated (even if it's just no you
  can't do that, go bug the developers ;-)).

  Jeremy


[jQuery] Re: AJAX xml problem

2009-04-23 Thread barton

Is there no way to escape the ':'?
Btw, I don't find it surprising that IE6 has a problem.

On Apr 21, 10:01 am, Michael Lawson mjlaw...@us.ibm.com wrote:
 If you put a : in a jQuery selector, jQuery thinks you are going to be
 declaring a filter.

 btw

 [nodeName=] may not owrk in ie6.  Might want to verify.

 Anyone from jQuery knows if any work is being done to fix xml namespaces?

 cheers

 Michael Lawson
 Content Tools Developer, Global Solutions, ibm.com
 Phone:  1-828-355-5544
 E-mail:  mjlaw...@us.ibm.com

 'Examine my teachings critically, as a gold assayer would test gold. If you
 find they make sense, conform to your experience, and don't harm yourself
 or others, only then should you accept them.'

   From:       barton bartonphill...@gmail.com                               
                                                    

   To:         jQuery (English) jquery-en@googlegroups.com                 
                                                    

   Date:       04/21/2009 11:59 AM                                             
                                                    

   Subject:    [jQuery] Re: AJAX xml problem                                   
                                                    

 Thanks that worked -- but why does $item.find(media:thumbnail) not
 work? I can get the other items with, for example, $item.find
 (description). I guess it is the ':' that makes the difference but
 why?

 Thanks again.

 On Apr 20, 1:42 pm, Michael Lawson mjlaw...@us.ibm.com wrote:



  try this

  $([nodeName=media:thumbnails]);

  cheers

  Michael Lawson
  Content Tools Developer, Global Solutions, ibm.com
  Phone:  1-828-355-5544
  E-mail:  mjlaw...@us.ibm.com

  'Examine my teachings critically, as a gold assayer would test gold. If
 you
  find they make sense, conform to your experience, and don't harm yourself
  or others, only then should you accept them.'

    From:       barton bartonphill...@gmail.com

    To:         jQuery (English) jquery-en@googlegroups.com

    Date:       04/20/2009 03:30 PM

    Subject:    [jQuery] Re: AJAX xml problem

  Is this one just too difficult to answer?

  On Apr 17, 1:08 pm, barton bartonphill...@gmail.com wrote: I have a

 rss feed and want to navigate to media:thumbnails url='  etc. I can't 
 figure out what to use for a selector as the
   media:thumbnails just doesn't work. I am doing a .find(). Any ideas.
   The feed

 ishttp://newsrss.bbc.co.uk/rss/newsonline_world_edition/front_page/rss.xml
 which I get via a php proxy



  athttp://www.bartonphillips.dyndns.org/test/test.php?xml=1

   Thanks

   graycol.gif
   1KViewDownload

   ecblank.gif
   1KViewDownload



  graycol.gif
  1KViewDownload

  ecblank.gif
  1KViewDownload


[jQuery] Re: Sort losing click association

2009-04-21 Thread barton

Did you look at the 'livequery' plugin?

On Apr 21, 8:21 am, Blaine bla...@worldweb.com wrote:
 Hi,

 I'm currently building a list when the document is ready, then
 performing a sort on the list if the user clicks sort Asc or sort
 Desc. However, when the list is sorted and redisplayed, I lose the
 original click event.

 How can I keep this event after sort?

 Below is example code:
 !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN
 html
 head
 titleUntitled Document/title
 meta http-equiv=Content-Type content=text/html;
 charset=iso-8859-1
 script type=text/javascript src=http://www.google.com/jsapi;/
 script

 script language=JavaScript type=text/javascript
         google.load(jquery, 1.2.6);
 /script

 script language=JavaScript type=text/javascript
 jQuery.fn.sort = function() {
         return this.pushStack( jQuery.makeArray( [].sort.apply( this,
 arguments ) ) );

 };

 $(document).ready( function(){

         for( var i = 1; 10  i; i++){
           var elm = $(li /);
           var a = $(a /).append( document.createTextNode( 'click:
 ' + i ) );
           $(a).click( function(){ alert('click:');   });
           $(a).addClass(boldface);
           $(elm).append(a);

                   $('#list').append( elm );
         }

 });

 function sortFunction(){
         var elms =[];
         if ( $('#sortDesc:checked').length  0 ){
                 elms = $('#list li').sort( function (a,b){
                         if ( $(a).text() == $(b).text() ){ return 0; }
                 return ($(a).text()  $(b).text() ) ? -1 : 1;
                 });
         }else{
                 elms = $('#list li').sort( function (a,b){
                         if ( $(a).text() == $(b).text() ){ return 0; }
                 return ($(a).text()  $(b).text() ) ? -1 : 1;
                 });
         }

         $('#list li').remove();
         $('#list').append( elms );

 }

 /script

 /head

 body

 TEST LIST P/
 input type=radio id=sortDesc name=sort value=desc
 onClick=sortFunction()Sort Desc
 input type=radio id=sortAsc name=sort value=asc
 checked=checked onClick=sortFunction()Sort Asc
 ol id=list
 /ol

 /body
 /html


[jQuery] Re: AJAX xml problem

2009-04-21 Thread barton

Thanks that worked -- but why does $item.find(media:thumbnail) not
work? I can get the other items with, for example, $item.find
(description). I guess it is the ':' that makes the difference but
why?

Thanks again.

On Apr 20, 1:42 pm, Michael Lawson mjlaw...@us.ibm.com wrote:
 try this

 $([nodeName=media:thumbnails]);

 cheers

 Michael Lawson
 Content Tools Developer, Global Solutions, ibm.com
 Phone:  1-828-355-5544
 E-mail:  mjlaw...@us.ibm.com

 'Examine my teachings critically, as a gold assayer would test gold. If you
 find they make sense, conform to your experience, and don't harm yourself
 or others, only then should you accept them.'

   From:       barton bartonphill...@gmail.com                               
                                                      

   To:         jQuery (English) jquery-en@googlegroups.com                 
                                                      

   Date:       04/20/2009 03:30 PM                                             
                                                      

   Subject:    [jQuery] Re: AJAX xml problem                                   
                                                      

 Is this one just too difficult to answer?

 On Apr 17, 1:08 pm, barton bartonphill...@gmail.com wrote: I have a rss 
 feed and want to navigate to media:thumbnails url='
  etc. I can't figure out what to use for a selector as the
  media:thumbnails just doesn't work. I am doing a .find(). Any ideas.
  The feed

 ishttp://newsrss.bbc.co.uk/rss/newsonline_world_edition/front_page/rss.xml 
 which I get via a php proxy

 athttp://www.bartonphillips.dyndns.org/test/test.php?xml=1



  Thanks



  graycol.gif
  1KViewDownload

  ecblank.gif
  1KViewDownload


[jQuery] Re: Drop Down Menu (sub-sections)

2009-04-21 Thread barton

Take a look at the 'plugins' and search for 'navigation drop down' I
think you will find something there that you can uses.

On Apr 21, 8:51 am, PF piercefree...@gmail.com wrote:
 Hi everyone:

 I am wondering if there is some way to create drop down navigation
 bars using jQuery.  For example, if the user rolls over a choice, the
 sub-choices pop up and when the mouse leaves the target area it will
 simply disappear.  I was thinking that some animation would be nice,
 but it isn't necessary.

 Thanks for any help.


[jQuery] Re: AJAX xml problem

2009-04-20 Thread barton

Is this one just too difficult to answer?

On Apr 17, 1:08 pm, barton bartonphill...@gmail.com wrote:
 I have a rss feed and want to navigate to media:thumbnails url='
 etc. I can't figure out what to use for a selector as the
 media:thumbnails just doesn't work. I am doing a .find(). Any ideas.
 The feed 
 ishttp://newsrss.bbc.co.uk/rss/newsonline_world_edition/front_page/rss.xml
 which I get via a php proxy 
 athttp://www.bartonphillips.dyndns.org/test/test.php?xml=1

 Thanks


[jQuery] AJAX xml problem

2009-04-17 Thread barton

I have a rss feed and want to navigate to media:thumbnails url='
etc. I can't figure out what to use for a selector as the
media:thumbnails just doesn't work. I am doing a .find(). Any ideas.
The feed is 
http://newsrss.bbc.co.uk/rss/newsonline_world_edition/front_page/rss.xml
which I get via a php proxy at 
http://www.bartonphillips.dyndns.org/test/test.php?xml=1

Thanks