[jQuery] return values

2009-10-22 Thread rob

I'm having some problem with return value for a function.  I have read
some postings about this, but I'm just not understanding something.
Hopefully somebody can help me with this

I'm trying to access google blogger's API to display blog entries on
my site.  I'm doing this through JQuery and requesting a JSON
response.  Everything seems to work ok, but I want to access the link
for the blog entry.  This is a subset of the "entry" object.  It's
structured like this:

entry:
 title,
 content,
 link:
  rel,
  type,
  href,

  rel,
  type,
  href,


I want to get the link where the "link.rel == "self".  To do this I
have to loop through the link object (5 times).  The loop and
conditional statement works correctly, but I can't get the variable
inside this loop back to my original function.

I have this code:

$.each(data.feed.entry, function(i, entry){

 $.each(entry.link, function(j, link){
  if(link.rel == "self"){
   var postlink = link.href;
   alert("link : " + postlink);
   return postlink;
   }
 });

 alert(postlink);

});

Thanks for your help in advance.


[jQuery] Re: slow performance on this site - any suggestions?

2009-10-22 Thread FranktheTank

Thanks for writing, Dave.  I appreciate it.

Yes, the accordion animation makes 2 panels move a once - one closes,
the other opens.  I never did figure out how to make them synch
better, but the client seems OK with the amount of jitter.  Many
accordion plugins have the same problem.  Any thoughts on how to make
it run better?  I was thinking of changing the accordion animation to
set up a negative margin instead of dropping the width of the panels.
Might that help... something?

One thing I noticed was really odd- FireFox usually runs JavaScript
very quickly and smoothly, but on my fast PC, IE7 runs the animations
much faster/smoother.  Chrome seems to run them the best, but I would
never have guessed that they would run like such a dog.

To make things go even smoother (or so I thought), the slideshow on
the "home" panel pauses when you navigate to another tab.  I figured
that switching invisible images in the background was a total waste of
processing power, so it pauses when you leave the panel and starts up
where you left off when you come back.

Could this just be a problem with all the large images in memory or
something?  I suppose I could set the src of any invisible images to
NULL until they are needed...

So, any more thoughts?  Otherwise I'll just have to tear it down one
script component at a time until it runs smooth again, and then I'll
have my culprit.

Thanks again (to everyone) - I really appreciate the help.

Frank


On Oct 22, 11:30 pm, Dave Methvin  wrote:
> > I built a site for a client and somewhere along the line, I added some
> > code that slowed down the jQuery performance.  I thought it was my
> > crusty old laptop, but my brand new quad core PC also shows the
> > animations quite slowly and choppily.  Thus, the problem is with my
> > code.
>
> The Firebug profiler might help, I ran it on the page but it's hard to
> tell what's being called because it's using the minified version of
> jQuery.
>
> It looks like you are doing two animations simultaneously in the
> accordion:
>
> $('.panel.active').animate( { width:"0"}, { queue:false, duration:752,
> easing:'linear' });
> //$('.panel.active').hide(500);
> $('.panel.active').removeClass('active');
> $('.panel[rel=' + rel +']').addClass('active');
> $('.panel.active').animate( { width:"860px" }, { queue:false, duration:
> 750, easing:'linear' });
>
> Did you want to do that?


[jQuery] toggleClass with Duration

2009-10-22 Thread TH Lim

Hi,

I used toggleClass method to toggle the colors of my message when the
user clicks a button. toggleClass() worked well if I didn't specify
any duration i.e. instanteous switch from white background to red
background. The problem arises when I added a duration of ,say, 2s. If
the user clicked the button before the message has reached the final
state (say the user clicked the button 1s after the 1st click),
clicking the button will not revert the message to its original state
i.e. white background. How do I fix this?

Also, the reason as why I use _class_ is I want to define the UI
properties in CSS instead of in JS as keys/values.

Thanks


  $("#clickMe").click(function() {
$("#console").toggleClass('red', 2000);
return false;
});
 


.red {background-color:red;}



Empty
Click Me



[jQuery] Re: load(file) then bind(...) ?

2009-10-22 Thread Dave Methvin

