[jQuery] return values

2009-10-23 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: find the row nuber clicked of the item list

2009-10-23 Thread frank

Thanks a lot!

This is what I was looking for


On Oct 23, 12:14 am, MorningZ morni...@gmail.com wrote:
 Check out .index():

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

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

 On Oct 22, 4:21 pm, frank frankp...@gmail.com 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:

  html
    head
      script type=text/javascript src=jquery-1.3.2.min.js/script
      script type=text/javascript
          $(document).ready(function(){
              $(ls).click(function () {
                 var i = $( what must i type to get the clicked row
  number here??);
                 console.log(i);
              });
          });
      /script
  /head
      body
        ul
            lsFirst br/ls
            lsSecond br/ls
            lsThird br/ls
            lsForth br/ls
        /ul
      /body
  /html

  Best Regards
  Frank Pauw


[jQuery] Re: Inline Datepicker Help

2009-10-23 Thread Keith

1) Within the onSelect function, 'this' refers to the input field. So
you can find the field's position using standard jQuery: $(this).offset
(). Then place your popup of events accordingly.

2) You can use the beforeShowDay setting to highlight dates. This is a
function that takes a date and returns an array with the first entry
being true if selectable, false if not, and the second entry being a
CSS class to apply. For example:

$(selector).datpicker({beforeShowDay: function(date) {
  return [true, hasEvents(date) ? 'starred' : ''];
});


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

2009-10-23 Thread Satyakaran

I used the slide slow and found that a block is coming and
disappearing on left-bottom side.
you should try to stop them coming completely.
Google's Page-speed is very easy to use tool for website performance.
Give it a chance.


--
http://www.satya-weblog.com
On Oct 22, 7:54 pm, FranktheTank frankbirchstu...@gmail.com 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.

 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: Update element when changes

2009-10-23 Thread jchambers


This will work.

$(input[type='text']:order).keyup( function() {
var v = $(this).val().replace(/\D/g,'');  // removes non numbers
$('#total_buyed').val( v * 2.75 );
});


Good luck,
Jon


[jQuery] Re: toggleClass with Duration

2009-10-23 Thread Richard D. Worth
On Fri, Oct 23, 2009 at 12:02 AM, TH Lim ssh...@gmail.com wrote:


 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?


!$(#console).is(:animated)  $(#console).toggleClass('red', 2000);

This will cause the click that occurs during the animation to do nothing,
but will prevent your element from getting into a state where it can no
longer be toggle with a duration.

If you have any further questions about jQuery UI Effects, please post to
the jQuery UI list:

http://groups.google.com/group/jquery-ui

Thanks.

- Richard


[jQuery] Re: Synthax problem

2009-10-23 Thread Richard D. Worth
You can set the $.ajax option async to false. See

http://docs.jquery.com/Ajax/jQuery.ajax#options

but note the warning:

By default, all requests are sent asynchronous (i.e. this is set to true by
default). If you need synchronous requests, set this option to false. Note
that synchronous requests may temporarily lock the browser, disabling any
actions while the request is active.

Because JavaScript is single-threaded, you have to choose between locking
the browser (synchronous) or having your result come through a callback
function, like success (asynchronous).

- Richard

On Thu, Oct 22, 2009 at 3:55 PM, fabbx fab.creatix...@gmail.com wrote:


 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] Re: jquery.com plugin directory

2009-10-23 Thread Richard D. Worth
Good news. See

http://ralphwhitbeck.com/2009/09/16/jQueryConference2009Summary.aspx

So what was announced at jQuery Conference regarding the jQuery project?
...
3. Announced a revamped and simplified plugin repository. This is jQuery
teams number one priority and is targeted to for release by end of year.
...


- Richard

On Thu, Oct 22, 2009 at 7:49 PM, JMan jbeck...@gmail.com wrote:


 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] Re: superfish xml again

2009-10-23 Thread n0yes

Tnx. I fixed the problem. It was superfish for older version of
Joomla.
I posted my question here 'cause there is a referral at superfish
page. I quote:

Support for the Superfish plugin is available through the jQuery
Mailing List. Post a message to it with the word “Superfish” somewhere
in the subject line. I watch the list closely and will try to help you
as soon as possible. There are many other Superfish users on the list
who may be able to help you also. This is a very active mailing list
to which many jQuery developers and users subscribe.

On Oct 16, 3:07 pm, Charlie charlie...@gmail.com wrote:
 superfish is jQuery( javascript) and CSS that performs on html markup. Any 
 xml related to it would be part of Joomla and have nothing to do with 
 superfish script or the superfish css.
 Suggest researching this on joomla forums as it's totally non related to 
 anything jQuery or to do with superfish functionality
 n0yes wrote:I'm having install superfish problems, says the xml is missing. I 
 found this post: I'm a newbie and can't install the zipfile superfish 1.4.8 
 using the joomla install function. I keep getting an error message stating 
 that the xml.is missing. Do you have any suggestions how I might be able 
 to install this file? But not the reply. ... So, please, where can I get the 
 xml file?


[jQuery] clone and append elements across window in IE Bug

2009-10-23 Thread mike

I have a parent window.  The parent window creates a child window.
I then want to clone an element from the parent window, and then
append the clone to the child window.
I can get this to work in Firefox, but not in IE.  I hear that IE has
some restriction where you can't move elements across documents (i.e.
across windows or frames).

Can someone suggest a work around or shed some light to this?

Thank you.


[jQuery] Re: Secure login

2009-10-23 Thread David Cornish

Facing the same challenge, the best I could come up with was:

* Client gets a (session-based) nonce from the web server
* Password is combined with the nonce and then hashed
* Using JSON-P, send the request by GET to the login script over HTTPS
with username  the hash
* Server checks the hash matches the hash of the password + the nonce
and sends a JSON response indicating success/fail and other login info

HTTPS gives you the encryption; the nonce gives some protection from
the URI being stolen (GET will include the password hash in the URI),
by making it session specific

This only works if the server has access to the full user password; if
only a hash of the password is stored, then this won't work

David

On Oct 22, 5:31 pm, Kovács Gábor mach3...@gmail.com wrote:
 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] Please help me..Its Urgent

2009-10-23 Thread jishnu123




 Hai friends,

In my project i have implement jQuery using auto complete
and some other UI functionalists.But i am facing a big problem in  our
project ie,  with out internet all jQuery functionalists  cannot working..I
had find out the exceptions Whenever accessing the jQuery functionalists
directly accessing the google  API through google sites. 

The main problem is all jQuery functionalities need for one of the external
google api scripts as follows.

script type=text/javascript src=http://www.google.com/jsapi;/script

My question is how to implement jQuery functionalists with out using the
above google api scripts... 
-- 
View this message in context: 
http://www.nabble.com/Please-help-me..Its-Urgent-tp26020975s27240p26020975.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] cross domain getJSON nothing happens

2009-10-23 Thread jayQuery

hi all,

I'm new to this group, and after doing a lot (and I mean a LOT) of
searching, I can't find an answer for my problem:

I'm basically trying to do a simple $.getJSON, and the setup is
simple:

Firefox 3.5 MacOSX, latest jQuery (1.3.2)

the json file named myjson.json (I've reduced its contents to its
minimum for testing purposes and it validates in JSONLint):
{result: true}

The javascript:
$.getJSON('http://site1:/myjson.json', {}, function(data) { alert
(data.result); })

I'm testing it in a local server (MAMP), and the code above works as
expected.

The problem is when I place the query that contains the callback (?
format=jsoncallback=?), as I understand correctly, this is the way to
get cross domain json:

$.getJSON('http://site1:/myjson.json?format=jsoncallback=?', {},
function(data) { alert(data.result); })

It doesn't show the alert, either when in my local server or in an
outside server.

By looking at the firebug console/net panel, I can see that the
response + json are correct, but the alert simply doesn't happen...
All this because of the cross domain query.

I've tried all the other ways ($.ajax(), $.get(), $.post()) and after
adding the callback query nothing happens!
I've even tryed adding the ( ) and doing an eval, but nothing...
Anything I put inside the function(data) {} is ignored.

help please...


[jQuery] Re: Please help me..Its Urgent

2009-10-23 Thread sreehari ojili
why don't u include jquery.js in the project it self..
dowload from Jquery and include it in project.

-Sreehari Ojili.


On Fri, Oct 23, 2009 at 10:37 AM, jishnu123 rjis...@gmail.com wrote:





  Hai friends,

In my project i have implement jQuery using auto complete
 and some other UI functionalists.But i am facing a big problem in  our
 project ie,  with out internet all jQuery functionalists  cannot working..I
 had find out the exceptions Whenever accessing the jQuery
 functionalists
 directly accessing the google  API through google sites.

 The main problem is all jQuery functionalities need for one of the external
 google api scripts as follows.

 script type=text/javascript src=http://www.google.com/jsapi;/script

My question is how to implement jQuery functionalists with out using the
 above google api scripts...
 --
 View this message in context:
 http://www.nabble.com/Please-help-me..Its-Urgent-tp26020975s27240p26020975.html
 Sent from the jQuery General Discussion mailing list archive at Nabble.com.




[jQuery] Re: clockpicker plugin doesn't show

2009-10-23 Thread -null-

nvm, figured it out.


[jQuery] Re: Swaping background image error only in IE7

2009-10-23 Thread Eyveneena


Excellent!

Karl Swedberg-2 wrote:
 
 
 Hi Mixen,
 
 Looks like the problem is that you've misplaced a semicolon. Note the  
 difference between this ...
 $(this).css({'background-image':url('ico/ico_shout_o.gif');})} );
   and this...
 $(this).css({'background-image':url('ico/ico_shout_o.gif')});});
 
 I'm a big fan of the .hover() method, because it handles event  
 bubbling issues for you and it encapsulates both mouseover and  
 mouseout. Also -- this is purely personal preference -- I like to  
 avoid using quotation marks when they aren't absolutely necessary. It  
 makes things look cleaner. So, I would write your lines like this:
 
$('#shoutbox_title .ico2').hover(function() {
  $(this).css({backgroudImage: 'url(ico/ico_shout_o.gif)'});
}, function() {
  $(this).css({backgroudImage: 'url(ico/ico_shout_n.gif)'});
});
 
 That said, an image sprite approach almost always makes more sense.  
 Use a single image for both states. Then, change the background  
 position rather than the image. This way you get one less server  
 request and you avoid the slight lag that often occurs the first time  
 you hover (because the swap image has to load). If the elements you're  
 hovering over are links, I strongly recommend that you do the whole  
 thing with CSS (you can do the whole thing with CSS regardless of the  
 hovered image if you don't care about IE 6).
 
 Hope that helps.
 
 --Karl
 _
 Karl Swedberg
 www.englishrules.com
 www.learningjquery.com
 
 
 
 On Jan 16, 2008, at 10:12 PM, mixen wrote:
 

 hi

 i have anerror when i try to swap background images, it works fine in
 firefox, safari, opera but in IE7, i get this :
 Line : 907
 Char : 30
 Error : Invalid Argument
 Code : 0
 URL : http://localhost/mixen/www

 that happens as soon as i move my mouse over the image to swap it. my
 jquey code is imply two line changing the background-image property in
 my css :

 $(#shoutbox_title .ico2).mouseover( function(){$
 (this).css({'background-image':url('ico/ico_shout_o.gif');})} );
 $(#shoutbox_title .ico2).mouseout( function(){$
 (this).css({'background-image':url('ico/ico_shout_n.gif');})} );

 the css for the element is :

  .ico2 {
  width: 18px; height: 14px;
  background-color: transparent;
  background-image: 
 url(../../ico/ico_shout_n.gif);
  background-repeat: no-repeat;
  background-position: top left;
  }

 What am i doing wrong? And if theres an easier way to swap image, ill
 appreciate the share because i've just started coding in jQuery and
 i'm kind of new to all these stuff.
 Thanks for the help!
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Swaping-background-image-error-only-in-IE7-tp14916870s27240p26025702.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: cross domain getJSON nothing happens

2009-10-23 Thread Mike Alsup

 the json file named myjson.json (I've reduced its contents to its
 minimum for testing purposes and it validates in JSONLint):
 {result: true}

 The javascript:
 $.getJSON('http://site1:/myjson.json', {}, function(data) { alert
 (data.result); })

 I'm testing it in a local server (MAMP), and the code above works as
 expected.

 The problem is when I place the query that contains the callback (?
 format=jsoncallback=?), as I understand correctly, this is the way to
 get cross domain json:

 $.getJSON('http://site1:/myjson.json?format=jsoncallback=?', {},
 function(data) { alert(data.result); })

 It doesn't show the alert, either when in my local server or in an
 outside server.

 By looking at the firebug console/net panel, I can see that the
 response + json are correct, but the alert simply doesn't happen...
 All this because of the cross domain query.

 I've tried all the other ways ($.ajax(), $.get(), $.post()) and after
 adding the callback query nothing happens!
 I've even tryed adding the ( ) and doing an eval, but nothing...
 Anything I put inside the function(data) {} is ignored.


Both of these methods work fine for me:

$.getJSON('http://site1:/myjson.json?format=jsoncallback=?',
function(data) {
alert(data.result);
});


$.ajax({
url: 'http://site1:/myjson.json?format=json',
dataType: 'jsonp',
success: function(data) {
alert(data.result);
}
});


[jQuery] Problems with Ajax and caching

2009-10-23 Thread Magnus O.

Hi!

I'm creating a ajax call like this:

jQuery.ajax({ url: http://urltopage/?callback=callbackhandler;,
dataType: json, type: GET, cache: true, callback: null, data:
null });

I then have a callbackhandler function like this:

function callbackhandler(data){
do something here
}

The response from the server is actually a json-p like callbackhandler
(myjsonobject) but I'm using this type of ajax requst to be able to
use client caching. If I use $.json() the request will get a ?
callback=randomstring which will diable client caching.

Now to my problem. Sometimes, and only sometimes, this does not work.
I do not get a js error or ajax error but a requst is never made. This
problem only occurs when using caching. If I set cache to false it
works 100%.

Any one that could understand why this happens? How do I cache cross
domain json-p calls with jquery?

//Magnus


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

2009-10-23 Thread Richard D. Worth
How bout an old version of jQuery UI then? If you're using jQuery v1.3.2
make sure you're not using a jQuery UI version older than 1.7

- Richard

On Thu, Oct 22, 2009 at 11:20 AM, Maxime FAYE maxime.f...@gmail.com wrote:

 Nope :

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


 2009/10/22 Ariel Flesler afles...@gmail.com

 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 maxime.f...@gmail.comwrote:

 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 += 'div id=' + sDialogId + '' + \n;
 sDialog += 'Please select at least one action';
 sDialog += '/div' + \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 afles...@gmail.com


 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 maxime.f...@gmail.com 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: cross domain getJSON nothing happens

2009-10-23 Thread jayQuery

thanks for the reply, but it gave me an invalid label with my json,
which as I've read before, can be solved by eval'ing it with the
parenthesis:
var myObj = eval( ( + someJsonString + ) );

but after eval'ing, nothing happens (again), no alert :(
In firebug I can see the json is there...


 Both of these methods work fine for me:

 $.getJSON('http://site1:/myjson.json?format=jsoncallback=?',
 function(data) {
         alert(data.result);

 });

 $.ajax({
         url: 'http://site1:/myjson.json?format=json',
         dataType: 'jsonp',
         success: function(data) {
                 alert(data.result);
         }

 });