> In other words, i have a main page with a menu that loads external
> files in the #content div with the load(file) function. The external
> file contains a DIV, and i want to bind a function to it $
> ("#mynewdivfromexternalfile").click(function() {alert ('it worx!'} );

You can use a callback in the load to bind it right after it loads the
ajaxed content, or use .live() to bind the event at page load time if
you know the id then.


[jQuery] Update element when changes

2009-10-22 Thread ReynierPM


Hi every:
I have two input fields and I want the second updated every time I 
change a value in the first. I wrote this function but it doesn't work 
until the first element lost focus (for example I clic anywhere or press 
TAB button)


$('#order').change(function(){
$('#total_buyed').val($(this).val() * 2.75);
});

What I'm doing wrong
--
Saludos
ReynierPM


[jQuery] Re: slow performance on this site - any suggestions?

2009-10-22 Thread Dave Methvin

> I built a site for a client and somewhere along the line, I added some
> code that slowed down the jQuery performance.  I thought it was my
> crusty old laptop, but my brand new quad core PC also shows the
> animations quite slowly and choppily.  Thus, the problem is with my
> code.

The Firebug profiler might help, I ran it on the page but it's hard to
tell what's being called because it's using the minified version of
jQuery.

It looks like you are doing two animations simultaneously in the
accordion:

$('.panel.active').animate( { width:"0"}, { queue:false, duration:752,
easing:'linear' });
//$('.panel.active').hide(500);
$('.panel.active').removeClass('active');
$('.panel[rel=' + rel +']').addClass('active');
$('.panel.active').animate( { width:"860px" }, { queue:false, duration:
750, easing:'linear' });

Did you want to do that?


[jQuery] history plugin in IE6 calls two links on using backbutton

2009-10-22 Thread Greg

I don't know if this is an error in the plugin or in my
implementation. (This plugin could use documentation on how it
functions)
Using plugin:  http://plugins.jquery.com/project/issues/history

I have a program that creates a form divided into various pages.  Each
page is denoted with a specific hash, except for the first, which has
no hash.  I have set it up to move from page to page using either the
"back" or "continue" buttons on the pages, or using the forward and
back buttons of the browser.  The "pages" will display one at a time,
without loading a new html page.  This is all working perfectly in
FF2, but I'm having problems in IE6.  I haven't bothered testing
beyond these two browsers yet.

When I go from page to page, my back history will be, for example
(most recent page on right):

"product"->"terms"->"shipping"->"billing"

and the currently displayed page is "payment".  If I use the browser
back button to go back to "shipping", the back history should now be:

"product"->"terms"

which it is in FF2, but in IE6, the page displayed is "shipping", but
the back history is:

"product"->"terms"->"shipping"->"payment"

I don't know if this helps in debugging, but in the backbutton history
list, the last two items that should not be there. Instead of showing
the name of the html page, like the other history items, they show the
value of the title tag.

Here is the code that implements the hash history (two functions):

function buildHashManager() {
var hashVisit = {}, currentHash = "", nextHash="", currentPage,
nextPage;
for (var i in formthis.order) {
hashVisit[i] = false;
}
jQuery.history.init(pageLoad);
function pageLoad(hash) {
if (!hash || hashVisit[hash]) {
currentHash?currentPage = currentHash:currentPage =
formthis.order[0];
jQuery(formTag + " #" + currentPage).css
("display","none");
nextHash = hash;
nextHash?nextPage = nextHash:nextPage = formthis.order[0];
jQuery(formTag + " #" + nextPage).css("display","block");
if (formthis.status.use) {
formthis.status.update(formthis.order, nextPage);
}
currentHash = hash;
} else {
window.history.back();
}
};
return {
add : function (idval) {
if (idval!==formthis.order[0]) {
hashVisit[idval] = true;
}
},
remove : function (idval) {
if (idval!==formthis.order[0]) {
hashVisit[idval] = false;
}
}
}
}

next_button_event : function (formthis, formIdName, pageID,
nextPageID, nextBtnID, statusBar, copyField) {
jQuery(formIdName + " #" + pageID + " #" + nextBtnID).parents
("a").attr("href","#"+nextPageID).click(function (event) {
var errMessage;
if (pluggedIn.validate) {
errMessage = Validate.execute(formthis, formIdName, jQuery
(this).parents("form"));
};
var pageComp = formIdName + " #" + pageID;
if (copyField==pageComp && nextBtnID=="nextBtn" && !
copyToggleOff[formIdName]) {
if (pageID == "shipping") {
Events.copyaddress(formIdName, formIdName + "
#billing");
} else if (pageID == "billing") {
Events.copyaddress(formIdName, formIdName + "
#shipping");
}
};
if (!errMessage) {
formthis.hashManager.add(nextPageID);
var hash = this.href;
hash = hash.replace(/^.*#/, '');
jQuery.history.load(hash);
}
event.preventDefault();
});
},


[jQuery] Drag 'n Drop plus hover on drag?

2009-10-22 Thread jchambers

I have a simple drag and drop completed and works well.

Next I would like be able to trigger a hover event when dragging over
items I have already dropped into the drop area. So far I can only get
the hover to work onmouseover, not while dragging an item.

Here is what I am trying:

$('#dropArea').children('div').each(function() {
$(this).bind('mouseenter mouseleave', function(e){
$(this).toggleClass('placement');
});
}

It seems as though when dragging an item it blocks other event calls?
Dose this have to do with bubbling?

Any help is appreciated.
Jon


[jQuery] cluetip memory leak

2009-10-22 Thread Andrew Tan

Hi,

I have been tracking down a memory leak in my web app which
dynamically removes and adds anchors which have cluetip tooltips
attached and I think that I may have narrowed down the problem to the
main closure in cluetip which attaches the cluetip to the node (line
32: var link = this, $this = $(this);).

I have been running the following script in SIEV with a modified
version of jquery 1.3.2 with the following fix which allows the
cluetip elements to be removed. However, the anchor nodes become
orphaned as there is still 1 reference to them after the cluetip nodes
are removed?

If I change line 32 of the cluetip source to the following for testing
purposes:
var link = $('br'), $this = $('br');

The anchors are freed but the 'br' nodes start building up.

Therefore, I was wondering if anyone knows how I can work around this
problem? or if I am simply not releasing the resources correctly?

Attached Scripts and Source:

jQuery modification. After line 1247 insert the following before the
closing curly brace (http://markmail.org/message/
cfi4bvfjc3m6ww6k#query:jquery%20memory%20leak%20in%20remove%20and
%20empty+page:1+mid:tapc7zt3cwl6rw4f+state:results):
this.outerHTML = "";

Example Script:








$(document).ready(function() {
setInterval(resetCluetip, 1000);
});

function resetCluetip() {
$('a').each(function() {
$(this).cluetip('destroy');
$(this).unbind().remove();
});

$('#cluetip*').unbind().empty();

$('body').html('anchor one
'); $('a').each(function() { $(this).cluetip({splitTitle: '|'}); }); }

[jQuery] load(file) then bind(...) ?

2009-10-22 Thread ABB

Hi,

I'm building an application in which pages are loaded dynamically with
JQuery's load(file) function.

When i call the load(file) function from that main page, new elements
with new IDs are dynamically loaded in the main page. these DIVs are
new and no actions are bound on them since the $(document).ready
(function(){...}); has already triggered.

I am not able to bind anything on a DIV that is coming from an
external file loaded with JQuery's load(file) function.


In other words, i have a main page with a menu that loads external
files in the #content div with the load(file) function. The external
file contains a DIV, and i want to bind a function to it $
("#mynewdivfromexternalfile").click(function() {alert ('it worx!'} );

Any ideas why it is not working?

Thanks


[jQuery] Re: Click multiple times, different states, saves different data to DB (confusing?)

2009-10-22 Thread The Danny Bos


Thanks man,
I'll give it a whirl ... Thanks for all your time and energy.

d



On Oct 23, 4:19 am, mkmanning  wrote:
> Something like this (untested):
>
> var arrValues = ['c1','c2','c3','c3'],
> cnameIndex = $.inArray(this.className,arrValues)+1;
> this.className = cnameIndex===arrValues.length?0: cnameIndex ];
>
> if you can live with only one classname, otherwise you'll have to add
> code to remove the old classname from arrValues and then add the new
> class with addClass.
>
> Basically all this is doing is getting the current value of a given
> property, such as background-color, finding its index in the arrValues
> array, incrementing that by one and then setting the new value to the
> element in the array with the incremented index. If the index is at
> the end of the array, it resets to 0.
>
> On Oct 22, 4:39 am, The Danny Bos  wrote:
>
>
>
> > Thanks so much man,
> > That'll work well ... One more thing, how would I change it to point
> > to classes instead of direct colours?
>
> > var arrValues = ['c1','c2','c3','c3'],
>
> > Thanks again,
>
> > On Oct 22, 6:27 pm, mkmanning  wrote:
>
> > > Yeah, the snippet I wrote updates the color; you can add an ajax call
> > > to update your db as well, if the value your updating in the db is the
> > > color, or else the value is in an array that's indexed the same.
>
> > > On Oct 22, 12:10 am, The Danny Bos  wrote:
>
> > > > For each click of the DIV I'm hoping to change the BackgroundColor,
> > > > make some updates in the Database (depending on which array selection
> > > > it's on) and that's about it.
>
> > > > So, the first click of the DIV = "Change BG to 'green', update DB
> > > > field to 'XXX'"
> > > > the second click of the DIV = "Change the BG to 'aqua', update DB
> > > > field to 'YYY'"
> > > > the third click ... etc
>
> > > > Know what I mean?
>
> > > > On Oct 22, 6:04 pm, mkmanning  wrote:
>
> > > > > Well, if you just want to loop through the array to change the
> > > > > background color, you don't really need toggle then. Try this:
>
> > > > >  $("#item_list > li > div > a").click(function(){
> > > > >   var arrValues = ['rgb(9, 128, 0)','rgb(0, 255, 255)','rgb(0, 0,
> > > > > 255)','rgb(128, 0, 128)'],
> > > > >   bgcolor = $.inArray($(this).css('background-color'),arrValues)+1;
> > > > >   $(this).css('background-color',arrValues[bgcolor===arrValues.length?
> > > > > 0:bgcolor]);
>
> > > > > });
>
> > > > > disclaimer: just wrote it inside Firebug's console, so haven't tested
> > > > > it outside that...
>
> > > > > On Oct 21, 10:14 pm, The Danny Bos  wrote:
>
> > > > > > Thanks, had a good read, figured it out in part.
> > > > > > Now I'm stuck trying to introduce an array to do my bidding ...
> > > > > > Example below.
>
> > > > > > The array is an example of how I want to loop through to use those
> > > > > > values.
> > > > > > Underneath is the perfect code for clicking an Anchor and changing 
> > > > > > its
> > > > > > BGcolour differently each time.
>
> > > > > > Any ideas?
>
> > > > > > $(document).ready(
> > > > > >         function(){
> > > > > >                 var arrValues = ['green','aqua','blue','purple'];
>
> > > > > >                 $("#item_list > li > div > a").toggle(
> > > > > >                 function(){
> > > > > >                         $(this).css('background-color', 'green');
> > > > > >                 }, function() {
> > > > > >                         $(this).css('background-color', 'aqua');
> > > > > >                 }, function() {
> > > > > >                         $(this).css('background-color', 'blue');
> > > > > >                 }, function() {
> > > > > >                         $(this).css('background-color', 'purple');
> > > > > >                 });
>
> > > > > > });
>
> > > > > > On Oct 22, 3:46 am, mkmanning  wrote:
>
> > > > > > > .toggle() allows you to rotate through multiple functions, you 
> > > > > > > might
> > > > > > > want to check it out in the 
> > > > > > > docs:http://docs.jquery.com/Events/toggle#fnfn2fn3.2Cfn4.2C...
>
> > > > > > > On Oct 21, 2:58 am, The Danny Bos  wrote:
>
> > > > > > > > I've got one for ya, JQuery and Ajax.
>
> > > > > > > > I want to have a button image, let's stay it's inactive state 
> > > > > > > > it's a
> > > > > > > > grey circle, when someone clicks it once, it'd change to a blue 
> > > > > > > > circle
> > > > > > > > (update associated DB field to "blue"), click it again and it 
> > > > > > > > becomes
> > > > > > > > a red circle (update the DB field to "red") and so on. So users 
> > > > > > > > keep
> > > > > > > > clicking until they get the right color, then move on to the 
> > > > > > > > next
> > > > > > > > one.
>
> > > > > > > > I've seen something similar in Google where you can star emails 
> > > > > > > > with
> > > > > > > > different stars.
>
> > > > > > > > Any idea how you'd do this?
> > > > > > > > It's got me stumped.


[jQuery] jquery.com plugin directory

2009-10-22 Thread JMan

Is it just me or does anyone else have the hardest time finding
plugins on the jquery.com site?

jquery is an awesome library and I do not plan on using anything else
anytime soon but the manner in which they catalog plugins on the site
is terrible. I know these guys are capable of much better.

Ok so you can choose a plugin category but then everything just runs
together on that page. The content displayed for each plugin varies
wildly depending on how generous the plugin developer was when they
added their contribution.

The plugin search seems to search through all the pages and their
content and the results you get back are pretty vague at times and in
many cases you get back duplicates. For example if you search for menu
you may get back a bunch of links to pages that have the word menu in
them but the page may not be a menu plugin.

The Taxonomy is not too bad but I think they should categorize and sub
categorize the plugins a little better.

A great example of what is needed in the extensions directory at
Joomla.com. Even if you just list the plugins more like a product
catalog with a link to the main plugin page stuff would be allot
easier on the eyes.

I know the jquery community has alot of great code to offer but
discovering it in the plugins section of jquery.com is quite painful.
I am not trying to upset anyone here but jquery and it's plugin
directory has outgrown the Drupal/CCK limitations.



[jQuery] Events Calendar

2009-10-22 Thread Andri

Hi, I needed events calendar for my site. This calendar should :
1. highlight date that had events
2. If i click it, it'll go to events page or show alert about what
events that occur that date.


I try to use datepicker to do this. For #2 i can do it using onSelect
(dateText). But i can't figure out how to highlight date (default is
highlighting current date), and its better if the highlight can use
another style than ui-state-highlight, so there will be
differentiation between current date and events date.

Anybody can help me?


[jQuery] [autocomplete] Using a \n (new line) as the multipleSeparator in Internet Explorer does not work

2009-10-22 Thread Gabe

I've been getting some buggy behavior with IE7 when using a new line
character as the multipleSeparator.  Here is my sample code:


$('#search_movies').autocomplete(
'ajax_movie_autocomplete', {
mustMatch: true,
multiple: true,
multipleSeparator: "\n"
});

Firefox and Safari work great.  In IE, the first entry works fine, but
the cursor stays on the same line.  When you hit a character for your
second entry, the cursor drops down a line and starts displaying the
auto-complete options for your new text appropriately.  However, if
you hit "enter", it fails to autocomplete at all and just drops down
to a new line.  If you instead select the option with your mouse
instead of hitting "enter", it changes the first line instead of the
line you're actually on.

I receive the same behavior if I set multipleSeparator: "\r\n" .

Also, "\r\n" is completely broken Firefox and Safari.  The first entry
works fine, but the second entry completely wipes out everything typed
into the textarea so far.  If anyone has a solution for IE, I'd love
it worked on the "\n" form, as I'd rather not browser sniff to
determine the separator.


[jQuery] Re: find the row nuber clicked of the item list

2009-10-22 Thread MorningZ

Check out ".index()":

http://docs.jquery.com/Core/index

the example is just like what you want, except they are 's

On Oct 22, 4:21 pm, frank  wrote:
> Hello I'm just a starter and I'm looking for a function I can't find.
>
> What I want:
> I want the row number of the row i clicked of the item list.
>
> For instance I click on third row then I want that var i returns 2.
>
> My code:
>
> 
>   
>     
>     
>         $(document).ready(function(){
>             $("ls").click(function () {
>                var i = $( what must i type to get the clicked row
> number here??);
>                console.log(i);
>             });
>         });
>     
> 
>     
>       
>           First 
>           Second 
>           Third 
>           Forth 
>       
>     
> 
>
> Best Regards
> Frank Pauw


[jQuery] ClueTip focus/blur trouble

2009-10-22 Thread Shawn


Hi Gang.

I'm working with ClueTip and have run into some oddities.

In particular, I want to show ClueTip when a textbox receives focus. 
The source shows me that I can use activation:'focus' for this and that 
will result in the cluetip showing on focus and disappearing on blur. 
Showing the cluetip is working fine, blurring is not.


The code I have is this:

$this.cluetip({
activation: 'focus',
local: true,
showTitle: false,
sticky: true,
mouseOutClose: true,
arrows: true,
closeText: "X",
closePosition: "title"
}).focus( function (){ 
$(opts.source).children().removeClass(opts.hover); });


The .focus() method that I have here is simply resetting the classes on 
the items the user may interact with.


I'm using ClueTip to provide a rapid selection tool - similar to a drop 
down list, but without the drop down list UI.  (large number of options, 
needing HTML for formatting, etc.)  The idea is that when the cursor 
arrives at the textbox, the cluetip shows and the user can use either 
the mouse to click an item, or the up/down keys and enter to do the 
same.  Where I am running into problems is with the click selection.  If 
I add a blur handler to the above code:


.blur( function () { $(document).trigger('hideCluetip'); })

then things work well for keyboard selection and blurring, but if I 
click instead, the click event never happens.  Because, clicking on the 
cluetip triggers the blur of the textbox which closes the cluetip before 
the click can be handled.  I suspect this may be partly why the onblur 
isn't working within ClueTip as well - the logistics seem rather complex...


So I'm looking for suggestions on how to get this running properly.  OR 
for a plugin that provides similar functionality already.  Thanks for 
any feedback.


Shawn


[jQuery] Re: Find the first element outside (this)

2009-10-22 Thread MorningZ

hmmm... may not be the best way, but it will for sure work with that
HTML

$("input").focus(function(){
  $(this).parent().parent().find("td:last span").show();
 });


this may work as well, but i admittedly don't use ".next()" ever

$(this).parent().next().find("span").show();



On Oct 22, 5:10 pm, Doro  wrote:
> Hello, i am having problems with finding the next element after (this)
>
> here is the html
>
> 
>    Name
>    
>    the help
> 
> 
>    Uname
>    
>    the help
> 
>
> i am trying to display the span element when i click the input.. here
> is what i got so far:
>
> $("input").focus(function(){
>                        $(". info:next span").show();
>  });
>
> this displays all span's. if i change the span to "span:next" it only
> displays the first span.
>
> anyone can help me with this?


[jQuery] Find the first element outside (this)

2009-10-22 Thread Doro

Hello, i am having problems with finding the next element after (this)

here is the html


   Name
   
   the help


   Uname
   
   the help


i am trying to display the span element when i click the input.. here
is what i got so far:

$("input").focus(function(){
   $(". info:next span").show();
 });

this displays all span's. if i change the span to "span:next" it only
displays the first span.

anyone can help me with this?


[jQuery] Using XML to store a large amount of data...

2009-10-22 Thread Gavin

I might be considering XML for a job that would be better accomplished
with a database, but I'd like to make sure.

What I'm trying to do is use jQuery to call specific items from the
XML - so if the XML is composed of hundreds of  items, I want
to call just one, with a  tag inside whose value matches the
'query'. I hope that makes sense. I don't want to just call all 
items, but rather one of the hundreds of  items at a time.

Let me know if that's nonsense or otherwise!

Thanks in advance for any assistance.

Gavin


[jQuery] Re: IE7 not loading jquery in WP

2009-10-22 Thread mslade

mojoeJohn,

You have an extra trailing comma in "speed: 4000,", which is
definitely going to give you trouble in IE.  IE is less forgiving of
JS syntax errors than, for example, FF.

You might find this useful:  http://www.jslint.com/

Hope that helps.

Mark


IE is (rightfully) less forgiving of syntax errors in JS.

On Oct 22, 3:57 pm, mojoeJohn  wrote:
> jquery isn't loading right in IE 6 & 7 onhttp://centermassshootingschool.com/
>
> you can look at the source code, but essentially this is where the
> problem is ...
>
> 
>   $(document).ready(function(){
>     $("#tabs").tabs({fx:{opacity:'toggle'}});
>         $('.slideshow').cycle({
>                 fx:'fade',
>                 speed: 4000,
>         });
>   });
> 
>
> when you take away
>
> $('.slideshow').cycle({
>                 fx:'fade',
>                 speed: 4000,
>         });
>
> then everything works fine.
>
> It works fine in all other browsers. How do i fix this?


[jQuery] find the row nuber clicked of the item list

2009-10-22 Thread frank

Hello I'm just a starter and I'm looking for a function I can't find.

What I want:
I want the row number of the row i clicked of the item list.

For instance I click on third row then I want that var i returns 2.

My code:


  


$(document).ready(function(){
$("ls").click(function () {
   var i = $( what must i type to get the clicked row
number here??);
   console.log(i);
});
});



  
  First 
  Second 
  Third 
  Forth 
  




Best Regards
Frank Pauw


[jQuery] Help: Serialize html form into JSON

2009-10-22 Thread Ray Daly

Need help. Stumped.

I'm using jQuery and Ajax/serializeArray to read a form to get JSON
object.
However, it is in a format of:
{"name": "firstname", "value": "Mary"}
while I'd like to see it as
{"firstname": "Mary"}
to put it into couchdb and another application.

Of course I have to use json2.jx from json.org to convert from object
to
string.

Thanks for any help you can provide.


[jQuery] Synthax problem

2009-10-22 Thread fabbx

Hi everyone

I have a problem with the use of an ajax call in a function. I want to
get the result of the ajax call for processing to the return of the
function.

I've tried something like that

function checkUsername(s)
{
TO_RETURN = $.ajax({
type: "POST",
url: 'http://'+ CURRENT_DOMAIN + '/ajax/checkUsernameExists/
username/'+s,
async: false,
success: function(msg){
if(msg=='true'){
return true;
} else {
return false;
}
}
});


if(TO_RETURN) return true;
else return false;
}

But it didn't work ...

If anyone could help me :)

PS : I'm a novice in jQuery and i have low skills in javascripts


[jQuery] Secure login

2009-10-22 Thread Kovács Gábor
Hi all,

I would like to implement a login functionality to my website. I've written
a login form like this:
http://web-kreation.com/demos/Sliding_login_panel_jquery.

The problem is: how can I send the username and password to the server in a
securely way? I mean, if the server sends the whole page in HTTP then the
user wants to log in, he would not be able to send it in HTTPS, unless the
server sends the login page to the user in HTTPS. But I would like this
thing to happen with no full page refresh. Is there any way I could do it?
Thanks in advance.

Gábor

//sorry for my english


[jQuery] clockpicker plugin doesn't show

2009-10-22 Thread -null-

I've inherited some code that uses the clock picker plugin however it
doesn't seem to work in IE 8 and Firefox 3.5.  This is the code for
the picker.

$('')
.attr('alt', 'clockpicker')
.attr('src', '/community/tournamentsystem/images/clock.png')
.attr('class', 'ui-datepicker-trigger')
.attr('id', 'start_date_clockpicker')
.insertAfter('#id_start_date_1')

$('#start_date_clockpicker').clockpick({
valuefield: 'start_date_1',
military: true,
starthour: 0,
endhour: 23})

I have downloaded the latest version of the clockpicker but it still
doesn't work in these browsers.


[jQuery] IE7 not loading jquery in WP

2009-10-22 Thread mojoeJohn

jquery isn't loading right in IE 6 & 7 on http://centermassshootingschool.com/

you can look at the source code, but essentially this is where the
problem is ...



  $(document).ready(function(){
$("#tabs").tabs({fx:{opacity:'toggle'}});
$('.slideshow').cycle({
fx:'fade',
speed: 4000,
});
  });



when you take away

$('.slideshow').cycle({
fx:'fade',
speed: 4000,
});


then everything works fine.


It works fine in all other browsers. How do i fix this?


[jQuery] Re: Social media plugin

2009-10-22 Thread Ricardo

Thanks man!

On 22 out, 08:33, Jon Banner  wrote:
> yes.
>
> http://github.com/kswedberg/jquery-socialize
>
> 2009/10/22 Ricardo 
>
>
>
> > I've visited this site(http://www.intomobile.com/2009/10/09/hands-on-
> > the-nokia-n900-at-ctia-fall-2009.html)
> > and there is an interesting
> > feature to spread the link in social sites like facebook, twitter and
> > others (just point your mouse to the article image). I've found that
> > the effect is provided by the Meebo site. Is there any jquery plugin
> > that do something similar to the linked site above?
> > Thanks in advance.


[jQuery] Re: Get file specific parts from input file type

2009-10-22 Thread Sam Doyle
jquery ajax and php

On Thu, Oct 22, 2009 at 8:47 PM, Buntu J  wrote:

> Hi,
> I need to get the filename, basename, dirname using jQuery. Can anyone
> please let me know if there is any utility that will take care of
> windows/mac/linux file paths.
>
> Thanks
>


[jQuery] Get file specific parts from input file type

2009-10-22 Thread Buntu J
Hi,
I need to get the filename, basename, dirname using jQuery. Can anyone
please let me know if there is any utility that will take care of
windows/mac/linux file paths.

Thanks


[jQuery] Re: images show before jquery and cycle plugin work their magic

2009-10-22 Thread Sam

Charlie,

Thanks for the reply, unfortunately the changes you suggested do not
seem to make a difference. Please refer to my previous link to see the
same issue happening with the changes applied.


On Oct 22, 7:21 am, Charlie  wrote:
> try giving the carousel UL a huge width , say 10,000 px, and carousel wrapper 
> set height, width and overflow : hidden
> this is done by the script also but until script fully fires your css should 
> make up for it
> Sam wrote:I'm not entirely sure that some of these fixes apply to my 
> situation as I'm not using cycle plugin. I am having the same issue as the 
> original poster however, please see for 
> yourself.http://samgabellshoots.com/Any pointers on how to fix or at least 
> 'hide' the issue until after load would be greatly appreciated :) On Oct 21, 
> 4:40 pm, Mike Alsupwrote:I've had this issue before. As 
> Karl suggests, I was able to fix it by giving the parent element (the one 
> calling the cycle plugin) a fixed height (the height of the images you're 
> cycling) and an overflow of hidden in the CSS. If the slides are of different 
> heights, set the height to the height of the first slide.Another approach is 
> to have a CSS rule that hides all but the first slide.


[jQuery] Accessing jCarousel outside of the callback...

2009-10-22 Thread Karega

Is there anyway that I can access the specific carousels of an element
outside the callback function?  i.e. jQuery("#id").jcarousel.scroll(3);


[jQuery] Multi event one action

2009-10-22 Thread HS8KIC





What I want is 

$('select').change and?? $('input').blur do the
same action with write function only once.

Thank you.
Paisal.




[jQuery] Re: Click multiple times, different states, saves different data to DB (confusing?)

2009-10-22 Thread mkmanning

Something like this (untested):

var arrValues = ['c1','c2','c3','c3'],
cnameIndex = $.inArray(this.className,arrValues)+1;
this.className = cnameIndex===arrValues.length?0: cnameIndex ];

if you can live with only one classname, otherwise you'll have to add
code to remove the old classname from arrValues and then add the new
class with addClass.

Basically all this is doing is getting the current value of a given
property, such as background-color, finding its index in the arrValues
array, incrementing that by one and then setting the new value to the
element in the array with the incremented index. If the index is at
the end of the array, it resets to 0.

On Oct 22, 4:39 am, The Danny Bos  wrote:
> Thanks so much man,
> That'll work well ... One more thing, how would I change it to point
> to classes instead of direct colours?
>
> var arrValues = ['c1','c2','c3','c3'],
>
> Thanks again,
>
> On Oct 22, 6:27 pm, mkmanning  wrote:
>
>
>
> > Yeah, the snippet I wrote updates the color; you can add an ajax call
> > to update your db as well, if the value your updating in the db is the
> > color, or else the value is in an array that's indexed the same.
>
> > On Oct 22, 12:10 am, The Danny Bos  wrote:
>
> > > For each click of the DIV I'm hoping to change the BackgroundColor,
> > > make some updates in the Database (depending on which array selection
> > > it's on) and that's about it.
>
> > > So, the first click of the DIV = "Change BG to 'green', update DB
> > > field to 'XXX'"
> > > the second click of the DIV = "Change the BG to 'aqua', update DB
> > > field to 'YYY'"
> > > the third click ... etc
>
> > > Know what I mean?
>
> > > On Oct 22, 6:04 pm, mkmanning  wrote:
>
> > > > Well, if you just want to loop through the array to change the
> > > > background color, you don't really need toggle then. Try this:
>
> > > >  $("#item_list > li > div > a").click(function(){
> > > >   var arrValues = ['rgb(9, 128, 0)','rgb(0, 255, 255)','rgb(0, 0,
> > > > 255)','rgb(128, 0, 128)'],
> > > >   bgcolor = $.inArray($(this).css('background-color'),arrValues)+1;
> > > >   $(this).css('background-color',arrValues[bgcolor===arrValues.length?
> > > > 0:bgcolor]);
>
> > > > });
>
> > > > disclaimer: just wrote it inside Firebug's console, so haven't tested
> > > > it outside that...
>
> > > > On Oct 21, 10:14 pm, The Danny Bos  wrote:
>
> > > > > Thanks, had a good read, figured it out in part.
> > > > > Now I'm stuck trying to introduce an array to do my bidding ...
> > > > > Example below.
>
> > > > > The array is an example of how I want to loop through to use those
> > > > > values.
> > > > > Underneath is the perfect code for clicking an Anchor and changing its
> > > > > BGcolour differently each time.
>
> > > > > Any ideas?
>
> > > > > $(document).ready(
> > > > >         function(){
> > > > >                 var arrValues = ['green','aqua','blue','purple'];
>
> > > > >                 $("#item_list > li > div > a").toggle(
> > > > >                 function(){
> > > > >                         $(this).css('background-color', 'green');
> > > > >                 }, function() {
> > > > >                         $(this).css('background-color', 'aqua');
> > > > >                 }, function() {
> > > > >                         $(this).css('background-color', 'blue');
> > > > >                 }, function() {
> > > > >                         $(this).css('background-color', 'purple');
> > > > >                 });
>
> > > > > });
>
> > > > > On Oct 22, 3:46 am, mkmanning  wrote:
>
> > > > > > .toggle() allows you to rotate through multiple functions, you might
> > > > > > want to check it out in the 
> > > > > > docs:http://docs.jquery.com/Events/toggle#fnfn2fn3.2Cfn4.2C...
>
> > > > > > On Oct 21, 2:58 am, The Danny Bos  wrote:
>
> > > > > > > I've got one for ya, JQuery and Ajax.
>
> > > > > > > I want to have a button image, let's stay it's inactive state 
> > > > > > > it's a
> > > > > > > grey circle, when someone clicks it once, it'd change to a blue 
> > > > > > > circle
> > > > > > > (update associated DB field to "blue"), click it again and it 
> > > > > > > becomes
> > > > > > > a red circle (update the DB field to "red") and so on. So users 
> > > > > > > keep
> > > > > > > clicking until they get the right color, then move on to the next
> > > > > > > one.
>
> > > > > > > I've seen something similar in Google where you can star emails 
> > > > > > > with
> > > > > > > different stars.
>
> > > > > > > Any idea how you'd do this?
> > > > > > > It's got me stumped.


[jQuery] Re: html select to get value from mysql on change

2009-10-22 Thread rftemp

thanks i'll give it a try


[jQuery] Re: validation plugin addMethod does not work for me.

2009-10-22 Thread JMan

Thanks Leonardo...

I figured it out after digging through several examples. The
documentation for this plugin has a huge gap in it. It shows an
example of how to define a custom validator but no where does it
explain how to use it. The trick being as you mentioned, defining it
in the Rules or you can put the name of your custom validator in the
class attribute of the field it applies to.

The sad part is after hours of struggling with this it does not work
as I had hoped it would. I am prompting the user for input and based
on their response I would like to either cancel the form submit or
allow it to continue.




On Oct 22, 11:48 am, Leonardo K  wrote:
> One thing is your method name and other is your field name. If the name of
> your field is company and your method is company so:
>
> rules:{
>     company:{
>          company:true
>     }
>
> }
>
> Maybe is better rename your method to not confuse.
>
> On Thu, Oct 22, 2009 at 13:24, JMan  wrote:
>
> > Still no go... below is my code. I just want to pop a dialog to ask
> > the user if they are sure they want to leave the company name blank.
> > The field is not required. I thought it would be easier than this? I
> > can't get teh addMethod to work or fire at all on validation.
>
> > //validates the form
> >                var validator = frmSubmittal.validate({
> >                                                         debug: false,
> >                                                        focusCleanup: false,
> >                                                        focusInvalid: false,
> >                                                        onfocusout: false,
> >                                                        onkeyup: false,
> >                                                        errorPlacement:
> > function(error, element) {error.prependTo
> > ( element.parents("div.ctrlHolder"));},
> >                                                        errorElement:'div',
>
> >  errorClass:'valerror',
> >                                                        rules: {
>
> >  restitutionaddress: {required: "#sameAsBusinessAddress
> > [checked='false']"},
>
> >  restitutioncity: {required: "#sameAsBusinessAddress
> > [checked='false']"},
>
> >  restitutionstate: {required: "#sameAsBusinessAddress
> > [checked='false']"},
>
> >  restitutionzipcode: {required: "#sameAsBusinessAddress
> > [checked='false']"},
>
> >  company:true
> >                                                                 }
>
> >                });
>
> >                $.validator.addMethod( "company", function(value, element)
> > {alert
> > ("hello"); return false;}, "Enter a Company Name" );
>
> > On Oct 21, 9:18 pm, Leonardo K  wrote:
> > > U need set the rules for your validation:
>
> > > frmSubmittal.validate({
> > >     debug: false,
> > >     focusCleanup: false,
> > >     focusInvalid: false,
> > >     onfocusout: false,
> > >     onkeyup: false,
> > >     errorPlacement: function(error, element) {
> > >         error.prependTo( element.parents("div.ctrlHolder"));
> > >     },
> > >     errorElement:'div',
> > >     errorClass:'valerror',
> > >     rules:{
> > >         nameField:{
> > >             company:true
> > >         }
> > >     }
>
> > > });
> > > On Wed, Oct 21, 2009 at 22:04, JMan  wrote:
>
> > > > what am I doing wrong here? I cannot figure out how to use the
> > > > addMethod().
>
> > > > var frmSubmittal = $("#frmSubmittal");
>
> > > > //validates the form
> > > > frmSubmittal.validate({
> > > >                                                        debug: false,
> > > >                                                        focusCleanup:
> > false,
> > > >                                                        focusInvalid:
> > false,
> > > >                                                        onfocusout:
> > false,
> > > >                                                        onkeyup: false,
> > > >                                                        errorPlacement:
> > > > function(error, element) {error.prependTo
> > > > ( element.parents("div.ctrlHolder"));},
>
> >  errorElement:'div',
>
> > > >  errorClass:'valerror'
>
> > > > });
>
> > > > $.validator.addMethod( "company", function(value, element) {alert
> > > > ("hello"); return false;}, "Enter a Company Name" );


[jQuery] Re: Cycle fxFn being reset

2009-10-22 Thread Mike Alsup

> In regards to the 9/9/9 release; it seems like the fxFn is set to null
> in the resetState function and not being set back. I am invoking the
> script with:
>
> $(document).ready( function() {jQuery
> ('#cf73b7c6341940210VgnVCM10288ea8c0').cycle({
> pagerEvent: 'mouseover',
> timeout: 4500,
> pager: '#pager',
> cleartype: 1,
> slideExpr: ".carouselElement",
> fxFn:'slideFade' });
>
> });


For custom transitions it's best to add your function to the
'transitions' object.  The 'fxFn' option is not well-supported for
external use - I should update the docs to reflect that.  So I would
recommend an approach like this:

// declare your transition fn
$.fn.cycle.transitions.slideFade = function($container, $slides, opts)
{
// your transition logic goes here!
}

// and set the 'fx' option to the name of your transition
jQuery('#slideshow').cycle({
fx: 'slideFade',
pagerEvent: 'mouseover',
timeout: 4500,
pager: '#pager',
cleartype: 1,
slideExpr: ".carouselElement"
});


For example, this is how the 'scrollUp' effect is defined:

$.fn.cycle.transitions.scrollUp = function($cont, $slides, opts) {
$cont.css('overflow','hidden');
opts.before.push($.fn.cycle.commonReset);
var h = $cont.height();
opts.cssBefore ={ top: h, left: 0 };
opts.cssFirst = { top: 0 };
opts.animIn   = { top: 0 };
opts.animOut  = { top: -h };
};





[jQuery] Re: validation plugin addMethod does not work for me.

2009-10-22 Thread Leonardo K
One thing is your method name and other is your field name. If the name of
your field is company and your method is company so:

rules:{
company:{
 company:true
}
}

Maybe is better rename your method to not confuse.


On Thu, Oct 22, 2009 at 13:24, JMan  wrote:

>
> Still no go... below is my code. I just want to pop a dialog to ask
> the user if they are sure they want to leave the company name blank.
> The field is not required. I thought it would be easier than this? I
> can't get teh addMethod to work or fire at all on validation.
>
>
> //validates the form
>var validator = frmSubmittal.validate({
> debug: false,
>focusCleanup: false,
>focusInvalid: false,
>onfocusout: false,
>onkeyup: false,
>errorPlacement:
> function(error, element) {error.prependTo
> ( element.parents("div.ctrlHolder"));},
>errorElement:'div',
>
>  errorClass:'valerror',
>rules: {
>
>  restitutionaddress: {required: "#sameAsBusinessAddress
> [checked='false']"},
>
>  restitutioncity: {required: "#sameAsBusinessAddress
> [checked='false']"},
>
>  restitutionstate: {required: "#sameAsBusinessAddress
> [checked='false']"},
>
>  restitutionzipcode: {required: "#sameAsBusinessAddress
> [checked='false']"},
>
>  company:true
> }
>
>});
>
>$.validator.addMethod( "company", function(value, element)
> {alert
> ("hello"); return false;}, "Enter a Company Name" );
>
>
>
>
>
>
> On Oct 21, 9:18 pm, Leonardo K  wrote:
> > U need set the rules for your validation:
> >
> > frmSubmittal.validate({
> > debug: false,
> > focusCleanup: false,
> > focusInvalid: false,
> > onfocusout: false,
> > onkeyup: false,
> > errorPlacement: function(error, element) {
> > error.prependTo( element.parents("div.ctrlHolder"));
> > },
> > errorElement:'div',
> > errorClass:'valerror',
> > rules:{
> > nameField:{
> > company:true
> > }
> > }
> >
> > });
> > On Wed, Oct 21, 2009 at 22:04, JMan  wrote:
> >
> > > what am I doing wrong here? I cannot figure out how to use the
> > > addMethod().
> >
> > > var frmSubmittal = $("#frmSubmittal");
> >
> > > //validates the form
> > > frmSubmittal.validate({
> > >debug: false,
> > >focusCleanup:
> false,
> > >focusInvalid:
> false,
> > >onfocusout:
> false,
> > >onkeyup: false,
> > >errorPlacement:
> > > function(error, element) {error.prependTo
> > > ( element.parents("div.ctrlHolder"));},
> > >
>  errorElement:'div',
> >
> > >  errorClass:'valerror'
> >
> > > });
> >
> > > $.validator.addMethod( "company", function(value, element) {alert
> > > ("hello"); return false;}, "Enter a Company Name" );
>


[jQuery] Nested Tabs

2009-10-22 Thread Adrianp

Hi

I'm new to jQuery (a couple of weeks). I'm trying to nest the jQueryUI
tab control. It works fine until the nested tabs are in an external
file then I get an exception thrown in the jQuery source. This seems
to be a timing issue to a certain extent, because if I place alert
boxes in the .ready function of the nested tabs it works. Can anyone
help? I'm sure this question must have been asked before, but after
hours of searching I can't seem to find a solution.

Here's my very simple example...

Outer Tab
-



http://jqueryui.com/latest/
jquery-1.3.2.js">
http://jqueryui.com/latest/ui/
ui.core.js">
http://jqueryui.com/latest/ui/
ui.tabs.js">

$(function() {
$("#OuterTab").tabs();
});



  

  InnerTab1
  InnerTab2





  



innerTab1.aspx
--
http://www.w3.org/1999/xhtml"; >


 
http://jqueryui.com/latest/
jquery-1.3.2.js">
http://jqueryui.com/latest/ui/
ui.core.js">
http://jqueryui.com/latest/ui/
ui.tabs.js">

$(function() {
$("#tabs").tabs();
});



   

  InnerTabA1
  InnerTabA2



   



innerTab2.aspx
--
http://www.w3.org/1999/xhtml"; >


 
http://jqueryui.com/latest/
jquery-1.3.2.js">
http://jqueryui.com/latest/ui/
ui.core.js">
http://jqueryui.com/latest/ui/
ui.tabs.js">

$(function() {
$("#tabs").tabs();
});



   

  InnerTabB1
  InnerTabB2



   



Thanks in advance!

Adrian



[jQuery] Cycle fxFn being reset

2009-10-22 Thread Jim McCollom

In regards to the 9/9/9 release; it seems like the fxFn is set to null
in the resetState function and not being set back. I am invoking the
script with:

$(document).ready( function() {jQuery
('#cf73b7c6341940210VgnVCM10288ea8c0').cycle({
pagerEvent: 'mouseover',
timeout: 4500,
pager: '#pager',
cleartype: 1,
slideExpr: ".carouselElement",
fxFn:'slideFade' });
});

Thanks.

Jim McCollom


[jQuery] slow performance on this site - any suggestions?

2009-10-22 Thread FranktheTank

I built a site for a client and somewhere along the line, I added some
code that slowed down the jQuery performance.  I thought it was my
crusty old laptop, but my brand new quad core PC also shows the
animations quite slowly and choppily.  Thus, the problem is with my
code.

tO MAKE IT MORE

Here's the site:
http://beyerhomes.com

The accordion that displays the various panels is kinda slow, the
slideshow is pretty choppy, and the lightbox is also quite chunky and
un-smooth when it transitions between images.

This site is my first serious effort with jQuery, so expect noob
mistakes.  I'm also very interested in any suggestions on better
coding practice.  Any and all help is very much appreciated.

Thanks,
Frank


[jQuery] Re: validation plugin addMethod does not work for me.

2009-10-22 Thread JMan

Still no go... below is my code. I just want to pop a dialog to ask
the user if they are sure they want to leave the company name blank.
The field is not required. I thought it would be easier than this? I
can't get teh addMethod to work or fire at all on validation.


//validates the form
var validator = frmSubmittal.validate({
debug: false,
focusCleanup: false,
focusInvalid: false,
onfocusout: false,
onkeyup: false,
errorPlacement: 
function(error, element) {error.prependTo
( element.parents("div.ctrlHolder"));},
errorElement:'div',
errorClass:'valerror',
rules: {

restitutionaddress: {required: "#sameAsBusinessAddress
[checked='false']"},

restitutioncity: {required: "#sameAsBusinessAddress
[checked='false']"},

restitutionstate: {required: "#sameAsBusinessAddress
[checked='false']"},

restitutionzipcode: {required: "#sameAsBusinessAddress
[checked='false']"},

company:true
}

});

$.validator.addMethod( "company", function(value, element) 
{alert
("hello"); return false;}, "Enter a Company Name" );






On Oct 21, 9:18 pm, Leonardo K  wrote:
> U need set the rules for your validation:
>
> frmSubmittal.validate({
>     debug: false,
>     focusCleanup: false,
>     focusInvalid: false,
>     onfocusout: false,
>     onkeyup: false,
>     errorPlacement: function(error, element) {
>         error.prependTo( element.parents("div.ctrlHolder"));
>     },
>     errorElement:'div',
>     errorClass:'valerror',
>     rules:{
>         nameField:{
>             company:true
>         }
>     }
>
> });
> On Wed, Oct 21, 2009 at 22:04, JMan  wrote:
>
> > what am I doing wrong here? I cannot figure out how to use the
> > addMethod().
>
> > var frmSubmittal = $("#frmSubmittal");
>
> > //validates the form
> > frmSubmittal.validate({
> >                                                        debug: false,
> >                                                        focusCleanup: false,
> >                                                        focusInvalid: false,
> >                                                        onfocusout: false,
> >                                                        onkeyup: false,
> >                                                        errorPlacement:
> > function(error, element) {error.prependTo
> > ( element.parents("div.ctrlHolder"));},
> >                                                        errorElement:'div',
>
> >  errorClass:'valerror'
>
> > });
>
> > $.validator.addMethod( "company", function(value, element) {alert
> > ("hello"); return false;}, "Enter a Company Name" );


[jQuery] Re: $.Event is not a function js/jquery/ui.core.js Line 345

2009-10-22 Thread Maxime FAYE
Nope :

jQuery JavaScript Library v1.3.2 that's what the jQuery.js file says :)

2009/10/22 Ariel Flesler 

> Could be that you're using an old version of jQuery (prior to 1.3.x?)
>
>
> On Thu, Oct 22, 2009 at 1:03 PM, Maxime FAYE wrote:
>
>> Sorry no...
>>
>> But i can give you the code that is generting the error :
>> var sDialogId = "divPleaseActionDialog";
>> var sDialog = "";
>> var oButtons = {};
>> oButtons[aTranslations["ok"]] = function(){
>> $j('#' + sDialogId).dialog('destroy');
>> };
>> sDialog += '' + "\n";
>> sDialog += 'Please select at least one action';
>> sDialog += '' + "\n";
>> $j('body').append(sDialog);
>> alert($j('#' + sDialogId).length);
>> $j('#' + sDialogId).dialog({
>> modal:true,
>> buttons:oButtons,
>> height:300,
>> width:500,
>> stack:true,
>> title:aTranslations['error'],
>> close:function() {
>> $j('#' + sDialogId).dialog('destroy');
>> }
>> });
>>
>> It seems that the error occure when jQuery launch the dialog
>>
>> 2009/10/22 Ariel Flesler 
>>
>>>
>>> Can you provide a link to the page where you see this error?
>>>
>>> --
>>> Ariel Flesler
>>> http://flesler.blogspot.com
>>>
>>> On Oct 22, 1:32 pm, Maskime  wrote:
>>> > Hi all,
>>> >
>>> > I'm having the following error when  opening a dialog
>>> >
>>> > $.Event is not a function js/jquery/ui.core.js Line 345
>>> >
>>> > I don't really understand what's happening since i'm using this code
>>> > to load dialog in many places in my application an it's the first time
>>> > that i'm having this problem...
>>> > If any one has an idea, it's more than welcome :)
>>> >
>>> > Thank you in advance.
>>>
>>
>>
>>
>>
>
>
> --
> Ariel Flesler
> http://flesler.blogspot.com
>


[jQuery] Re: $.Event is not a function js/jquery/ui.core.js Line 345

2009-10-22 Thread Ariel Flesler
Could be that you're using an old version of jQuery (prior to 1.3.x?)

On Thu, Oct 22, 2009 at 1:03 PM, Maxime FAYE  wrote:

> Sorry no...
>
> But i can give you the code that is generting the error :
> var sDialogId = "divPleaseActionDialog";
> var sDialog = "";
> var oButtons = {};
> oButtons[aTranslations["ok"]] = function(){
> $j('#' + sDialogId).dialog('destroy');
> };
> sDialog += '' + "\n";
> sDialog += 'Please select at least one action';
> sDialog += '' + "\n";
> $j('body').append(sDialog);
> alert($j('#' + sDialogId).length);
> $j('#' + sDialogId).dialog({
> modal:true,
> buttons:oButtons,
> height:300,
> width:500,
> stack:true,
> title:aTranslations['error'],
> close:function() {
> $j('#' + sDialogId).dialog('destroy');
> }
> });
>
> It seems that the error occure when jQuery launch the dialog
>
> 2009/10/22 Ariel Flesler 
>
>>
>> Can you provide a link to the page where you see this error?
>>
>> --
>> Ariel Flesler
>> http://flesler.blogspot.com
>>
>> On Oct 22, 1:32 pm, Maskime  wrote:
>> > Hi all,
>> >
>> > I'm having the following error when  opening a dialog
>> >
>> > $.Event is not a function js/jquery/ui.core.js Line 345
>> >
>> > I don't really understand what's happening since i'm using this code
>> > to load dialog in many places in my application an it's the first time
>> > that i'm having this problem...
>> > If any one has an idea, it's more than welcome :)
>> >
>> > Thank you in advance.
>>
>
>
> >
>


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


[jQuery] Re: $.Event is not a function js/jquery/ui.core.js Line 345

2009-10-22 Thread Maxime FAYE
Sorry no...

But i can give you the code that is generting the error :
var sDialogId = "divPleaseActionDialog";
var sDialog = "";
var oButtons = {};
oButtons[aTranslations["ok"]] = function(){
$j('#' + sDialogId).dialog('destroy');
};
sDialog += '' + "\n";
sDialog += 'Please select at least one action';
sDialog += '' + "\n";
$j('body').append(sDialog);
alert($j('#' + sDialogId).length);
$j('#' + sDialogId).dialog({
modal:true,
buttons:oButtons,
height:300,
width:500,
stack:true,
title:aTranslations['error'],
close:function() {
$j('#' + sDialogId).dialog('destroy');
}
});

It seems that the error occure when jQuery launch the dialog

2009/10/22 Ariel Flesler 

>
> Can you provide a link to the page where you see this error?
>
> --
> Ariel Flesler
> http://flesler.blogspot.com
>
> On Oct 22, 1:32 pm, Maskime  wrote:
> > Hi all,
> >
> > I'm having the following error when  opening a dialog
> >
> > $.Event is not a function js/jquery/ui.core.js Line 345
> >
> > I don't really understand what's happening since i'm using this code
> > to load dialog in many places in my application an it's the first time
> > that i'm having this problem...
> > If any one has an idea, it's more than welcome :)
> >
> > Thank you in advance.
>


[jQuery] Re: $.Event is not a function js/jquery/ui.core.js Line 345

2009-10-22 Thread Ariel Flesler

Can you provide a link to the page where you see this error?

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

On Oct 22, 1:32 pm, Maskime  wrote:
> Hi all,
>
> I'm having the following error when  opening a dialog
>
> $.Event is not a function js/jquery/ui.core.js Line 345
>
> I don't really understand what's happening since i'm using this code
> to load dialog in many places in my application an it's the first time
> that i'm having this problem...
> If any one has an idea, it's more than welcome :)
>
> Thank you in advance.


[jQuery] Re: Some little Problems to extract data from ajax response ....

2009-10-22 Thread Evgeny Bobovik

I usually do so:
By your page empty div:  
and use the following method:

$.ajax({
  url:'/index.php',
  type:'GET',
  success: function(data) {
  $('#temp').html(data);
  $('body').html($('#temp').html());
  $('#temp').html('');
  }
})
   Gk___
Sent from Minsk, Belarus



2009/10/20 WebHamster :
>
> Hi all ...
>
> I have some small problems with Jquery ...
>
> I have a index.php site, inside this file it gives some 's with
> ID's. When i load the index.php file (over $.ajax), it isnt accessible
> for me  ... i thinks its better when i make a example...
>
> $.ajax({
>   url:'/index.php',
>   type:'GET',
>   success: function(data) {
>       var responseText = $(data);
>       $('body').html(responseText.find('body').html());
>   }
> })
>
> This example does not work by me, make i something wrong? Another
> issue is, that i can only find elements that are enclosed by a 
> tag, but a  tag i cant make the  arround, because outside
> of  's will not be recognized ...
>
>
> Anybody have me a hint for this? Thanks a lot and have a nice day ...
>
>
> Cheers
> WebHamster
>


[jQuery] $.Event is not a function js/jquery/ui.core.js Line 345

2009-10-22 Thread Maskime

Hi all,

I'm having the following error when  opening a dialog

$.Event is not a function js/jquery/ui.core.js Line 345

I don't really understand what's happening since i'm using this code
to load dialog in many places in my application an it's the first time
that i'm having this problem...
If any one has an idea, it's more than welcome :)

Thank you in advance.


[jQuery] Re: newbie: Error on JSON parsing

2009-10-22 Thread MorningZ

if you are using jsonp, then you have to wrap the JSON inside a
function

so for instance, on the docs page they have this Ajax call (and i'll
remove some code for brevity):

$.getJSON(
  "http://api.flickr.com/services/feeds/photos_public.gne?
tags=cat&format=json&jsoncallback=?",
  function(data){
  // Do stuff with json object "data"
  }
);

the actual text generated by Flickr is

jsonp1256221212936({
"title": "Recent Uploads tagged cat",
"link": "http://www.flickr.com/photos/tags/cat/";,
"description": "",
"modified": "2009-10-22T14:01:57Z",
"generator": "http://www.flickr.com/";,
"items": [
   {
"title": "a kitteh",
"link": 
"http://www.flickr.com/photos/ifido/4034869804/";,
"media": {"m":"http://farm3.static.flickr.com/
2778/4034869804_6a838ee975_m.jpg"},
"date_taken": "2009-10-21T22:57:02-08:00",
"description": "a description",
"published": "2009-10-22T14:01:57Z",
"author": "nob...@flickr.com (ifido)",
"author_id": "30832...@n00",
"tags": "red cat paws"
   }
]
})



So seeing that working sample, your generated JSON of

{"15":{"id":15,"x":0.4589937586135409,"y":
0.8324914620560137,"z":-0.9435707004102728,"rawData":"1256204002860 13
-442866538 18392602 647462767 314 1777206957 -1664784174 "}}

should be

({"15":{"id":15,"x":0.4589937586135409,"y":
0.8324914620560137,"z":-0.9435707004102728,"rawData":"1256204002860 13
-442866538 18392602 647462767 314 1777206957 -1664784174 "}})

Where XXX is the posted value of the Form key "callback"

*then* getJSON will work   :-)

This article is a fantastic read to understand what is going on with a
jsonp call

http://www.ibm.com/developerworks/library/wa-aj-jsonp1/





On Oct 22, 9:15 am, loste  wrote:
> Hello,
> I'm trying to parse a Json string received by $.getJSON().
>
> I can receive the string but firebug gives me an "invalid label"
> error.
> I think it is because the string is an hash array with a number as
> first label, but I'm not sure.
>
> This is the string:
> {"15":{"id":15,"x":0.4589937586135409,"y":
> 0.8324914620560137,"z":-0.9435707004102728,"rawData":"1256204002860 13
> -442866538 18392602 647462767 314 1777206957 -1664784174 "}}
>
> and this is the non-working code:
>
>  $.getJSON(url+"&jsoncallback=?", function(received){
>         stateChanged(received);
>     });
>
> Any Idea on how can I import it?
>
> Thank you,
> loste


[jQuery] Re: images show before jquery and cycle plugin work their magic

2009-10-22 Thread Charlie





try giving the carousel UL a huge width , say 10,000 px, and carousel
wrapper set height, width and overflow : hidden

this is done by the script also but until script fully fires your css
should make up for it 

Sam wrote:

  I'm not entirely sure that some of these fixes apply to my situation
as I'm not using cycle plugin.

I am having the same issue as the original poster however, please see
for yourself.

http://samgabellshoots.com/

Any pointers on how to fix or at least 'hide' the issue until after
load would be greatly appreciated :)

On Oct 21, 4:40 pm, Mike Alsup  wrote:
  
  

  I've had this issue before. As Karl suggests, I was able to fix it by
giving the parent element (the one calling the cycle plugin) a fixed
height (the height of the images you're cycling) and an overflow of
hidden in the CSS. If the slides are of different heights, set the
height to the height of the first slide.
  

Another approach is to have a CSS rule that hides all but the first
slide.

  
  
  






[jQuery] Re: Tablesorter not sorting table returned via ajax

2009-10-22 Thread MorningZ

"I have tried to add an onSuccess function to update the table
function
(){  $("table").trigger("update");  }
but the table does not sort"

If "#div_reveal" is filled with the actual  html,all of it,
upon successful return from the Ajax call, then the tablesorter
functionality is *not* wired up to it, hence trigger won't work...





On Oct 22, 7:18 am, magellan1975  wrote:
> I have read the posts concerning tablesorter and ajax and have tried
> the tips but to no avail.
>
> I have a div container that is used to specify where the table I
> retrieve via ajax is placed $("#div_reveal").html(AjaxResponse).
>
> I have tried to add an onSuccess function to update the table function
> (){  $("table").trigger("update");  }
> but the table does not sort. When I copy the output table directly
> into the page (static) it sorts. Therefore, I am assuming that the new
> table is not being added to the Dom and and is not being "recognized"
> by tablesorter.
>
> Does anyone know of a solution to retrieve and display a full html
> table via ajax and get tablesorter to sort it.
>
> Regards
>
> Kevin Hickey


[jQuery] Re: jQuery.ajax() not calling beforeSend?

2009-10-22 Thread Dave Methvin

> It's our own existing auth service (and I'm not on the implementation team).
> Most other usages of this service are not directly from the browser, but
> from the back-end via java. I thought about proxying it via my service, but
> my service isn't SSL, so proxying still doesn't give me security anyway.

You might want to discuss it with the auth service team, it sounds
like they haven't anticipated this type of usage.



[jQuery] Re: How can i set a number inside a h1 tag before the text starts?

2009-10-22 Thread bc04Inc.

So here is the function:


(function($) {
  $.toc = function(tocList) {

$(tocList).addClass('jquery-toc');
var tocListArray = tocList.split(',');
$.each(tocListArray, function(i,v) { tocListArray[i] = $.trim
(v); });

var $elements = $('.jquery-toc');

$('body').append('
'); var $toc = $('body div:last'); var lastLevel = 1; $toc.append('
    '); $elements.each(function() { var $e = $(this); var text = $e.text(); var anchor = text.replace(/ /g,'-'); $e.before(''); var level; $.each(tocListArray, function(i,v) { if (v.match(' ')) { var vArray = v.split(' '); var e = vArray[vArray.length - 1]; } else { e = v; } if ($e.is(e)) { level = i+1; } }); var className = 'jquery-toc-' + level; var li = '
  • ' + text + '
  • '; if (level == lastLevel) { $('ul.' + className + ':last',$toc).append(li); } else if (level > lastLevel) { var parentLevel = level - 1; var parentClassName = 'jquery-toc-' + parentLevel; $('ul.' + parentClassName + ':last',$toc). append('
      '); $('ul.' + className + ':last',$toc).append(li); } else if (level < lastLevel) { $('ul.' + className + ':last',$toc).append(li); } lastLevel = level; }); var $toc_ul = $('ul.jquery-toc-1',$toc); $toc.remove(); return($toc_ul); } })(jQuery); $(document).ready(function(){ $.toc('#pagecontent_b h1,#pagecontent_b h2,#pagecontent_b h3').prependTo('#pagecontent_b'); }); It creates a table of content for all the h1, h2, etc on a page. What i want to do is, to set a number in front of each TOC Element. I cant use OL's cause the subheader (h2, h3, etc) must be numbered like 1.1.1 or 1.2.1 etc. Thats one thing. The other thing is, when i did this for a heading, i want to manipulate the html inside this hx Tag so it exactly shows the same number as the table of content. That means i have to manipulate the hx tag and add in front of the "insidehtml" the number. Nothing more. thank you yavuz On 22 Okt., 15:27, jerome wrote: > sorry, but I don't know Rebecca Murphey. Why can't you just wrapper the head > tag in an ol? or do you need to change the h tag level to a different level? > > > > - Original Message - > From: "bc04Inc." > To: "jQuery (English)" > Sent: Thursday, October 22, 2009 1:24 AM > Subject: [jQuery] How can i set a number inside a h1 tag before the text > > starts? > > Hi, > i am using the table of contents function of rebecca murphey. The > script works fine, but i need to extend itin two ways. > > 1. set a number for each toc element? > 2. set exactly this number to he h1 inner html in fron of the text? > > So that the result is: > > 1. Head 1 > 2. Head 2 > … > … > > 1. Head 1 > mycontent text djaskdjasödjaskdj aslökjd asd > dkajsdjaslödkjasdkljasldkjasd > > 2. Head 2 > mycontent text sldkasäfasdfkasdjflöasdf > asdfasdkfjasdfnasdm,fn sdjaf asöd > ... > > Thank you!- Zitierten Text ausblenden - > > - Zitierten Text anzeigen -

      [jQuery] Inline Datepicker Help

      2009-10-22 Thread TRaymond
      
      I have an inline datepicker on my page...I need two things:
      
      1.)  I've implemented the onSelect method, but what I really want to
      do is do a non-modal popup for the user to see what calendar events
      from the database that are on the date selected.  I've worked out all
      the database and json parts, but now I need to make the popup near the
      calendar.  I'm surprised that there isn't any mouse coordinates passed
      to the onSelect function.  Anyone ever attempted something like this?
      What I'm looking for is something similar to this:
      
      http://www.kensingtonhilltop.org/dad
      
      2.)  Also from the link above, you see how they have a star on the
      dates that have events associated with that date?  How can we modify
      the date so that there is some way to distinguish days that have
      events associated with them versus ones that don't.
      
      Thanks in advance!
      
      

      [jQuery] Re: How can i set a number inside a h1 tag before the text starts?

      2009-10-22 Thread jerome
      
      
      sorry, but I don't know Rebecca Murphey. Why can't you just wrapper the head 
      tag in an ol? or do you need to change the h tag level to a different level?
      
      
      - Original Message - 
      From: "bc04Inc." 
      
      To: "jQuery (English)" 
      Sent: Thursday, October 22, 2009 1:24 AM
      Subject: [jQuery] How can i set a number inside a h1 tag before the text 
      starts?
      
      
      
      
      Hi,
      i am using the table of contents function of rebecca murphey. The
      script works fine, but i need to extend itin two ways.
      
      1. set a number for each toc element?
      2. set exactly this number to he h1 inner html in fron of the text?
      
      So that the result is:
      
      1. Head 1
      2. Head 2
      …
      …
      
      1. Head 1
      mycontent text djaskdjasödjaskdj aslökjd asd
      dkajsdjaslödkjasdkljasldkjasd
      
      2. Head 2
      mycontent text sldkasäfasdfkasdjflöasdf
      asdfasdkfjasdfnasdm,fn sdjaf asöd
      ...
      
      Thank you!
      
      
      
      
      

      [jQuery] hoverintent - IE jumps expanded text 1px

      2009-10-22 Thread Lucas
      
      Got a new menu going with superfish and hoverintent and all looking
      good (not uploaded yet). Works fine with firefox, safari and chrome
      and surprise surprise having a small issue with IE.
      
      It is a small issue and hoping it is a recognised problem so will hold
      off uploading code examples...using IE8 mouse over an expandable menu,
      it expands and then at the last second the text jumps 1px downwards
      giving a slight jerk to the whole thing.
      
      Anyone heard/seen this before?
      
      

      [jQuery] Tablesorter not sorting table returned via ajax

      2009-10-22 Thread magellan1975
      
      I have read the posts concerning tablesorter and ajax and have tried
      the tips but to no avail.
      
      I have a div container that is used to specify where the table I
      retrieve via ajax is placed $("#div_reveal").html(AjaxResponse).
      
      I have tried to add an onSuccess function to update the table function
      (){  $("table").trigger("update");  }
      but the table does not sort. When I copy the output table directly
      into the page (static) it sorts. Therefore, I am assuming that the new
      table is not being added to the Dom and and is not being "recognized"
      by tablesorter.
      
      Does anyone know of a solution to retrieve and display a full html
      table via ajax and get tablesorter to sort it.
      
      Regards
      
      Kevin Hickey
      
      

      [jQuery] images visible when first loading the web page

      2009-10-22 Thread joe
      
      I have a problem with jquery and ie - the code for my webpage is
      broken down in three parts - script, style and body.  the body is just
      tables of images.  All the images have been tagged with a div id that
      should render them invisible using the jquery hide function.  When you
      load the page all the images appear to load one on top of the other.
      When all the loading is done they disappear and the page works just
      fine.  It is as if the jquery functions are kicking in after the
      images are loaded.  Is there any way to prevent this.  It doesn't
      happen with safari 4.0.3 or foxfire.  although it does happen on an
      earlier version of safari.
      
      Joe
      
      

      [jQuery] Ajax call not working for Firefox/Mac only

      2009-10-22 Thread darrenm
      
      I've got a page that uses Ajax to submit the contents of a feedback
      form without refreshing the page. It all works fine with IE7 and
      Firefox on Windows but not with at least one user's Firefox on Mac
      platform. The web server is IIS6.
      
      The code I'm using is contained in a script file referenced in the
       tag and looks like this:
      
      $(function() {
      //trigger ajax on submit
      $('#feedbackform').submit( function(){
      
      //hide the form
      $('#feedbackform').hide();
      
      //show the loading bar
      $('.loader').append($('.bar'));
      $('.bar').css({display:'block'});
      
      //send the ajax request
      $.ajax({
      type: "POST",
      url: "default.aspx",
      data: {pageaction:$('#pageaction').val(),thispageaction:$
      ('#thispageaction').val(),comment:$('#comment').val()},
      dataType: "text",
      success: function(text){
      $('.bar').css({display:'none'});
      $('.loader').append(text);
      },
      error: function (XMLHttpRequest, textStatus, errorThrown)
      {
      alert('There was an error saving your feedback.');
      }
      });
      
      //stay on the page
      return false;
      });
      });
      
      And the form:
      
      
      
      
      
      
      Feedback
      
      
      If you'd like to see something changed, or have any 
      feedback about
      this page, please fill in
      the comments box below and click Submit to let us know.
      
      
       
      
      
      
      
      
      
      
      Unfortunately I don't have access to a Mac and this problem has been
      reported by a user who we're not keen to bug too much. Basically when
      he clicks the submit button on the form, nothing happens and we get no
      record in the web server logs of the request coming in, so I'm
      assuming that the above ajax call is not working on his platform.
      
      Are there any issues with the above code that anyone can spot which
      might cause this problem? I'm hoping I've made a basic error
      somewhere. Any help appreciated.
      
      

      [jQuery] newbie: Error on JSON parsing

      2009-10-22 Thread loste
      
      Hello,
      I'm trying to parse a Json string received by $.getJSON().
      
      I can receive the string but firebug gives me an "invalid label"
      error.
      I think it is because the string is an hash array with a number as
      first label, but I'm not sure.
      
      This is the string:
      {"15":{"id":15,"x":0.4589937586135409,"y":
      0.8324914620560137,"z":-0.9435707004102728,"rawData":"1256204002860 13
      -442866538 18392602 647462767 314 1777206957 -1664784174 "}}
      
      and this is the non-working code:
      
       $.getJSON(url+"&jsoncallback=?", function(received){
      stateChanged(received);
      });
      
      Any Idea on how can I import it?
      
      Thank you,
      loste
      
      

      [jQuery] superfish and hoverintent IE issue

      2009-10-22 Thread Lucas
      
      Got a new menu going with superfish and hoverintent and all looking
      good (not uploaded yet). Works fine with firefox, safari and chrome
      and surprise surprise having a small issue with IE.
      
      It is a small issue and hoping it is a recognised problem so will hold
      off uploading code examples...using IE8 mouse over an expandable menu,
      it expands and then at the last second the text jumps 1px downwards
      giving a slight jerk to the whole thing.
      
      Anyone heard/seen of this before?
      
      

      [jQuery] jquery tree

      2009-10-22 Thread Jelle
      
      Hello,
      
      First of all, thanks for this great plugin, i love it!
      
      But ... im having isues with the auto expand of the treeview when i
      add '#something' at the end of the url. The menu doesnt auto expand at
      all when an anchor is added to the current url.
      
      Do you have any idea how to solve this problem?
      
      I'm looking forward to your reply,
      
      Kind regards,
      Jelle
      
      

      [jQuery] How can i set a number inside a h1 tag before the text starts?

      2009-10-22 Thread bc04Inc.
      
      Hi,
      i am using the table of contents function of rebecca murphey. The
      script works fine, but i need to extend itin two ways.
      
      1. set a number for each toc element?
      2. set exactly this number to he h1 inner html in fron of the text?
      
      So that the result is:
      
      1. Head 1
      2. Head 2
      …
      …
      
      1. Head 1
      mycontent text djaskdjasödjaskdj aslökjd asd
      dkajsdjaslödkjasdkljasldkjasd
      
      2. Head 2
      mycontent text sldkasäfasdfkasdjflöasdf
      asdfasdkfjasdfnasdm,fn sdjaf asöd
      ...
      
      Thank you!
      
      

      [jQuery] Re: newbie: test for null selection

      2009-10-22 Thread Richard D. Worth
      That pretty much sums up the beauty of jQuery. :)
      
      - Richard
      
      On Thu, Oct 22, 2009 at 1:51 AM, BradW  wrote:
      
      >
      > Aha!  So if I understand the implications of this, a selector always
      > returns a wrapper object that acts like BOTH a javascript array and
      > like a single DOM element – even though it is really neither.  And
      > this allows us to write elegant code that treats selectors as single
      > objects, or as arrays, whether nothing or one thing or 17 things are
      > found.  Is that right?
      >
      > On Oct 21, 7:35 pm, Dave Methvin  wrote:
      > > if ( $("#missing").length == 0 )
      > >// it's not there
      > >
      > > However, remember that if you apply jQuery methods to an empty
      > > selection it does nothing:
      > >
      > > $("#missing").hide();  // no-op
      >
      
      

      [jQuery] $.Event is not a function js/jquery/ui.core.js Line 345

      2009-10-22 Thread Maxime FAYE
      Hi all,
      
      I'm having the following error when  opening a dialog
      
      $.Event is not a function js/jquery/ui.core.js Line 345
      
      I don't really understand what's happening since i'm using this code to load
      dialog in many places in my application an it's the first time that i'm
      having this problem...
      If any one has an idea, it's more than welcome :)
      
      Thank you in advance.
      
      

      [jQuery] Re: jQuery.ajax() not calling beforeSend?

      2009-10-22 Thread Todd Wells
      It's our own existing auth service (and I'm not on the implementation team).
      Most other usages of this service are not directly from the browser, but
      from the back-end via java. I thought about proxying it via my service, but
      my service isn't SSL, so proxying still doesn't give me security anyway. I
      guess now I'm thinking maybe a small Flash component could be used to obtain
      the security token, as a cross-domain.xml installed on the server will allow
      Flash to cross domains. Not ideal.
      
      On Wed, Oct 21, 2009 at 7:48 PM, Dave Methvin wrote:
      
      >
      > > That's correct, the problem is that it's an authentication service and
      > while
      > > I *could* put the credentials on the URL, it would be sending them in the
      > > clear across the internet, which is not acceptable.
      >
      > That's a tough one. A typical jsonp implementation uses either iframes
      > or (in jQuery's $.ajax case) a dynamically-inserted script tag.
      > Neither allows you to affect the header that's sent. And of course
      > XMLHTTPRequest lets you jiggle headers but doesn't allow cross-domain
      > requests.
      >
      > Are you implementing your own cross-domain authentication service, or
      > are you using some other service?
      
      

      [jQuery] Re: Click multiple times, different states, saves different data to DB (confusing?)

      2009-10-22 Thread The Danny Bos
      
      
      Thanks so much man,
      That'll work well ... One more thing, how would I change it to point
      to classes instead of direct colours?
      
      
      var arrValues = ['c1','c2','c3','c3'],
      
      Thanks again,
      
      
      
      
      On Oct 22, 6:27 pm, mkmanning  wrote:
      > Yeah, the snippet I wrote updates the color; you can add an ajax call
      > to update your db as well, if the value your updating in the db is the
      > color, or else the value is in an array that's indexed the same.
      >
      > On Oct 22, 12:10 am, The Danny Bos  wrote:
      >
      >
      >
      > > For each click of the DIV I'm hoping to change the BackgroundColor,
      > > make some updates in the Database (depending on which array selection
      > > it's on) and that's about it.
      >
      > > So, the first click of the DIV = "Change BG to 'green', update DB
      > > field to 'XXX'"
      > > the second click of the DIV = "Change the BG to 'aqua', update DB
      > > field to 'YYY'"
      > > the third click ... etc
      >
      > > Know what I mean?
      >
      > > On Oct 22, 6:04 pm, mkmanning  wrote:
      >
      > > > Well, if you just want to loop through the array to change the
      > > > background color, you don't really need toggle then. Try this:
      >
      > > >  $("#item_list > li > div > a").click(function(){
      > > >   var arrValues = ['rgb(9, 128, 0)','rgb(0, 255, 255)','rgb(0, 0,
      > > > 255)','rgb(128, 0, 128)'],
      > > >   bgcolor = $.inArray($(this).css('background-color'),arrValues)+1;
      > > >   $(this).css('background-color',arrValues[bgcolor===arrValues.length?
      > > > 0:bgcolor]);
      >
      > > > });
      >
      > > > disclaimer: just wrote it inside Firebug's console, so haven't tested
      > > > it outside that...
      >
      > > > On Oct 21, 10:14 pm, The Danny Bos  wrote:
      >
      > > > > Thanks, had a good read, figured it out in part.
      > > > > Now I'm stuck trying to introduce an array to do my bidding ...
      > > > > Example below.
      >
      > > > > The array is an example of how I want to loop through to use those
      > > > > values.
      > > > > Underneath is the perfect code for clicking an Anchor and changing its
      > > > > BGcolour differently each time.
      >
      > > > > Any ideas?
      >
      > > > > $(document).ready(
      > > > >         function(){
      > > > >                 var arrValues = ['green','aqua','blue','purple'];
      >
      > > > >                 $("#item_list > li > div > a").toggle(
      > > > >                 function(){
      > > > >                         $(this).css('background-color', 'green');
      > > > >                 }, function() {
      > > > >                         $(this).css('background-color', 'aqua');
      > > > >                 }, function() {
      > > > >                         $(this).css('background-color', 'blue');
      > > > >                 }, function() {
      > > > >                         $(this).css('background-color', 'purple');
      > > > >                 });
      >
      > > > > });
      >
      > > > > On Oct 22, 3:46 am, mkmanning  wrote:
      >
      > > > > > .toggle() allows you to rotate through multiple functions, you might
      > > > > > want to check it out in the 
      > > > > > docs:http://docs.jquery.com/Events/toggle#fnfn2fn3.2Cfn4.2C...
      >
      > > > > > On Oct 21, 2:58 am, The Danny Bos  wrote:
      >
      > > > > > > I've got one for ya, JQuery and Ajax.
      >
      > > > > > > I want to have a button image, let's stay it's inactive state it's a
      > > > > > > grey circle, when someone clicks it once, it'd change to a blue 
      > > > > > > circle
      > > > > > > (update associated DB field to "blue"), click it again and it 
      > > > > > > becomes
      > > > > > > a red circle (update the DB field to "red") and so on. So users keep
      > > > > > > clicking until they get the right color, then move on to the next
      > > > > > > one.
      >
      > > > > > > I've seen something similar in Google where you can star emails with
      > > > > > > different stars.
      >
      > > > > > > Any idea how you'd do this?
      > > > > > > It's got me stumped.
      
      

      [jQuery] Re: load vs ajax

      2009-10-22 Thread MorningZ
      
      "I was just wondering if there were any performance differences"
      
      .load, like *any* Ajax call in jQuery, ultimately uses the $.ajax
      method, so other than a hit of one method calling another (which is
      like nothing), there is no performance hit
      
      On Oct 22, 4:55 am, Hogsmill  wrote:
      > Cheers, Richard - very useful.
      >
      > I usually use $.ajax because I return JSON, and, as you say, then I
      > start 'munging' :-) I like the load call (for straight content insert
      > applications) because it's way simpler and easier to read - I was just
      > wondering if there were any performance differences, etc.? Probably
      > not, I suspect - prob, uses the same code...
      >
      > Cheers,
      >
      > Steve
      >
      > On Oct 22, 3:53 am, "Richard D. Worth"  wrote:
      >
      > > .load() is really nice if all you're doing is loading some content into an
      > > element. It's a nice convenience method.
      >
      > > If you're going to take the results of the ajax call and maybe put different
      > > parts of the content in different places, or do some manipulation or other
      > > munging on it before you add it to the page, then $.ajax() or $.get() will
      > > be your best bet.
      >
      > > - Richard
      >
      > > On Wed, Oct 21, 2009 at 10:59 AM, Hogsmill  wrote:
      >
      > > > I've been using $.ajax() for ages, and am now developing on a site
      > > > where they alwats use load(). Does anybody know which is best (if
      > > > either), ans pros and cons for each one?
      >
      > > > Cheers in advance,
      >
      > > > Hogsmill
      
      

      [jQuery] Re: Social media plugin

      2009-10-22 Thread Jon Banner
      yes.
      
      http://github.com/kswedberg/jquery-socialize
      
      
      
      2009/10/22 Ricardo 
      
      >
      > I've visited this site(http://www.intomobile.com/2009/10/09/hands-on-
      > the-nokia-n900-at-ctia-fall-2009.html)
      > and there is an interesting
      > feature to spread the link in social sites like facebook, twitter and
      > others (just point your mouse to the article image). I've found that
      > the effect is provided by the Meebo site. Is there any jquery plugin
      > that do something similar to the linked site above?
      > Thanks in advance.
      
      

      [jQuery] Re: Creating a Function based on text argument

      2009-10-22 Thread Kerry Jones
      Awesome -- I thought there was something like that, now will it pickup 
      on the jquery functions (like trim) or do I need to program that into it?
      
      
      mkmanning wrote:
      
      Operations like .val() return a string, so If you need to extend a
      string you have to use String.prototype:
      
      String.prototype.slug = function(){return this.trim().etc...}
      
      The way you've done it works, but in the same way 'trim' works, i.e.
      you have to pass the string to the function:
      
      $.slug($('#form_element').val());
      
      On Oct 21, 3:05 pm, Kerry  wrote:
        
      
      I've been looking around and besides my best efforts I haven't been
      able to figure it out.
      
      All the function extending I see extends on an _object_.
      
      I want to extend on a string.
      
      /**
       * Returns a slug version of a string
       */
      jQuery.extend ({
      slug: function( text ) {
      return text.trim().toLowerCase().replace( /[^-a-zA-Z0-9\s]/g,
      '' ).replace( /[\s]/g, '-' );
      }
      
      });
      
      I want to be able to do something like:
      
      $('#form_element').val().slug();
      
      The above does not work. I even tried modifying the 'trim' function in
      jQuery core to include the rest of the enhancements, but it didn't
      work.
      
      
      
        
      
      

      [jQuery] Re: load vs ajax

      2009-10-22 Thread Hogsmill
      
      
      Cheers, Richard - very useful.
      
      I usually use $.ajax because I return JSON, and, as you say, then I
      start 'munging' :-) I like the load call (for straight content insert
      applications) because it's way simpler and easier to read - I was just
      wondering if there were any performance differences, etc.? Probably
      not, I suspect - prob, uses the same code...
      
      Cheers,
      
      Steve
      
      On Oct 22, 3:53 am, "Richard D. Worth"  wrote:
      > .load() is really nice if all you're doing is loading some content into an
      > element. It's a nice convenience method.
      >
      > If you're going to take the results of the ajax call and maybe put different
      > parts of the content in different places, or do some manipulation or other
      > munging on it before you add it to the page, then $.ajax() or $.get() will
      > be your best bet.
      >
      > - Richard
      >
      > On Wed, Oct 21, 2009 at 10:59 AM, Hogsmill  wrote:
      >
      > > I've been using $.ajax() for ages, and am now developing on a site
      > > where they alwats use load(). Does anybody know which is best (if
      > > either), ans pros and cons for each one?
      >
      > > Cheers in advance,
      >
      > > Hogsmill
      
      

      [jQuery] Abort a $(...).load() ?

      2009-10-22 Thread Antonello Pasella
      
      Hi *,
      Is there a way to stop a load call in the callback?
      like "return false" prevent new text to be injected into the element?
      
      Bye!
      
      

      [jQuery] Re: Click multiple times, different states, saves different data to DB (confusing?)

      2009-10-22 Thread mkmanning
      
      Yeah, the snippet I wrote updates the color; you can add an ajax call
      to update your db as well, if the value your updating in the db is the
      color, or else the value is in an array that's indexed the same.
      
      On Oct 22, 12:10 am, The Danny Bos  wrote:
      > For each click of the DIV I'm hoping to change the BackgroundColor,
      > make some updates in the Database (depending on which array selection
      > it's on) and that's about it.
      >
      > So, the first click of the DIV = "Change BG to 'green', update DB
      > field to 'XXX'"
      > the second click of the DIV = "Change the BG to 'aqua', update DB
      > field to 'YYY'"
      > the third click ... etc
      >
      > Know what I mean?
      >
      > On Oct 22, 6:04 pm, mkmanning  wrote:
      >
      >
      >
      > > Well, if you just want to loop through the array to change the
      > > background color, you don't really need toggle then. Try this:
      >
      > >  $("#item_list > li > div > a").click(function(){
      > >   var arrValues = ['rgb(9, 128, 0)','rgb(0, 255, 255)','rgb(0, 0,
      > > 255)','rgb(128, 0, 128)'],
      > >   bgcolor = $.inArray($(this).css('background-color'),arrValues)+1;
      > >   $(this).css('background-color',arrValues[bgcolor===arrValues.length?
      > > 0:bgcolor]);
      >
      > > });
      >
      > > disclaimer: just wrote it inside Firebug's console, so haven't tested
      > > it outside that...
      >
      > > On Oct 21, 10:14 pm, The Danny Bos  wrote:
      >
      > > > Thanks, had a good read, figured it out in part.
      > > > Now I'm stuck trying to introduce an array to do my bidding ...
      > > > Example below.
      >
      > > > The array is an example of how I want to loop through to use those
      > > > values.
      > > > Underneath is the perfect code for clicking an Anchor and changing its
      > > > BGcolour differently each time.
      >
      > > > Any ideas?
      >
      > > > $(document).ready(
      > > >         function(){
      > > >                 var arrValues = ['green','aqua','blue','purple'];
      >
      > > >                 $("#item_list > li > div > a").toggle(
      > > >                 function(){
      > > >                         $(this).css('background-color', 'green');
      > > >                 }, function() {
      > > >                         $(this).css('background-color', 'aqua');
      > > >                 }, function() {
      > > >                         $(this).css('background-color', 'blue');
      > > >                 }, function() {
      > > >                         $(this).css('background-color', 'purple');
      > > >                 });
      >
      > > > });
      >
      > > > On Oct 22, 3:46 am, mkmanning  wrote:
      >
      > > > > .toggle() allows you to rotate through multiple functions, you might
      > > > > want to check it out in the 
      > > > > docs:http://docs.jquery.com/Events/toggle#fnfn2fn3.2Cfn4.2C...
      >
      > > > > On Oct 21, 2:58 am, The Danny Bos  wrote:
      >
      > > > > > I've got one for ya, JQuery and Ajax.
      >
      > > > > > I want to have a button image, let's stay it's inactive state it's a
      > > > > > grey circle, when someone clicks it once, it'd change to a blue circle
      > > > > > (update associated DB field to "blue"), click it again and it becomes
      > > > > > a red circle (update the DB field to "red") and so on. So users keep
      > > > > > clicking until they get the right color, then move on to the next
      > > > > > one.
      >
      > > > > > I've seen something similar in Google where you can star emails with
      > > > > > different stars.
      >
      > > > > > Any idea how you'd do this?
      > > > > > It's got me stumped.
      
      

      [jQuery] Re: Click multiple times, different states, saves different data to DB (confusing?)

      2009-10-22 Thread The Danny Bos
      
      
      For each click of the DIV I'm hoping to change the BackgroundColor,
      make some updates in the Database (depending on which array selection
      it's on) and that's about it.
      
      So, the first click of the DIV = "Change BG to 'green', update DB
      field to 'XXX'"
      the second click of the DIV = "Change the BG to 'aqua', update DB
      field to 'YYY'"
      the third click ... etc
      
      Know what I mean?
      
      
      
      On Oct 22, 6:04 pm, mkmanning  wrote:
      > Well, if you just want to loop through the array to change the
      > background color, you don't really need toggle then. Try this:
      >
      >  $("#item_list > li > div > a").click(function(){
      >   var arrValues = ['rgb(9, 128, 0)','rgb(0, 255, 255)','rgb(0, 0,
      > 255)','rgb(128, 0, 128)'],
      >   bgcolor = $.inArray($(this).css('background-color'),arrValues)+1;
      >   $(this).css('background-color',arrValues[bgcolor===arrValues.length?
      > 0:bgcolor]);
      >
      > });
      >
      > disclaimer: just wrote it inside Firebug's console, so haven't tested
      > it outside that...
      >
      > On Oct 21, 10:14 pm, The Danny Bos  wrote:
      >
      >
      >
      > > Thanks, had a good read, figured it out in part.
      > > Now I'm stuck trying to introduce an array to do my bidding ...
      > > Example below.
      >
      > > The array is an example of how I want to loop through to use those
      > > values.
      > > Underneath is the perfect code for clicking an Anchor and changing its
      > > BGcolour differently each time.
      >
      > > Any ideas?
      >
      > > $(document).ready(
      > >         function(){
      > >                 var arrValues = ['green','aqua','blue','purple'];
      >
      > >                 $("#item_list > li > div > a").toggle(
      > >                 function(){
      > >                         $(this).css('background-color', 'green');
      > >                 }, function() {
      > >                         $(this).css('background-color', 'aqua');
      > >                 }, function() {
      > >                         $(this).css('background-color', 'blue');
      > >                 }, function() {
      > >                         $(this).css('background-color', 'purple');
      > >                 });
      >
      > > });
      >
      > > On Oct 22, 3:46 am, mkmanning  wrote:
      >
      > > > .toggle() allows you to rotate through multiple functions, you might
      > > > want to check it out in the 
      > > > docs:http://docs.jquery.com/Events/toggle#fnfn2fn3.2Cfn4.2C...
      >
      > > > On Oct 21, 2:58 am, The Danny Bos  wrote:
      >
      > > > > I've got one for ya, JQuery and Ajax.
      >
      > > > > I want to have a button image, let's stay it's inactive state it's a
      > > > > grey circle, when someone clicks it once, it'd change to a blue circle
      > > > > (update associated DB field to "blue"), click it again and it becomes
      > > > > a red circle (update the DB field to "red") and so on. So users keep
      > > > > clicking until they get the right color, then move on to the next
      > > > > one.
      >
      > > > > I've seen something similar in Google where you can star emails with
      > > > > different stars.
      >
      > > > > Any idea how you'd do this?
      > > > > It's got me stumped.
      
      

      [jQuery] Re: Click multiple times, different states, saves different data to DB (confusing?)

      2009-10-22 Thread mkmanning
      
      Well, if you just want to loop through the array to change the
      background color, you don't really need toggle then. Try this:
      
       $("#item_list > li > div > a").click(function(){
        var arrValues = ['rgb(9, 128, 0)','rgb(0, 255, 255)','rgb(0, 0,
      255)','rgb(128, 0, 128)'],
        bgcolor = $.inArray($(this).css('background-color'),arrValues)+1;
        $(this).css('background-color',arrValues[bgcolor===arrValues.length?
      0:bgcolor]);
      });
      
      disclaimer: just wrote it inside Firebug's console, so haven't tested
      it outside that...
      
      On Oct 21, 10:14 pm, The Danny Bos  wrote:
      > Thanks, had a good read, figured it out in part.
      > Now I'm stuck trying to introduce an array to do my bidding ...
      > Example below.
      >
      > The array is an example of how I want to loop through to use those
      > values.
      > Underneath is the perfect code for clicking an Anchor and changing its
      > BGcolour differently each time.
      >
      > Any ideas?
      >
      > $(document).ready(
      >         function(){
      >                 var arrValues = ['green','aqua','blue','purple'];
      >
      >                 $("#item_list > li > div > a").toggle(
      >                 function(){
      >                         $(this).css('background-color', 'green');
      >                 }, function() {
      >                         $(this).css('background-color', 'aqua');
      >                 }, function() {
      >                         $(this).css('background-color', 'blue');
      >                 }, function() {
      >                         $(this).css('background-color', 'purple');
      >                 });
      >
      > });
      >
      > On Oct 22, 3:46 am, mkmanning  wrote:
      >
      >
      >
      > > .toggle() allows you to rotate through multiple functions, you might
      > > want to check it out in the 
      > > docs:http://docs.jquery.com/Events/toggle#fnfn2fn3.2Cfn4.2C...
      >
      > > On Oct 21, 2:58 am, The Danny Bos  wrote:
      >
      > > > I've got one for ya, JQuery and Ajax.
      >
      > > > I want to have a button image, let's stay it's inactive state it's a
      > > > grey circle, when someone clicks it once, it'd change to a blue circle
      > > > (update associated DB field to "blue"), click it again and it becomes
      > > > a red circle (update the DB field to "red") and so on. So users keep
      > > > clicking until they get the right color, then move on to the next
      > > > one.
      >
      > > > I've seen something similar in Google where you can star emails with
      > > > different stars.
      >
      > > > Any idea how you'd do this?
      > > > It's got me stumped.