[jQuery] how to paste image into a web app

2009-10-23 Thread Margie

I have a web app (front end jquery, backend django) that allows users
to type commens into a text area.  My users are asking for the ability
to cut and paste images into their comments.  They want to use an
windows app called mwsnap to basically snap images from their desktop,
then ctrl-v to copy the image into my django app.  Does anyone know
what sort of client side support is needed to do this?  I am fairly
adept at jquery/javascript, but haven't seen anything like this though
it does seem like a very reasonable request since they are certainly
able to cut and paste into Outlook this way.  However, when I try to
cut and paste this way into yahoo mail or gmail it doesn't work, so
perhaps this is a hard thing to do in a web app.  Can anyone give me a
pointer on how this could be done or if it can be done?

Thanks,

Margie


[jQuery] Re: how to paste image into a web app

2009-10-23 Thread Jonathan Vanherpe (T T NV)


Margie wrote:


I have a web app (front end jquery, backend django) that allows users
to type commens into a text area.  My users are asking for the ability
to cut and paste images into their comments.  They want to use an
windows app called mwsnap to basically snap images from their desktop,
then ctrl-v to copy the image into my django app.  Does anyone know
what sort of client side support is needed to do this?  I am fairly
adept at jquery/javascript, but haven't seen anything like this though
it does seem like a very reasonable request since they are certainly
able to cut and paste into Outlook this way.  However, when I try to
cut and paste this way into yahoo mail or gmail it doesn't work, so
perhaps this is a hard thing to do in a web app.  Can anyone give me a
pointer on how this could be done or if it can be done?

Thanks,

Margie


That doesn't work on the web. The best thing you can do is use something 
like CKeditor and a seperate image upload system that handles rescaling 
of images and stuff.


Maybe you could do this with a Java applet (that's Java, not 
Javascript), but I haven't seen anything like that anywhere so far.


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


[jQuery] Event Bubbling

2009-10-23 Thread Jaggi

Hi, trying to organise some code on a large project i'm doing which
changes alot of code around the page with submit forms. As jQuery
doesn't have a live support for submit elements i thought i'd try my
hand at event bubbling. It works nicely in firefox but isn't working
at all in ie so i thought someone could give me a pointers.

[code]
$('#data').submit( function(e) {
/* When a edit form is selected */
if (e.target.className == 'edit_link')
{
//ajax request
}
});
[/code]

i have a div with an id #data inside this div is a table with data and
forms at the end of each of the row to edit parameters. When i click
edit it loads a form in another div outside the #data one via ajax
then the user can change the values and hit update (which has a class
of .edit_link ) at which point it should reload the #data div. The
reloading of the #data div is why i need some sort of live event to
it. I've tried doing the way above and it works great in firefox but
not in ie so anyhelp would be cool. Just to clearify the submit
doesn't fire at all.


[jQuery] Re: cross domain getJSON nothing happens

2009-10-23 Thread MorningZ

See if this reply i made yesterday helps you out at all

http://groups.google.com/group/jquery-en/browse_thread/thread/1525b2d017246957?hl=en#




On Oct 23, 9:23 am, jayQuery xaudio...@yahoo.co.uk wrote:
 thanks for the reply, but it gave me an invalid label with my json,
 which as I've read before, can be solved by eval'ing it with the
 parenthesis:
 var myObj = eval( ( + someJsonString + ) );

 but after eval'ing, nothing happens (again), no alert :(
 In firebug I can see the json is there...

  Both of these methods work fine for me:

  $.getJSON('http://site1:/myjson.json?format=jsoncallback=?',
  function(data) {
          alert(data.result);

  });

  $.ajax({
          url: 'http://site1:/myjson.json?format=json',
          dataType: 'jsonp',
          success: function(data) {
                  alert(data.result);
          }

  });


[jQuery] Re: cross domain getJSON nothing happens

2009-10-23 Thread jayQuery

didn't help...

the strange thing is that if I don't use jsonp (by using the callback
query), it works locally. But obviously won't work when in a cross
domain environment.

On Oct 23, 2:37 pm, MorningZ morni...@gmail.com wrote:
 See if this reply i made yesterday helps you out at all

 http://groups.google.com/group/jquery-en/browse_thread/thread/1525b2d...



[jQuery] Re: cross domain getJSON nothing happens

2009-10-23 Thread MorningZ

the strange thing is that if I don't use jsonp (by using the callback
query), it works locally. But obviously won't work when in a cross
domain environment. 

It's not as easy as putting callback=? in the url.. you have to wrap
the JSON you are generating in a function name so that jQuery can
process it when it gets the response...

cross domain jsonp absolutely for sure works, but you are not
implementing it correctly... maybe show more code and what Firebug
shows the response to be?


On Oct 23, 9:50 am, jayQuery xaudio...@yahoo.co.uk wrote:
 didn't help...

 the strange thing is that if I don't use jsonp (by using the callback
 query), it works locally. But obviously won't work when in a cross
 domain environment.

 On Oct 23, 2:37 pm, MorningZ morni...@gmail.com wrote:

  See if this reply i made yesterday helps you out at all

 http://groups.google.com/group/jquery-en/browse_thread/thread/1525b2d...


[jQuery] Re: cross domain getJSON nothing happens

2009-10-23 Thread jayQuery

I see what you mean...

I thought it was that simple...
So I should generate my json via a server-language (like php) and echo
that callback as in the post you refered?
I'll try that and keep you posted.

On Oct 23, 3:22 pm, MorningZ morni...@gmail.com wrote:
 the strange thing is that if I don't use jsonp (by using the callback
 query), it works locally. But obviously won't work when in a cross
 domain environment. 

 It's not as easy as putting callback=? in the url.. you have to wrap
 the JSON you are generating in a function name so that jQuery can
 process it when it gets the response...

 cross domain jsonp absolutely for sure works, but you are not
 implementing it correctly... maybe show more code and what Firebug
 shows the response to be?

 On Oct 23, 9:50 am, jayQuery xaudio...@yahoo.co.uk wrote:

  didn't help...

  the strange thing is that if I don't use jsonp (by using the callback
  query), it works locally. But obviously won't work when in a cross
  domain environment.

  On Oct 23, 2:37 pm, MorningZ morni...@gmail.com wrote:

   See if this reply i made yesterday helps you out at all

  http://groups.google.com/group/jquery-en/browse_thread/thread/1525b2d...


[jQuery] Re: cross domain getJSON nothing happens

2009-10-23 Thread Mike Alsup

 I thought it was that simple...
 So I should generate my json via a server-language (like php) and echo
 that callback as in the post you refered?
 I'll try that and keep you posted.

Yes.  Something like:

?php
header('Content-type: application/json');
$cb = $_GET[callback];
echo $cb . ({ 'result': 'success' });
?


[jQuery] Re: cross domain getJSON nothing happens

2009-10-23 Thread MorningZ

I'm a .NET guy and don't know the syntax for PHP, but maybe I could
put it in plain terms

- variable CallBackName = value of callback (which jQuery will
replace ? with jsonpNNN where NN is a timestamp just to be
random

- variable MyResults is an object that is expressed in a JSON string
(i know that it's easy to write/convert-to JSON in php but I don't
know the specifics)

- If there is a CallBackName value, then write out
   CallBackName( my JSON result )
  otherwise, just write out
   my JSON result

So in html if i had

$.getJSON(local_call.php, ..)

i'd return from the server

{ foo: 1, bar: 2}

but if i had

$.getJSON(http://remoteserver/local_call.php?callback=?;, ..)

jQuery would replace ? with something like jsonp2345654345, so my
code would return

jsonp2345654345( { foo: 1, bar: 2} )

the example on the jQuery docs under .getJSON (using Flickr) is a
great thing to read and the article @ IBM that is inside my
previous link is an excellent overview as well. once you
understand how it works, that makes it easy   :-)


On Oct 23, 10:27 am, jayQuery xaudio...@yahoo.co.uk wrote:
 I see what you mean...

 I thought it was that simple...
 So I should generate my json via a server-language (like php) and echo
 that callback as in the post you refered?
 I'll try that and keep you posted.

 On Oct 23, 3:22 pm, MorningZ morni...@gmail.com wrote:

  the strange thing is that if I don't use jsonp (by using the callback
  query), it works locally. But obviously won't work when in a cross
  domain environment. 

  It's not as easy as putting callback=? in the url.. you have to wrap
  the JSON you are generating in a function name so that jQuery can
  process it when it gets the response...

  cross domain jsonp absolutely for sure works, but you are not
  implementing it correctly... maybe show more code and what Firebug
  shows the response to be?

  On Oct 23, 9:50 am, jayQuery xaudio...@yahoo.co.uk wrote:

   didn't help...

   the strange thing is that if I don't use jsonp (by using the callback
   query), it works locally. But obviously won't work when in a cross
   domain environment.

   On Oct 23, 2:37 pm, MorningZ morni...@gmail.com wrote:

See if this reply i made yesterday helps you out at all

   http://groups.google.com/group/jquery-en/browse_thread/thread/1525b2d...


[jQuery] Re: cross domain getJSON nothing happens

2009-10-23 Thread jayQuery

nice one!

this was the missing thing in my logic, I thought it was just a simple
call to a file, but I know now that that file has to be generated
according to the query.

thanks to all the replies!


[jQuery] Re: loading message shows up after page has loaded

2009-10-23 Thread sdtacoma

Hey JMan,

CFFlush was my first attempt at doing this. It worked great, did
exactly what I wanted it to do but it stopped my CFLocation tags from
working (as documented).

AJAX might be the way to go. I was hoping to roll this loading...
message out system wide. Going the AJAX route would create a lot more
work for me though.







On Oct 21, 5:50 pm, JMan jbeck...@gmail.com wrote:
 I think there is a bit of confusion here as to how Coldfusion works.
 By default the Coldfusion server will return the generated HTML all at
 once. So if you have a long query your not going to get even the first
 bit of the document until the CF server is done with it. What your
 asking your .js to do is when the page begins to load show a loading
 image and when it's done hide it. Well Coldfusion will give your the
 entire document at once, even if there is a huge grid with data in it
 you get all of it at once after CF is done creating it and chances are
 if you have a fast connection even if the document weight is up there
 your not going to get the behavior your looking for.

 The reason it works with your images is because they take a bit longer
 to download and they download after the document has been served from
 the CF server. The markup returned from the server tells the browser
 where to load the images from. What you need to do is have the CF
 server stream the document to you as it generates it. This can be done
 using the cflush tag.

 http://cfquickdocs.com/cf8/?getDoc=cf#cfflush

 if you use this properly you can start sending the headers and stuff
 to the client browser right away and your .js being in the head of the
 document should execute as well.

 The other trick would be to use AJAX to load your query result and
 inject it into the page or pass it to some data handling .js. With
 AJAX you can use the events that fire before the request begins and
 after it completes to toggle a neat-o loading image.

 HTH

 On Oct 21, 8:17 pm, Rick Faircloth r...@whitestonemedia.com wrote:

  Mike!  Crawl back under your rock, you fathead!!!

  There...how's that? :o)

  Rick

  -Original Message-
  From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On

  Behalf Of Mike Alsup
  Sent: Wednesday, October 21, 2009 7:51 PM
  To: jQuery (English)
  Subject: [jQuery] Re: loading message shows up after page has loaded

   Hope that helps.

   --Karl

  Bah, this is getting entirely too civil.  Snooze...  :-)


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

2009-10-23 Thread bc04Inc.

Noone an idea how to solve that?

Thank you

On 22 Okt., 15:46, bc04Inc. bc04...@googlemail.com wrote:
 So here is the function:

 script type=text/javascript
         (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('div/div');
     var $toc = $('body div:last');

     var lastLevel = 1;

     $toc.append('ul class=jquery-toc-1/ul');

     $elements.each(function() {
       var $e = $(this);
       var text = $e.text();
       var anchor = text.replace(/ /g,'-');

       $e.before('a name=' + anchor + '/a');

       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 = 'lia href=#' + anchor + '' + text + '/a/li';

       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 class=' + className + '/ul');
         $('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');
           });
         /script

 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 m...@amosdesigns.net 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. bc04...@googlemail.com
  To: jQuery (English) jquery-en@googlegroups.com
  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] Re: loading message shows up after page has loaded

2009-10-23 Thread sdtacoma

Dude! I think you might have gotten it working. This seems to work on
my end...

http://meded.ucsd.edu/testQuery.cfm





On Oct 21, 4:45 pm, Karl Swedberg k...@englishrules.com wrote:
 yeah, I see it now. And I see the problem: div id=uiblocker/div  
 doesn't appear in the HTML until about line 94,030. You can't block  
 the UI with a div that isn't there, and if you're running your query  
 before you load the div, then it's not going to help much.

 Take a look at this page now:http://test.learningjquery.com/testquery.html
 (notice I removed the setTimeout)

 Here's some html that you can copy and paste. Just replace the comment  
 with the query:

 !DOCTYPE html
 html lang=en
 head
 meta http-equiv=Content-Type content=text/html; charset=utf-8
    titleblock ui /title
    script type=text/javascriptdocument.documentElement.className =  
 'js';/script
    style type=text/css
      #uiblocker {
        display: none;
      }

      .js #uiblocker {
        display: block;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        position: fixed;
        cursor: wait;
        z-index:1001;
        text-align: center;
        line-height: 200px;
        background: #ddd url(ajax-loader.gif) no-repeat 50% 50%;
      }
    /style

    script src=http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.js
  type=text/javascript/script

    script type=text/javascript
      $(window).bind('load', function() {
         $('#uiblocker').fadeOut();
      });

    /script
 /head
 body
   div id=uiblocker/div

    !-- RUN YOUR QUERY HERE --

 /body
 /html

 Hope that helps.

 --Karl

 
 Karl Swedbergwww.englishrules.comwww.learningjquery.com

 On Oct 21, 2009, at 11:22 AM, sdtacoma wrote:



  Yes that is the correct link.

  I copied your example page and added a query to it...

 http://meded.ucsd.edu/testQuery.cfm

  On Oct 15, 2:02 pm, Karl Swedberg k...@englishrules.com wrote:
  Hi Josh,

  Now I'm really confused. Did you post the wrong link? This is what I
  see in the head:

  meta http-equiv=Content-Type content=text/html; charset=utf-8 /
  titleUntitled Document/title
  script language=javascript type=text/javascript src=/
  jquery_1.2.4b.js/script
  script language=javascript type=text/javascript src=/
  jquery.blockui.js/script
  script type=text/javascriptdocument.documentElement.className =
  'js';/script
  script
  $(document).ready(function() {
              $.blockUI();
                  $(window).load(function(){unBlockFunction(); });});

  function unBlockFunction(){
          $.unblockUI();}

  /script

  Still trying to use blockUI? What happened to the styles?

  This script should be the first one, right after title:
  script type=text/javascriptdocument.documentElement.className =
  'js';/script

  Also, div id=uiblocker/div should be in the html, right after
  the opening body tag and before your queries.

  --Karl

  On Oct 15, 2009, at 4:31 PM, sdtacoma wrote:

  Hi Karl,

  I believe/hope I did everything that you asked. Problem still
  exists...

 http://meded.ucsd.edu/testQuery.cfm

  I do appreciate your help!

  Josh

  On Oct 14, 11:04 am, Karl Swedberg k...@englishrules.com wrote:
  Wow, easy there Karl. I was just showing you working examples of  
  the
  issue I was experiencing.

  easy there? I was just trying to help. You showed examples that
  didn't
  include my suggestions, after we had already established that your
  first attempts were not going to work.

  Your
  code does not actually wait for the data to finish loading. It
  merely
  unblocks the UI after a period of time. This is not what I want. I
  want the UI to become unblocked after the page is done loading,  
  not
  after a certain period of time passes.

  Exactly. That's why I wrote this...

  Note that I added a setTimeout inside the $(window).load()
  function
  to
  simulate a heavy page.

  It was a demonstration, since I didn't have your queries at my
  disposal. Feel free to remove the setTimeout. The $
  (window).bind('load', fn) part should be telling the script to wait
  until everything is fully loaded before it executes the code inside
  it
  (  $('#uiblocker').fadeOut();  )

  Again, the issue I am having is that the UI is not blocked when
  running queries on the page, one when static content is loading.

  I'm not sure what's going on with your queries. I did notice some  
  odd
  stuff, though, when I looked at what was actually coming to the
  browser inhttp://meded.ucsd.edu/testKarl2.cfm:

  1. You have this :

  link rel=stylesheet type=text/css 
  href=http://meded.ucsd.edu/meded/meded.css
   before

  before this :

  !DOCTYPE html

  Can you try putting that styesheet reference inside head ?

  2. I doubt this will make a difference, but try putting this line:
  script type=text/javascriptdocument.documentElement.className =
  'js';/script
  directly after the title and before you load any styles or other
  scripts

  3. you have a style tag inside the 

[jQuery] Ajax example needed

2009-10-23 Thread Jim Byrnes


I am struggling with ajax and jquery.  I wonder if someone could point 
me to a simple yet comprehensive example of getting rows from a mysql 
database and displaying them in a html table.  Using php on the server 
and jquery on the client.


Thanks,  Jim


[jQuery] Re: how to paste image into a web app

2009-10-23 Thread Margie

Interesting.  That seems so backwards!   I guess maybe the best
solution for now  is to have people paste it into Outlook and then
mail their comment into the system.

It really seems like if we (development community) are going to be
writing web apps that have a look and feel of stand alone apps that
this is very basic gotta-have functionality.

I have explored a couple rich text editors, but found them to be a bit
too much for what my users want.  Maybe something needs to actually
be built into the browser (ie, like a firefox plugin) to accept the
paste?


Margie

On Oct 23, 6:31 am, Jonathan Vanherpe (T  T NV) jonat...@tnt.be
wrote:
 Margie wrote:

  I have a web app (front end jquery, backend django) that allows users
  to type commens into a text area.  My users are asking for the ability
  to cut and paste images into their comments.  They want to use an
  windows app called mwsnap to basically snap images from their desktop,
  then ctrl-v to copy the image into my django app.  Does anyone know
  what sort of client side support is needed to do this?  I am fairly
  adept at jquery/javascript, but haven't seen anything like this though
  it does seem like a very reasonable request since they are certainly
  able to cut and paste into Outlook this way.  However, when I try to
  cut and paste this way into yahoo mail or gmail it doesn't work, so
  perhaps this is a hard thing to do in a web app.  Can anyone give me a
  pointer on how this could be done or if it can be done?

  Thanks,

  Margie

 That doesn't work on the web. The best thing you can do is use something
 like CKeditor and a seperate image upload system that handles rescaling
 of images and stuff.

 Maybe you could do this with a Java applet (that's Java, not
 Javascript), but I haven't seen anything like that anywhere so far.

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


[jQuery] How to build this effect

2009-10-23 Thread Andrea - Aosta

At this URL http://www.smsbig.it/it you see an effect build with
mootools.
THis js change the css style of the background when the mouse
moved.With jquery it is possible?
Thank you


[jQuery] how to set array value????

2009-10-23 Thread jacob

hello?

Today, I have met something odd experience during developing web
application based on Ruby on Rails and Jquery.

When I set some value by next code,
jQuery('#branch_address').val(address_val);
it seems to work as I expected. Because the value that I set by
jQuery's 'val' function appear on the chrome browser and other
browsers as well.

input type=text name=branch[address] id=branch_address /

But when I submit the form, I got the null value from the perspective
of server side.

I suspect this problem could be caused by the hash array like 'brach
[address]' but I can't verify the reason due to lack of my knowledge
about jQuery and javascript.

I expect anyone who have more experience to the jQuery and javascript
than me give some tip or any guide to me to overcome this obstacle.

looking forward for many knowledgeable people to consider this
problem.

Thanks a lot.


[jQuery] Re: cross domain getJSON nothing happens

2009-10-23 Thread Chris

Hi, I was perusing the group looking to help a colleague with a
similar problem.

One thing I noticed here, and maybe this has no bearing at all, was
the difference between the syntax in the first two posts:

jayQuery wrote:

$.getJSON('http://site1:/myjson.json?format=jsoncallback=?', {},
function(data) { alert(data.result); })

Mike Alsup wrote:

$.getJSON('http://site1:/myjson.json?format=jsoncallback=?',
function(data) {
alert(data.result);

});

Those are different from one another. jayQuery passes an empty set of
braces as second argument to getJSON, whereas Mike's passes the data
function as the 2nd argument. Also, jay's overall wrapper function is
not closed with a semicolon.

Not sure if it has any bearing at all, just noting that one says his
works and the other says his doesn't, but they are different.


On Oct 23, 8:47 am, Mike Alsup mal...@gmail.com wrote:
  the json file named myjson.json (I've reduced its contents to its
  minimum for testing purposes and it validates in JSONLint):
  {result: true}

  The javascript:
  $.getJSON('http://site1:/myjson.json', {}, function(data) { alert
  (data.result); })

  I'm testing it in a local server (MAMP), and the code above works as
  expected.

  The problem is when I place the query that contains the callback (?
  format=jsoncallback=?), as I understand correctly, this is the way to
  get cross domain json:

  $.getJSON('http://site1:/myjson.json?format=jsoncallback=?', {},
  function(data) { alert(data.result); })

  It doesn't show the alert, either when in my local server or in an
  outside server.

  By looking at the firebug console/net panel, I can see that the
  response + json are correct, but the alert simply doesn't happen...
  All this because of the cross domain query.

  I've tried all the other ways ($.ajax(), $.get(), $.post()) and after
  adding the callback query nothing happens!
  I've even tryed adding the ( ) and doing an eval, but nothing...
  Anything I put inside the function(data) {} is ignored.

 Both of these methods work fine for me:

 $.getJSON('http://site1:/myjson.json?format=jsoncallback=?',
 function(data) {
         alert(data.result);

 });

 $.ajax({
         url: 'http://site1:/myjson.json?format=json',
         dataType: 'jsonp',
         success: function(data) {
                 alert(data.result);
         }

 });


[jQuery] url of ajax response?

2009-10-23 Thread Jack Bates

I make a request with jQuery.ajax(), to which the server responds with
302 Found and a Location: ... header

A second request to the new URL is then made automatically

In my JavaScript, I need to know the new URL, but can't figure out
how : (

I don't think I can get the value of the Location: ... header
because XHR getResponseHeader() doesn't return headers from the first
response, only the second

I tried listening to onreadystatechange, but at no point did
getResponseHeader() return the Location: ... header

I can't figure out how else jQuery or XHR expose the URL

I know the original URL, it was the value I passed to jQuery.ajax(),
but don't think I can get the URL from which the response was finally
requested?


[jQuery] Plugin has slow response in IE8 ...

2009-10-23 Thread Joel Taylor

Hi everyone,
I'm wondering if someone could take a quick look at this slightly
modified plugin that I'm using on a site. It seems to work fine in
most browsers, but in IE8 it's real jittery.

It's a plugin that works pretty much the same as jqZoom.

Any help would be greatly appreciated.

http://joelataylor.com/test/jquery.bezoom.js.txt


[jQuery] Re: Events Calendar

2009-10-23 Thread brian

On Thu, Oct 22, 2009 at 7:21 PM, Andri 4r53...@gmail.com wrote:

 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?


That's not what the datepicker plugin is for. To create a calendar of
existing dates, you'd need to build the table yourself. Normally, this
would be done using server-side logic (eg. PHP) and a database table
for the event dates.


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

2009-10-23 Thread Maxime FAYE
OK i'll check this and i'll keep you posted :)

2009/10/23 Richard D. Worth rdwo...@gmail.com

 How bout an old version of jQuery UI then? If you're using jQuery v1.3.2
 make sure you're not using a jQuery UI version older than 1.7

 - Richard


 On Thu, Oct 22, 2009 at 11:20 AM, Maxime FAYE maxime.f...@gmail.comwrote:

 Nope :

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


 2009/10/22 Ariel Flesler afles...@gmail.com

 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 maxime.f...@gmail.comwrote:

 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 += 'div id=' + sDialogId + '' + \n;
 sDialog += 'Please select at least one action';
 sDialog += '/div' + \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 afles...@gmail.com


 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 maxime.f...@gmail.com 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: how to set array value????

2009-10-23 Thread James

Which server-side programming language are you using?

On Oct 23, 6:22 am, jacob ygpa...@gmail.com wrote:
 hello?

 Today, I have met something odd experience during developing web
 application based on Ruby on Rails and Jquery.

 When I set some value by next code,
 jQuery('#branch_address').val(address_val);
 it seems to work as I expected. Because the value that I set by
 jQuery's 'val' function appear on the chrome browser and other
 browsers as well.

 input type=text name=branch[address] id=branch_address /

 But when I submit the form, I got the null value from the perspective
 of server side.

 I suspect this problem could be caused by the hash array like 'brach
 [address]' but I can't verify the reason due to lack of my knowledge
 about jQuery and javascript.

 I expect anyone who have more experience to the jQuery and javascript
 than me give some tip or any guide to me to overcome this obstacle.

 looking forward for many knowledgeable people to consider this
 problem.

 Thanks a lot.


[jQuery] Re: cross domain getJSON nothing happens

2009-10-23 Thread MorningZ

and maybe this has no bearing at all

it has zero bearing.

in the code (which $.getJSON calls):

get: function( url, data, callback, type ) {
// shift arguments if data argument was ommited
if ( jQuery.isFunction( data ) ) {
callback = data;
data = null;
}



On Oct 23, 11:02 am, Chris ccshan...@gmail.com wrote:
 Hi, I was perusing the group looking to help a colleague with a
 similar problem.

 One thing I noticed here, and maybe this has no bearing at all, was
 the difference between the syntax in the first two posts:

 jayQuery wrote:

 $.getJSON('http://site1:/myjson.json?format=jsoncallback=?', {},
 function(data) { alert(data.result); })

 Mike Alsup wrote:

 $.getJSON('http://site1:/myjson.json?format=jsoncallback=?',
 function(data) {
         alert(data.result);

 });

 Those are different from one another. jayQuery passes an empty set of
 braces as second argument to getJSON, whereas Mike's passes the data
 function as the 2nd argument. Also, jay's overall wrapper function is
 not closed with a semicolon.

 Not sure if it has any bearing at all, just noting that one says his
 works and the other says his doesn't, but they are different.

 On Oct 23, 8:47 am, Mike Alsup mal...@gmail.com wrote:

   the json file named myjson.json (I've reduced its contents to its
   minimum for testing purposes and it validates in JSONLint):
   {result: true}

   The javascript:
   $.getJSON('http://site1:/myjson.json', {}, function(data) { alert
   (data.result); })

   I'm testing it in a local server (MAMP), and the code above works as
   expected.

   The problem is when I place the query that contains the callback (?
   format=jsoncallback=?), as I understand correctly, this is the way to
   get cross domain json:

   $.getJSON('http://site1:/myjson.json?format=jsoncallback=?', {},
   function(data) { alert(data.result); })

   It doesn't show the alert, either when in my local server or in an
   outside server.

   By looking at the firebug console/net panel, I can see that the
   response + json are correct, but the alert simply doesn't happen...
   All this because of the cross domain query.

   I've tried all the other ways ($.ajax(), $.get(), $.post()) and after
   adding the callback query nothing happens!
   I've even tryed adding the ( ) and doing an eval, but nothing...
   Anything I put inside the function(data) {} is ignored.

  Both of these methods work fine for me:

  $.getJSON('http://site1:/myjson.json?format=jsoncallback=?',
  function(data) {
          alert(data.result);

  });

  $.ajax({
          url: 'http://site1:/myjson.json?format=json',
          dataType: 'jsonp',
          success: function(data) {
                  alert(data.result);
          }

  });


[jQuery] Re: return values

2009-10-23 Thread James

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

 var postlink = [];  // empty array

 $.each(entry.link, function(j, link){
  if(link.rel == self){
   // add to array
   postlink.push(link.href);
  }
 });

 alert(postlink.join(', '));
});

On Oct 22, 8:02 pm, rob rob.sche...@gmail.com wrote:
 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: How to build this effect

2009-10-23 Thread DanDan

That is cool... I have seen this before as JQuery but not yet tried
it:

http://webdev.stephband.info/parallax.html

On Oct 23, 9:46 am, Andrea - Aosta andreabe...@gmail.com wrote:
 At this URLhttp://www.smsbig.it/ityou see an effect build with
 mootools.
 THis js change the css style of the background when the mouse
 moved.With jquery it is possible?
 Thank you


[jQuery] [JQuery Plugin Validate] How to know which button is clicked

2009-10-23 Thread mathie

Hello,

I have a form with two buttons: Delete and View. A checkbox is
required for all actions. Validation happens when a button is clicked.
If it's View, it is just a normal operation. However, if it's
Delete, if the form is valid, it then needs to show a confirmation
before form submission via custom handler (submitHandler).

submitHandler: function(form) { if (confirmDelete()) { form.submit
(); } }

Problem: How do I know if the button is Edit or Delete inside
submitHandler? The function above open the dialog even for View
button.

Thanks for any suggestion.


[jQuery] Select onchange event get a value from selects table row

2009-10-23 Thread Kevin McPhail

I have a table that contains a select element like so

trtdkey value in hidden input/tdtdselectoptions/select/
td/tr

I need to set
$(selectclass).change(function() {
  //Find the value of hidden input in 1st cell of row of the select
list that was changed.
});


So when a user changes the option of the select i need to get the new
value the option has been changed to plus the value from the hidden
input and submit them via ajax to a method on the server. How can i
get the hidden inputs value?

Thanks for any help /suggestions,
kevin


[jQuery] Re: Events Calendar

2009-10-23 Thread Kevin McPhail


Actually there is a decent little jquery plugin at 
http://arshaw.com/fullcalendar/
that may be what you are looking for.


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

2009-10-23 Thread ABB

live() is exactly what i needed!

Thank you

On Oct 22, 11:49 pm, Dave Methvin dave.meth...@gmail.com wrote:
  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] Re: how to set array value????

2009-10-23 Thread brian

On Fri, Oct 23, 2009 at 3:11 PM, James james.gp@gmail.com wrote:

 Which server-side programming language are you using?

He mentioned Ruby.

Jacob, perhaps you're using the wrong key. Have you dumped the posted
vars to check? I can't remember, offhand, thesyntax for Ruby, but for
CakePHP it would be debug($this-data).


[jQuery] Re: Events Calendar

2009-10-23 Thread brian

On Fri, Oct 23, 2009 at 2:10 PM, Kevin McPhail
kevin.mcph...@adisseo.com wrote:


 Actually there is a decent little jquery plugin at 
 http://arshaw.com/fullcalendar/
 that may be what you are looking for.


That looks very smart. Thanks for the tip.


[jQuery] Re: cross domain getJSON nothing happens

2009-10-23 Thread jayQuery

My code was ok, the missing semicolon was because of the copy/paste.

The problem was due to a faulty logic on my side and calling a static
json.

After these good people gave me more insight, I understood that the
way to achieve a cross domain call to a json, the json needs to be
built dynamically, writing the callback. After I did that, I got it to
work correctly.



On Oct 23, 4:02 pm, Chris ccshan...@gmail.com wrote:
 Hi, I was perusing the group looking to help a colleague with a
 similar problem.

 One thing I noticed here, and maybe this has no bearing at all, was
 the difference between the syntax in the first two posts:

 jayQuery wrote:

 $.getJSON('http://site1:/myjson.json?format=jsoncallback=?', {},
 function(data) { alert(data.result); })

 Mike Alsup wrote:

 $.getJSON('http://site1:/myjson.json?format=jsoncallback=?',
 function(data) {
         alert(data.result);

 });

 Those are different from one another. jayQuery passes an empty set of
 braces as second argument to getJSON, whereas Mike's passes the data
 function as the 2nd argument. Also, jay's overall wrapper function is
 not closed with a semicolon.

 Not sure if it has any bearing at all, just noting that one says his
 works and the other says his doesn't, but they are different.

 On Oct 23, 8:47 am, Mike Alsup mal...@gmail.com wrote:

   the json file named myjson.json (I've reduced its contents to its
   minimum for testing purposes and it validates in JSONLint):
   {result: true}

   The javascript:
   $.getJSON('http://site1:/myjson.json', {}, function(data) { alert
   (data.result); })

   I'm testing it in a local server (MAMP), and the code above works as
   expected.

   The problem is when I place the query that contains the callback (?
   format=jsoncallback=?), as I understand correctly, this is the way to
   get cross domain json:

   $.getJSON('http://site1:/myjson.json?format=jsoncallback=?', {},
   function(data) { alert(data.result); })

   It doesn't show the alert, either when in my local server or in an
   outside server.

   By looking at the firebug console/net panel, I can see that the
   response + json are correct, but the alert simply doesn't happen...
   All this because of the cross domain query.

   I've tried all the other ways ($.ajax(), $.get(), $.post()) and after
   adding the callback query nothing happens!
   I've even tryed adding the ( ) and doing an eval, but nothing...
   Anything I put inside the function(data) {} is ignored.

  Both of these methods work fine for me:

  $.getJSON('http://site1:/myjson.json?format=jsoncallback=?',
  function(data) {
          alert(data.result);

  });

  $.ajax({
          url: 'http://site1:/myjson.json?format=json',
          dataType: 'jsonp',
          success: function(data) {
                  alert(data.result);
          }

  });


[jQuery] [JQuery Plugin - Validate] Form element was modified before and inside submitHandler

2009-10-23 Thread mathie

Does submitHandler add/modify the form element? I have a simple form
with a button and a required checkbox.

Form element outside of submitHandler:
var_dump($('#formid').get(0).myButton);
= a regular HTMLButtonElement as expected

Form element inside of submitHandler:
submitHandler: function(f) {var_dump(f.myButton);}
= become an array of two, one is HTMLButtonElement one is an empty
HTMLInputElement (with no value, which create a big problem for the
form submission)

Anyone knows enough about the internal working to clarify? Thanks.


[jQuery] Re: Update element when changes

2009-10-23 Thread ReynierPM


jchambers wrote:


This will work.

$(input[type='text']:order).keyup( function() {
var v = $(this).val().replace(/\D/g,'');  // removes non numbers
$('#total_buyed').val( v * 2.75 );
});


Good luck,
Jon



Thanks a lot, works perfectly

--
Saludos
ReynierPM


[jQuery] jQuery Plugin - validate always send the page

2009-10-23 Thread ReynierPM


Hi every:
I need to validate a form[1] before sending. For that purpose I use the 
bassistance validator plugin[2]. I wrote a small code to validate all 
elements but in some point it fails because the form is always sended. 
The code is in file pintpal.js. Can any help to find where it fails?


Cheers and thanks in advance
[1] http://jose-couto.com/pintpal4/order_pintpal.html
[2] http://bassistance.de/jquery-plugins/jquery-plugin-validation/
--
Saludos
ReynierPM


[jQuery] Re: how to set array value????

2009-10-23 Thread DanDan

I *think* you are probably right that the name of the input control is
your problem:

name=branch[address]


I wonder if your server side code is seeing the brackets escaped or
unescaped.

Can you rename the control?

On Oct 23, 9:22 am, jacob ygpa...@gmail.com wrote:
 hello?

 Today, I have met something odd experience during developing web
 application based on Ruby on Rails and Jquery.

 When I set some value by next code,
 jQuery('#branch_address').val(address_val);
 it seems to work as I expected. Because the value that I set by
 jQuery's 'val' function appear on the chrome browser and other
 browsers as well.

 input type=text name=branch[address] id=branch_address /

 But when I submit the form, I got the null value from the perspective
 of server side.

 I suspect this problem could be caused by the hash array like 'brach
 [address]' but I can't verify the reason due to lack of my knowledge
 about jQuery and javascript.

 I expect anyone who have more experience to the jQuery and javascript
 than me give some tip or any guide to me to overcome this obstacle.

 looking forward for many knowledgeable people to consider this
 problem.

 Thanks a lot.


[jQuery] clueTip display inconsistently

2009-10-23 Thread wendy.constantine

I've encountered some inconsistency in how the clue tip plugin
displays. In most cases, it works perfectly using the JTip theme, yet
when there are multiple links on a page, the links lowest on the page
almost surely do not display a tip at all (except for the standard
browser tooltip). And in some cases, the style changes entirely while
using the same class.

Here is a link to a sample document:
http://d-college.cengage.com/art/0495799874_kleiner/student/bonus/ch04/04_08A.html


In all cases, what I'm trying to accomplish is an image rollover with
title. The hrefs and parameters are all constructed the same, and
what's more puzzling is that the same href would work fine if placed
at the top of the document.

This is the jquery used:

$('a.jt:eq(2)').cluetip({
  cluetipClass: 'jtip', arrows: true,
  dropShadow: true,
  height: 'auto',
  sticky: true,
  waitImage: true,
  closeText: 'img src=../../../jscript/images/cross.png
alt=close /',
  positionBy: 'bottomTop'
});


And here's a sample href:
a class=jt href=javascript:void(0); rel=../ch03/thumbs/
0312A.jpg title=Seated statues of Rahotep and Nofret, from their
mastaba at Maidum, Egypt, Fourth Dynasty

Any help would be appreciated.
Thanks,
Wendy


[jQuery] Re: how to set array value????

2009-10-23 Thread jacob

 Can you rename the control?
No I can't. Because the control's name is automatically assigned in
the rails framework.

If I rename the control's name, it will be caused another problem I
can't properly manage the value. But I can see the value in the server
side, when I make another test controller named input
name=test_name type=text / instead of name=branch[blalbla]

I guess the server side procedure will be like this
ex) php ( even though the ruby syntax will be different, the way of
process will be same in terms of context. )
foreach (branch as $key = $value) {
// make query according to key and value pairs
// but when I meet key name address, I get the null value.
}

Furthermore, I can get the whole value exactly as I typed in the web
page except the values that I set by jQuery's 'val' method.

On 10월24일, 오전6시31분, DanDan dan.d...@gmail.com wrote:
 I *think* you are probably right that the name of the input control is
 your problem:

 name=branch[address]

 I wonder if your server side code is seeing the brackets escaped or
 unescaped.

 Can you rename the control?

 On Oct 23, 9:22 am, jacob ygpa...@gmail.com wrote:



  hello?

  Today, I have met something odd experience during developing web
  application based on Ruby on Rails and Jquery.

  When I set some value by next code,
  jQuery('#branch_address').val(address_val);
  it seems to work as I expected. Because the value that I set by
  jQuery's 'val' function appear on the chrome browser and other
  browsers as well.

  input type=text name=branch[address] id=branch_address /

  But when I submit the form, I got the null value from the perspective
  of server side.

  I suspect this problem could be caused by the hash array like 'brach
  [address]' but I can't verify the reason due to lack of my knowledge
  about jQuery and javascript.

  I expect anyone who have more experience to the jQuery and javascript
  than me give some tip or any guide to me to overcome this obstacle.

  looking forward for many knowledgeable people to consider this
  problem.

  Thanks a lot.


[jQuery] Re: Select onchange event get a value from selects table row

2009-10-23 Thread jchambers

Give this a try...


script type=text/javascript

 $(document).ready(function(){

 $('select').change(function(){
var key = $(this).parent().parent().find('input').val();
var v = $(this).val();

$('#MSG').html( key +'BR'+ v );
});

});


/script
body

table
tr
tdinput type=hidden value=key//td
tdselect id=A class=selectGroupoption value=
selected=selectedchoose/optionoption value=1one/
optionoption value=2two/option/select/td
/tr
/table

div id=MSG style=width:200px; height:100px; background-
color:#FFC/div



Good luck,
Jon


[jQuery] image preload question

2009-10-23 Thread michaelF

I'm updating my portfolio site and am using jQuery for the first time.
The site and it's contents are far from complete, but for the sake of
solving this problem I've loaded it here:

www.msfaron.com/test10/

I've set this site version to load contents via jQuery's .load method.
the files being loaded are php (html fragments containing thumbnail
images that are links to larger images).

I set up a spinner image within a hidden div that fades in when you
click one of the links below the main window (Illustration, Web
Design, Photorestoration, Caricature). The spinner then fades out when
the load is done. It's written clumsily but it works...

My problem is that I would like the spinner div to fade out AFTER all
the thumbnails have downloaded, and this is not happening. Is there a
way to make the fade wait for the thumbnail download to complete?

I apologize if this issue has been covered, but I've been trying to
find an answer for too long and need to get my site working.

Thanks
Mike F


[jQuery] jquery disturbing the others javascript ...

2009-10-23 Thread bgolfy

Hi everybody,

I'm new here and I'm not sure that this is where I have to come to
find a help ... In case I'm inthe wrong place please forgive me and
let me know wher to go.

So, I use some of javascript in my site which runs perfectly until I
use a plugin which have jquery.js in its code.
Now, In each old javascript I use where there is element.xxx, it
doesn't work anymore. I have an error like: element.tagName is
undefined, element.getStyle is not a function,
element.getInlineOpacity is not a function,...

Does someone can help me ? is it something known ?
I use jquery 1.2.3. Can I replace it by the latest version ?

Thanks,


[jQuery] listmenu

2009-10-23 Thread Rsolve

hi, first of all, great plugin

is it possible to make lm-wrapper not disappear on mouseout ?
it would be just what i need.

Thanks



[jQuery] Superfish Menu - Joomla

2009-10-23 Thread Chintu

I use Superfish Menu with Nav-Bar option on a Joomla site.  I would
like to increase the width of the second level (sub-menu) width so
that it fills up the entire width of the site template.  The reason
for doing this is quite simple, I have only 4 first level (main) menu
items but 10 second level) sub-menu items.  So what happens is that
second level menu wraps around and shows on three lines. Ideally I
would like to show all second level items on one line instead of
three.

Can someone help?

Thank you


[jQuery] Re: jquery disturbing the others javascript ...

2009-10-23 Thread James

A jQuery plug-in should not have the jQuery in its code... if so, it's
not doing it right.
Is it possible to just remove the jQuery library portion of it and
have it function as expected?
What is this plug-in if you don't mind telling us?

On Oct 23, 1:47 pm, bgolfy bgo...@gmail.com wrote:
 Hi everybody,

 I'm new here and I'm not sure that this is where I have to come to
 find a help ... In case I'm inthe wrong place please forgive me and
 let me know wher to go.

 So, I use some of javascript in my site which runs perfectly until I
 use a plugin which have jquery.js in its code.
 Now, In each old javascript I use where there is element.xxx, it
 doesn't work anymore. I have an error like: element.tagName is
 undefined, element.getStyle is not a function,
 element.getInlineOpacity is not a function,...

 Does someone can help me ? is it something known ?
 I use jquery 1.2.3. Can I replace it by the latest version ?

 Thanks,


[jQuery] Re: jquery disturbing the others javascript ...

2009-10-23 Thread Michael Geary
Post a link to a test page that illustrates the problem. Otherwise we can
only guess as to what might be wrong.

You get one guess for free, though. :-)

Do you have code on your site that uses Prototype or a similar library, e.g.

var foo = $('someElementId').tagName;

That will fail if you include jQuery, unless you use jQuery.noConflict().
See the jQuery docs for details.

If that isn't it, post the test page link and someone will be able to tell
you exactly what's wrong.

-Mike

On Fri, Oct 23, 2009 at 4:47 PM, bgolfy bgo...@gmail.com wrote:


 Hi everybody,

 I'm new here and I'm not sure that this is where I have to come to
 find a help ... In case I'm inthe wrong place please forgive me and
 let me know wher to go.

 So, I use some of javascript in my site which runs perfectly until I
 use a plugin which have jquery.js in its code.
 Now, In each old javascript I use where there is element.xxx, it
 doesn't work anymore. I have an error like: element.tagName is
 undefined, element.getStyle is not a function,
 element.getInlineOpacity is not a function,...

 Does someone can help me ? is it something known ?
 I use jquery 1.2.3. Can I replace it by the latest version ?

 Thanks,



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

2009-10-23 Thread joe

Thor I am having the exact same problem - have you found a solution??
can someone explain overflow and overflow of hidden?
poundcommapo...@gmail.com  your message is cryptic - can you
elaborate.  I am not calling the plug-in from a parent element,
unless head would be the parent element?

Joe

On Oct 20, 4:38 pm, thor bry...@gmail.com wrote:
 Hi,
 I am looking for assistance with a loading problem and my apologies if
 this is beyond the scope of this group.

 I am running the lastestjQueryandJquerycycle plugin. I haven't
 done any customization per se only trying to get the two components to
 work.  I am at the point where things seem to work, however when the
 page loads all 4 images in my DIV span down the page and then merge
 into one at the end of the page load.

 I've seen other implementation of these 2 components but the images
 don't flash first and then merge.

 Do you believe I need to create another function or put some more
 logic into my page to have it load correctly.  My goal would be to
 have everything seemlessly loaded from the start.  I've explored the
 document.ready function and believe I have it in the correct location
 of my site.  No matter what though other parts of the page load
 first

 I realize there are a lot of unknown variables but maybe someone has
 an idea?

 My site is clippervacations.com and I am going to change out the
 current homepage banners withjqueryfunctionality.  Nothing is LIVE
 right now, but perhaps someone can get an idea.

 Thanks,
 Thor


[jQuery] Storing reference to an object using jQuery.data - any problems expected?

2009-10-23 Thread jayarjo

I want to store a reference to a particular object using jQuery.data
on another object, can it potentially lead to memory leaks?

And another question. Those objects at some point are dynamically
removed and if that happens will the connection and associated data
automatically be released, or we got to do it manually?