[jQuery] Selection from a list should rewrite the page.

2010-02-23 Thread David Parker
I'm building a select from a java Resultset for a given userID.

Where the value for the options are a recordD for each record in the
Resultset.

On loading of the page, it gets a userID and recordD from session.
If recordD=null then it uses the first record from the Resultset.

So the select contains all records for a given userID and the page is
populated from data asscoiated to a recordD.

Interaction:
The user can repopulate the page by making a selection.
I makes an AJAX to a sevrlet that reset the session attribute for the
recordD.

So that when the callback() is called it triggers the page reload.

It seems trivial but it is as if the callback() is triggered before
the session is written.

I have a session and request dumper upon writing the page and I'm not
seeing the session modified.

I know the the url parameters are being built because I have an alert
to display them.

  $('#select_note').change(function() {
// Get the index of the selected item
INDEX = $("#select_note option").index($("#select_note
option:selected")) +1;
RID = $("#select_note option:selected").val();
document.getElementById("rid").value= RID;
document.getElementById("current_note").innerHTML = INDEX;
var parameters = 'rid='+ RID + '&state=<
%=AdvisorDictionary.STATE_GETRECORD%>';
var url = "<%=context%>/secure/Submit";
var GO2TAB = function (url, parameters) {
http_request = false;
if (window.HttpRequest) { // Mozilla, Safari,...
   http_request = new HttpRequest();
   if (http_request.overrideMimeType) {
  http_request.overrideMimeType('text/xml');
   }
} else if (window.ActiveXObject) { // IE
   try {
  http_request = new ActiveXObject("Msxml2.HTTP");
   } catch (e) {
  try {
 http_request = new
ActiveXObject("Microsoft.HTTP");
  } catch (e) {}
   }
}
if (!http_request) {
   alert('Cannot create XMLHTTP instance');
   return false;
}
http_request.onreadystatechange =
alert("Yes");
http_request.open('POST', url + parameters, true);
http_request.send(null);
 }
  });


[jQuery] Cycle 2.75 - containerResize not working if image isn't direct child of container

2010-02-10 Thread David Winter
Say I have:


 $(function() {
 $('.slideshow').cycle();
 });
 


 
 
 
 My caption
 

 
 My caption
 
 

I'd like for the container to resize to the largest child size, but it
doesn't look like in Safari/Chrome it can do this. It works in
Firefox, but only after a refresh of the page. I'm guessing it's to do
with the fact that the images aren't the direct child of the container
div?

Is it possible for this to work?


[jQuery] FCKEditor Plugin and Validation Plugin

2010-01-30 Thread David .Wu
http://www.fyneworks.com/jquery/FCKEditor/

The FCKEditor home page mentioned it support the Validation Plugin,
but when I use both of it, but even I type many words on the textarea
which replaced by the FCKEditor via FCKEditor Plugin, it's always
shows the error message that the field is empty, how to make it work?


Re: [jQuery] Find text. Is this possible with JQuery?

2010-01-19 Thread David Statler
If you're talking about simple find & replace, you can do it with
javascript.

http://www.w3schools.com/jsref/jsref_replace.asp



On Tue, Jan 19, 2010 at 2:38 PM, shapper  wrote:

> Hello,
>
> Is it possible with JQuery to find all words "xyz" in a text and
> replace it by "xyz"?
>
> Thanks,
> Miguel
>


Re: [jQuery] Re: jQuery 1.4 change event problem

2010-01-19 Thread David Statler
I made a quick mock up of this to try to find the problem. As you have both
stated, the problem only occurs in IE (I only tried it on IE6). However, I
rewrote the following and this works on IE6. The problem seems to occur when
you add selected="selected" to the second option value.


http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en">


Sandbox

body { background-color: #000; font: 16px Helvetica, Arial;
color: #fff; }

http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js";>

$(document).ready(function(){
$("#mySelect").change(function(){
alert($(this).find("option:selected").val());
});
});




Value 1
Value 2






On Tue, Jan 19, 2010 at 6:06 AM, pambuk  wrote:

> Same here, would love to hear an answer.
>
> On Jan 19, 11:00 am, Steven Yang  wrote:
> > Hi all
> >
> > I apologize if this problem has been post or report.
> >
> > I have a problem using jQuery 1.4 when i use
> > $("#mySelect").change(function(){...my logic...})
> >
> > This problem only occurs in IE. 6-8 all have the same problem and jQuery
> > 1.3.2 does not have this problem.
> >
> > This problem occurs when I bind a "change" event on a select and when the
> > page is loaded the selected option is not the first one.
> > What will happen is when I click on the select and not even have a chance
> to
> > choose my option, the "change" event is fired. But after the first
> change,
> > things works normally.
> >
> > i made a simple sample here:http://jsbin.com/apufa/<
> http://jsbin.com/apufa/edit>
> >
> > you will notice when you click on the select the alert will fire, but it
> > should only be fired when i actually change the option.
> >
> > is this a bug?
> >
> > Thanks
>


[jQuery] jQuery 1.4 cross domain post bug?

2010-01-15 Thread David P
I have a webservice sitting on my https server that accepts the POST
verb and responds with some JSON.
If I build a simple html form like

https://myserver.com/myWS";>





it will return the correct json data, with content type "application/
json", and the browser will ask to save the result. When I look at the
data it is 100% correct

if I try to access it with jquery using
$.post("https://myserver.com/myWS";, { emailAddress: "a...@a.com",
password: "uk" }, function(data) { alert("hi!"); }, "json");

the call back will never execute.  When I check firebug, in the net
panel, I can see the call go out (first the OPTIONS call which
completes successfully, then the POST) however I cannot view the
actual results.  In the Console panel, the call is in red so firebug
thinks there is some kind of error.

Is there something I'm missing with how to handle cross domain POSTs
that return json data?


[jQuery] I saw the post out at Klaus Hartl's blog. (see below) And it is very close to the question that I have.

2010-01-14 Thread David Parker
I saw the post out at Klaus Hartl's blog.  (see below) And it is
very close to the question that I have.
I'm new to the jQuery sytax and terminology.
I'm a Java/Javascript web application programmer here at
University of Wisconsin-Madison.

Our apps are run from a java servlet server. Each tab calls a
sevlet (i.e. <%=context%>/secure/Browse) that renders the html for the
container.
1. What we want to do is also trigger an Ajax request and have the
response be returned to another tab.
2. Or just be able to trigger a tab change from inside the content
without the trip to the server.

I'm reading the documention and finding it difficult to understand
some of the terminology and syntax of jQuery.

Is ther any sample code that would demonstrate the building of the
anchors that I could reverse engineer to understand the processing?
If someone has a functional site with this type of navigation I
would be interested is seeing the HTML.

Sincerely
David Parker




Advisor Notes

<%  String context = request.getContextPath();  %>






  $(function(){ $('#an_tabs').tabs();   });



  body{ font: 9pt sans-serif; margin: 0px;}
  #an_container {float: left;width: 400px;  }
  #an_tabs li {font-size: 8pt;  }





  

  Browse
  Create
  Search
  Preferences

  





Thanks alot. This is great.

The only thing that concerns them is the fact that all the content
lies on one page (for SEO and PPC reasons they want multiple pages)
Is there a way to load external pages (either .asp or .html) into
the tab?

Thanks so much for this great release.

Keonne

Comment by Keonne, October 26th, 2007 at 2:50 pm

Author Comment

Keonne, yes, that’s easy! Just put such links instead of a
fragment identifier into the href attribute of the anchors.
The plugin recognizes the type of a tab and will load the content
via Ajax (I usually call them “remote tabs”).
You can even have both types side by side.

It’ll also degrade gracefully with JavaScript disabled. The link
takes you to the proper page.



[jQuery] AJAX calls timeout

2010-01-13 Thread David
Hi,

I had a problem with an AJAX post call.

The problem was, some times it returned data, and some times it
didn't. It had nothing to do with domain server crossing, nor server
errors,
as it some times worked and some times it doesn't.

What I found was, it worked most of the times in a high bandwith
connection (enterprise bandwith). But when I tried it with low band
connections, most of
the times it did not work. The function did not receive any data from
the server.
I checked the server when it happened, and the server always did the
task and returned data. It was as if the data got lost in the
response.

Then, I configured AJAX calls using AJAXsetup to check what was the
problem. Just like this:

$.ajaxSetup({
   error:function(request, error){

   if(request.status == 0){
   alert('You are offline!!\n Please Check
Your Network.');
   }
   else if(request.status == 404){
   alert('Requested URL not found.');
   }
   else if(request.status == 500){
   alert('Internal Server Error.');
   }
   else if(error == 'parsererror'){
   alert('Error.\nParsing Request
failed.');
   }
   else if(error == 'timeout'){
   alert('Request Time out.');
   }
   else{
   alert('Unknow Error.
\n'+request.responseText);
   }
   }
   });

I found I was getting timeouts from post ajax calls. So I have setted
the timeout property in AJAXsetup with a timeout value.

Now my question is, which is the default timeout jQuery AJAX calls are
using if you don't specify any timeout?


Thanks ins advanced.


[jQuery] Latest JQuery File

2009-12-23 Thread David Matchoulian
Dear jQuery Guys,
I downloaded the latest file, and when i opened it in dreamweaver and
scrolled through the code i noticed that half the code is colored
blue, that is half the code is considered "string", i tryed to fix it
myself but i didn't since i was afraid that i might ruin the code.
What is the solution for this problem?
Thank you


[jQuery] Wrap question

2009-12-20 Thread David .Wu
I want to make a div


become
12346789

This is my solution, but I want to ask for better one.

/**
* Wrap Table
*/
(function() {
$.fn.dramaWrapTable = function($obj) {
var $tbl = '12346789';
return this.each(function() {
$(this)
.before($tbl)
.clone(true)

.prependTo($(this).prev().find('td').eq(4))
.end()
.end()
.remove();
});
}
})(jQuery)


$(function() {
$('#myDiv').dramaWrapTable();
});



[jQuery] customize uplodify

2009-12-16 Thread David .Wu
http://www.uploadify.com/
This is the best jQuery upload plugin I ever used, I want to add one
function when upload

jQuery(queue).append('\
  
  \
  .
  ..

I add a input field in it's js code, and I hope the value will be send
with the file when uploading, is it doable?


Re: [jQuery] FadeOut > Ajax Post > FadeIn problem

2009-12-12 Thread David Day


Oops!  Make that... otherwise you get nested divs. 


$("#menuJ a").click(function(){
var js = $(this);
$("#pageArticle").fadeOut(500, function()
{
  $.post( js.attr("href"), null, function(response)
  {
$("#pageArticle").html(response);
$("#pageArticle").fadeIn(500);
  },
  "html");
});
return false;
});


Re: [jQuery] FadeOut > Ajax Post > FadeIn problem

2009-12-12 Thread David Day


Thanks Brian

The working script is as follows:

$("#menuJ a").click(function(){
 var js = $(this);
 $("#pageArticle").fadeOut(500, function()
 {
   $.post( js.attr("href"), null, function(response)
   {
 var bob = "" + response + "";
 $("#pageArticle").html(bob);
 $("#pageArticle").fadeIn(500);
   },
   "html");
 });
 return false;
});

There is still a point after fade out the div collapses to nothing, 
creating a flashing effect, but the fade in is now working predictably.

Thanks for your assistance.


[jQuery] jquery validator pugin question of validating 2 depending fields with remote validation (attached example)

2009-12-09 Thread david
I have the following example:
I have 2 text fields country and city. For each field i want to check
with a remote validation if the city matches the country and vice
versa.
i made the following dummy html page





jQuery.validator.addClassRules({
country_city:{
remote: {
url  : '<a  rel="nofollow" href="http://long">http://long</a> url/validate_country_city.cgi',
type : 'post',
data: {
country: function() {
return $('input[name=country]').val();
  },

city: function() {
return $('input[name=city]').val();
  }

}
   }
   }
});
$(document).ready(function() {
$('form').validate();
});




Country:
City 




now in the country i write austria and in the city i write washington.
I will have in both fields errors as washington is not in austria, so
i change to vienna. then the city line is cleaned of errors, but the
country line not. The problem is that the country validation should
also be triggered by changing the city.
Maybe i make errors in how using the validator.
Is there another way to solve the problem ?

Thanks,
David


[jQuery] [validate] remote validations with two depending text boxes

2009-12-06 Thread david
Hi all,

I have a for two text boxes. They are one entity for a check. I check
the two text boxes together. I made it in the following way that i
added for both of them one class and added a rule. My problem is the
following. I have text-box a and textbox b. For a certain value of
textbox a textbox b shouldn't be empty. So i fill in the text-box a
and the remote validation works, and an error message is shown. When
afterward i fill an value in text-box b, the error message from
textbox a does not go away, which is bad.
What can i do ?

Thanks ,
David


[jQuery] [validate] remote validation on empty field

2009-12-06 Thread david
Hi all,

I want to make a remote validation on an empty field. Sometimes the
field may be empty and sometimes not. This depends on the selection of
other elements. I send them with the data hash of the remote method.
The response should be written next to the empty field.
As i understand, by default an empty field is not validated(this is a
feature), but how may i force the plugin to make it ?

Thanks,
David


[jQuery] Ajax response back question

2009-12-01 Thread David .Wu






$(function() {
$('li').each(function() {
var $id = $(this).attr('id');
$.post('getImg.php', {id: $id}, function($data) {
// How to do it?
});
});
});

I want to let each li use ajax load their own image and put into
thierself, the result shold like below, but if I user $.post, I don't
know how to put it to the right li.







Re: [jQuery] Re: simple jquery form plugin question

2009-11-26 Thread David
Thank you very much Kelly!
You solved my problem.

On Thu, Nov 26, 2009 at 12:59 AM, Kelly  wrote:

> Hi David,
> I was able to recreate the same problem and fixed it. Try this:
> 
> 
> jQuery Form Plugin
> 
> form { background: #DFEFFC; border: 5px solid #c5dbec; margin: 10px 0;
> padding: 20px }
> 
> 
> 
> 
>
> // wait for the DOM to be loaded
>$(document).ready(function() {
>// bind 'myForm' and provide a simple callback function
>$('#myForm').ajaxForm(function() {
>alert("Thank you for your comment!");
>});
>});
>
> 
> 
> 
> 
>   Name:
>  
>
> 
> 
> 
>
> - replace action="http://jquery.malsup.com/form/dummy.php"; with:
> action="dummy.php"  [just create a text file with dummy text in it,
> name it 'dummy.php' and put in same directory as your test HTML file]
> - remove the extra pair of script tags- you nested your script inside two pairs of
> tags - just remove one pair.
>
> Other than that, just make sure the path to your .js files is correct,
> as Brian suggested.
>


[jQuery] simple jquery form plugin question

2009-11-25 Thread David
Hi,

Just started using jquery and it looks really good!
I have question regarding the jQuery form plugin.

I tried to get the simplest example I could up and running but I ran
into a wall.
In the example when I press submit, I expect an alert box to appear
but I only get directed to the url that
is on the form's action. I expect to stay on the same page.

any help is greatly appreciated.
David



jQuery Form Plugin

form { background: #DFEFFC; border: 5px solid #c5dbec; margin: 10px 0;
padding: 20px }




 <script type="text/javascript">
// wait for the DOM to be loaded
$(document).ready(function() {
// bind 'myForm' and provide a simple callback function
$('#myForm').ajaxForm(function() {
alert("Thank you for your comment!");
});
});




http://jquery.malsup.com/form/dummy.php";
id="myForm">
  Name:
  





[jQuery] Can't get image's dimension under a hidden object

2009-11-19 Thread David .Wu
1.

$(window).load(function() {
alert($('#img1').width());
});

2.



$(window).load(function() {
alert($('#img2').width());
});

case 1 can get the dimension, but case 2 can't, how to get it?


[jQuery] Can't get the image width

2009-11-19 Thread David .Wu
1.

alert($('#img1').width());

2.



alert($('#img2').width());

case 1 can get the width of the image, but case 2 will fail, how to
solve this problem?



[jQuery] slider question

2009-11-18 Thread David .Wu
http://www.switchonthecode.com/tutorials/using-jquery-slider-to-scroll-a-div

If use jQuery slider directly, the handle box will not fit the slider
track
but in that website, it's totally fit the slider, and I didn't see
anything particular in his code
how to do that?


[jQuery] AJAX post problem

2009-11-12 Thread David
Hi,

I have a problem with an AJAX call. It's a long time since a got it. I
don't know how to deal with it. I have made tests and I don't know why
it's happening.

I have a post AJAX call. Just like next one:

$.post(MY_SCRIPT, { db_id: selected_data},
function(data){

...

});

The problem is, some times it returns data, and some times it doesn't.
I have test it with FF and Chrome, it doesn't mater the browser.
It has nothing to do with domain server crossing, nor server errors,
as it some times works and some times it doesn't.

What I have found is, it works most of the times in a high bandwith
connection (enterprise bandwith). Buit when I try it at home, most of
the times it does not work. The function does not receive any data
from the server.

I have checked the server when it happens, and the server returns
data. It is as if the data got lost in the response.

Eventually, I've used HttpFox FF extension and I've got some extra
information.

The post call is aborted. I got next message using HttpFox extension:

Method: post
Time: 0.451
Result: Aborted
Type: NS_BINDING_ABORTED

The post callback function is never called in low bandwith. It only
has to receive an
XML document which is around 3/11 KBytes


[jQuery] Re: button value change

2009-11-12 Thread David pr
Thanks but this won't work for a   ?

David


[jQuery] Re: post AJAX no response

2009-11-12 Thread David
Hi,

I'm back again with this AJAX post problem.

I've used HttpFox FF extension and I've got some extra information.

The post call is aborted. I got next message using HttpFox extension:

Method: post
Time: 0.451
Result: Aborted
Type: NS_BINDING_ABORTED

This happens when I use a low band internet connection. When I used a
high band connection the problem doesn't come up.

The post callback function is never called. It only has to receive an
XML document which is around 3/11 KBytes

On 8 oct, 19:50, David  wrote:
> Hi Doug,
>
> yes, I am sure the data loads correctly, as this post call is
> requested once you select an option in a select list.
> I have an alert message just before the post call and I can see the
> 'selected_data' parameter.
> In fact, as I have said, the request is well done, as the server sends
> the output. The point is this data does not get to the browser.
>
> Thanks Doug.
>
> On 8 oct, 20:45, "Knight, Doug"  wrote:
>
>
>
> > Hi David,
> > Do you have your call inside a $(document).ready? It may be that in a high 
> > bandwidth environment your data loads completely before your call is 
> > triggered, whereas in a low bandwidth environment your page has the chance 
> > to finish loading before the data makes it to your call.
>
> > My two cents,
> > Doug
>
> > -Original Message-
> > From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On 
> > Behalf Of David
> > Sent: Thursday, October 08, 2009 2:40 PM
> > To: jQuery (English)
> > Subject: [jQuery] post AJAX no response
>
> > Hi,
>
> > I have a problem with an AJAX call. It's a long time since a got it. I
> > don't know how to deal with it. I have made tests and I don't know why
> > it's happening.
>
> > I have a post AJAX call. Just like next one:
>
> > $.post(MY_SCRIPT, { db_id: selected_data},
> >                         function(data){
>
> >                 ...
> > });
>
> > The problem is, some times it returns data, and some times it doesn't.
> > I have test it with FF and Chrome, it doesn't mater the browser.
> > It has nothing to do with domain server crossing, nor server errors,
> > as it some times works and some times it doesn't.
>
> > What I have found is, it works most of the times in a high bandwith
> > connection (enterprise bandwith). Buit when I try it at home, most of
> > the times it does not work. The function does not receive any data
> > from the server.
>
> > I have checked the server when it happens, and the server returns
> > data. It is as if the data got lost in the response.
>
> > I don't know what to do, as I don't know where the problem is.
>
> > Thanks


[jQuery] button value change

2009-11-11 Thread David pr
Hello,

I had an More details
$(this).text($(this).text() == 'More details' ? 'Hide details' : 'More
details');

and on click I changed the text from more to hide

I had to change the 

How do I change the value text on click ?

David






[jQuery] Re: .hide and .show div's

2009-11-11 Thread David pr
Thank you all i've (you guys) crack it.


[jQuery] .hide and .show div's

2009-11-11 Thread David pr
Hello,

Could you help me please. I have a list of hotel which I .hide
and .show div's to show more or less info.

so i have



when the user press a button I use the code
var Hcode = $(this).attr("custom");
 $('div.Hide-' + Hcode).toggle();

but when the page loads how do I hide this div automatically ?

I have used

for (i = 0; i <= 70; i++)
{
   $("div.Hide-BAT" + i).hide();
}

But its slow and probably not the best way to do it ?

Hope you can help and this makes sense.

Regards

David



[jQuery] licensing question

2009-10-29 Thread David Robertson
I really like your software and software based on it, but I can't use it
because of the language used in your licensing, according to our patent
attorney.

It reads

under both MIT and GPL licenses. This means that you can choose the
license that best suits your project, and use it accordingly.

If it read "under either the MIT or GPL licenses" then you would have
achieved the intent of your second sentence.  Any chance you could
change it?

-David Robertson


[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  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] jqueryui's sortable and Flash

2009-10-20 Thread David

Hi,

I've spend an insane amount of time on this issue but can't find a
solution, hopefully someone else has encountered (and solved) it.

I've created a simple  list, with a bunch of .  One of the
 is actually a Flash object that has its own event handlers for
mouse clicks.  However, the jquery's handlers always take precedence.
When I try to interact with the flash object, it instantly becomes a
draggable object.

I've (unsuccessfully) tried to:
- unblind click handlers for the Flash object -> $
('flash_object').unbind('click');
- bind a new click handler to the Flash object -> $
('flash_object').click(function(event) {event.stopImmediatePropagation
();})

I also tried various combinations of HTML tricks, no luck.
Thanks for your expertise!


[jQuery] Re: Cycle plugin: centering images of variable width?

2009-10-18 Thread David Collins

Thanks for the reply, Mike.  It never occurred to me to cycle
something other than the actual image.  I will take a look at this
approach.

-David


[jQuery] Cycle plugin: centering images of variable width?

2009-10-17 Thread David Collins

I didn't see this as an option, so I decided to give it a try on my
own.  I was able to add some lines of code (shown with the > in the
margin below) to the jquery.cycle.js script to read in the width of
each image and center the slide within the slideshow container

// set position and zIndex on all the slides

>// read in each image's width and center it wrt the slideshow width
>   $slides.each(function(i){
>   var imgwidth = $(this).attr("width");
>   $(this).css('left', (opts.width-imgwidth)/2);
>   });


$slides.css({position: 'absolute', top:0}).hide().each(function(i)
{  // removed the "top" value since it is being defined above
var z = first ? i >= first ? els.length - (i-first) : first-i :
els.length-i;
$(this).css('z-index', z)
});


This works great for images that are pre-defined in the markup, but
when I use the addSlide option, the newly added slides do not get
modified in the above code.  Any suggestions on where I can put this
chunk of code so that it gets run *after* the slides are added to the
slideshow?  Should I get the img width and define the left position
for each slide during the actual cycle function, or maybe during the
"// reset common props before the next transition" section?

Any help would be appreciated.

Thanks,

-David


[jQuery] FF "needs a moment" to calculate element width()

2009-10-17 Thread David Balažic

Hi!

I have some scripting foo where I add some element dynamically and the
want to query the width of it.

NOTE: The reason I want width is for centering. If anyone knows a way
to center a DIV element without knowing its width, just say so and the
below problem is irrelevant. (same goes for height and vertical
centering)

It is more or less like this:

$(top.document.body).append("");
// inject a LINK element into top.document for a CSS file
then append some stuff into TB_window,
// marker 1
then call  $("#TB_window",top.document).width()


If I put an alert() at "marker 1" before the width() call, I get
different results than without.
It seems Firefox (v3.5.3) takes the opportunity while the alert is
displayed to compute
some stuff, which makes the width() result correct. If I don't use
alert(), then width()
returns s smaller value (about 30% less)  than the real one.

Funny, in IE8 there is no such problem. There the correct width is
reported.

I use JQuery 1.3.2.

I put the entire code at http://pastie.org/658921

it is called from HTML by
a href="#"
onclick="tb_show('#TB_inline?
height=332&width=590&inlineId=lb_content&modal=false',
(this.rel || false),'/stuff/css');return false;"
PopupboxNM /a  (I removed brackets in case they give problems to mail/
web programs)


Regards,
David


[jQuery] Cycle plugin: using the addSlide option for multiple slideshows on the page?

2009-10-17 Thread David Collins

I have a page that has 9 tabs of content, with each tab having its own
slideshow of about 8 images each.  I was hoping to reduce the load
time of the page by only starting with two images per slideshow, and
then using the addSlide option to add the rest.

A few questions:

1. Is this the best way to go about speeding up the page load?
2. Is there an example somewhere of how to make this work?  I used the
code from the demo on the http://jquery.malsup.com/cycle/add.html
page, and inserted some code of my own, but I obviously haven't
wrapped the correct functions with my code because I get *all* of the
images added to the first slideshow instead of to their own respective
slideshows.  Here is my code with some of the redundant sections
removed:

$(function(){
$('.slideshowbox div[id]').cycle({ // 9 matches found
width: 539,
height: 225,
timeout: 5000,
speed: 1000,
before: onBefore
});


var slidesAdded = false;
function onBefore(curr, next, opts) {
// make sure we don't call addSlide before it is defined
if (!opts.addSlide || slidesAdded) return;

$('.slideshowbox div').each(function() {  // for each slideshow 
on
the page
var i = $(this).attr('id');
if(i == "slideshow1") {
opts.addSlide('');
opts.addSlide('');
opts.addSlide('');
opts.addSlide('');
opts.addSlide('');
}
else if(i == "slideshow2") {
opts.addSlide('');
opts.addSlide('');
opts.addSlide('');
opts.addSlide('');
opts.addSlide('');
}

etc...

else if(i == "slideshow9") {
opts.addSlide('');
opts.addSlide('');
opts.addSlide('');
opts.addSlide('');
    opts.addSlide('');
}
});
slidesAdded = true;
};
});


Any advice would be helpful as I am a javascript/jquery novice.

Thanks!

-David


[jQuery] How to check is the object with the css property?

2009-10-17 Thread David .Wu




$('div').each(function() {
// How to know the div have position property or not?
});


[jQuery] Re: AJAX & callbacks: load(); $.get() and $.post() do not

2009-10-14 Thread David

Hi,

I have a related problem:

http://groups.google.com/group/jquery-en/browse_thread/thread/faf44301f4a22535/537df7c5a5b124bf?lnk=gst&q=garcia.narbona#537df7c5a5b124bf

I have just also found this:

http://groups.google.com/group/jquery-en/browse_thread/thread/4c8e4ac00ee529d2#
http://groups.google.com/group/jquery-en/browse_thread/thread/7f9ef1da3c7b6691#

I don't know if theu are all related. I hope this helps in order to
solve the problem.
I will try to make the posts suggestions and I'll comment.

Thanks.

On 14 oct, 02:43, Ninad Desai  wrote:
> I use $.post and $.ajax and it always works for me.
> Could you mention how you are passing parameters?
> That might be holding the key.
>
> Ninad
>
> On Oct 13, 2:33 pm, James  wrote:
>
> > Could you define "does not work"? Does the request get sent at all?
>
> > Without much information it's hard to help. What's in the variable
> > 'parameters' and 'register_submitCallback'?
>
> > On Oct 13, 3:22 am, alexryan  wrote:
>
> > > $.get() and $.post() functions work for me *except* when I supply a
> > > callback function as the third parameter.
> > > I can pass in exactly the same set of arguments that work for a load()
> > > function to $.get() and $.post() and they do not work.
> > > Has anyone else experienced this?
> > > If so, does anyone have a work-around?
> > > I'm using jQuery 1.3.2.
>
> > > For example ...
>
> > > This works ...
> > > $('div.status').load('/quotations/RegisterServlet', parameters,
> > > register_submitCallback);
>
> > > This does not work ...
> > > $.post('/quotations/RegisterServlet', parameters,
> > > register_submitCallback);


[jQuery] Re: post AJAX no response

2009-10-08 Thread David

Hi Doug,

yes, I am sure the data loads correctly, as this post call is
requested once you select an option in a select list.
I have an alert message just before the post call and I can see the
'selected_data' parameter.
In fact, as I have said, the request is well done, as the server sends
the output. The point is this data does not get to the browser.

Thanks Doug.

On 8 oct, 20:45, "Knight, Doug"  wrote:
> Hi David,
> Do you have your call inside a $(document).ready? It may be that in a high 
> bandwidth environment your data loads completely before your call is 
> triggered, whereas in a low bandwidth environment your page has the chance to 
> finish loading before the data makes it to your call.
>
> My two cents,
> Doug
>
>
>
> -Original Message-
> From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On 
> Behalf Of David
> Sent: Thursday, October 08, 2009 2:40 PM
> To: jQuery (English)
> Subject: [jQuery] post AJAX no response
>
> Hi,
>
> I have a problem with an AJAX call. It's a long time since a got it. I
> don't know how to deal with it. I have made tests and I don't know why
> it's happening.
>
> I have a post AJAX call. Just like next one:
>
> $.post(MY_SCRIPT, { db_id: selected_data},
>                         function(data){
>
>                 ...
> });
>
> The problem is, some times it returns data, and some times it doesn't.
> I have test it with FF and Chrome, it doesn't mater the browser.
> It has nothing to do with domain server crossing, nor server errors,
> as it some times works and some times it doesn't.
>
> What I have found is, it works most of the times in a high bandwith
> connection (enterprise bandwith). Buit when I try it at home, most of
> the times it does not work. The function does not receive any data
> from the server.
>
> I have checked the server when it happens, and the server returns
> data. It is as if the data got lost in the response.
>
> I don't know what to do, as I don't know where the problem is.
>
> Thanks


[jQuery] post AJAX no response

2009-10-08 Thread David

Hi,


I have a problem with an AJAX call. It's a long time since a got it. I
don't know how to deal with it. I have made tests and I don't know why
it's happening.

I have a post AJAX call. Just like next one:

$.post(MY_SCRIPT, { db_id: selected_data},
function(data){

...
});

The problem is, some times it returns data, and some times it doesn't.
I have test it with FF and Chrome, it doesn't mater the browser.
It has nothing to do with domain server crossing, nor server errors,
as it some times works and some times it doesn't.

What I have found is, it works most of the times in a high bandwith
connection (enterprise bandwith). Buit when I try it at home, most of
the times it does not work. The function does not receive any data
from the server.

I have checked the server when it happens, and the server returns
data. It is as if the data got lost in the response.

I don't know what to do, as I don't know where the problem is.


Thanks


[jQuery] Re: $.post cross domain first sends an OPTIONS verb?

2009-10-06 Thread David P

Were you able to find a solution to get it working in Firefox?

Thank you
david

On Oct 1, 10:25 am, Vitaly Piven  wrote:
> Hello David,
>
> I have similar problem . $.post() sends some "OPTIONS" request instead
> of expected "POST" (according to logs of web server).
>
> On 25 сен, 21:32, David P  wrote:
>
>
>
> > I use $.post like so:
>
> > $.post("http://mydomain.com/some/webservice";, $.toJSON({ emailAddress:
> > emailAddress }), callback, "json");
>
> > this works great..the response of the POST is a json string and that
> > is used in the callback..now I added https:
>
> > $.post("https://mydomain.com/some/webservice";, $.toJSON
> > ({ emailAddress: emailAddress }), callback, "json");
>
> > so it is now a cross domain post...in firebug I see that instead of
> > POST'ing like in the http case..it first is sending an OPTIONS
> > verb..why?  The webservice doesn't know how to respond to that and
> > gives a 403 forbidden...I need it to just send the POST like it did
> > when it was on the same domain...
>
> > Any insight?


[jQuery] What's different from keyCode to which?

2009-10-06 Thread David .Wu

keyCode and which will get the same value, so anything different?


$(function() {
$(window).keydown(function(e) {
console.log(e.keyCode);
console.log(e.which);
});
});



[jQuery] Slideshow inside "Accordian"

2009-10-04 Thread David Fung

Am I crazy to try this? I'm trying to see if I can put a slideshow
(any type.. I'd like to maybe just use a slideUp/slideDown shuffle of
photos onClick) in an accordian type navigation. Here's the page.

Tell me if i'm crazy, I'm new. Thanks in advance. =)

http://fromdavy.com/jtran/


[jQuery] How to print tag name

2009-09-29 Thread David .Wu

The code below show [ td ], can I got the tagName like "td"?


1


console.log($('table:first tr').find(':first-child'));


[jQuery] Re: How to combine event?

2009-09-27 Thread David .Wu

If I want to preload the image, I can use $('').attr('src',
'xxx.jpg'), how to proload cur file?

On 9月25日, 下午9時22分, Karl Swedberg  wrote:
> Hi David,
>
> You can combine events with a space in the first argument  
> of .bind(): .bind('type1 type2 type3', function(event) { /*do  
> something*/});
> Pass the event object into the anonymous function and then determine  
> which event was triggered with event.type. Here is an example:
>
> $('a#cursor')
>         .css({cursor: 'url(hand.cur), default'})
>         .click(function() {
>             return false;
>         })
>         .bind('mousedown mouseup mouseout', function(event) {
>          var myCursor = (event.type == 'mousedown') ? 'url(grab.cur),  
> default' : 'url(hand.cur), default';
>          $(this).css({cursor: myCursor});
>         });
>
> Hope that helps.
>
> --Karl
>
> 
> Karl Swedbergwww.englishrules.comwww.learningjquery.com
>
> On Sep 25, 2009, at 1:48 AM, David .Wu wrote:
>
>
>
> > event mousedown and mouseup and mouseout actually do the same thing,
> > how to combine it?
>
> > $('a#cursor')
> >        .css({cursor: 'url(hand.cur), default'})
> >        .click(function() {
> >            return false;
> >        })
> >        .mousedown(function() {
> >            $(this).css({cursor: 'url(grab.cur), default'});
> >        })
> >        .mouseup(function() {
> >            $(this).css({cursor: 'url(hand.cur), default'});
> >        })
> >        .mouseout(function() {
> >            $(this).css({cursor: 'url(hand.cur), default'});
> >        });


[jQuery] Re: How to combine event?

2009-09-27 Thread David .Wu

fantastic

On 9月25日, 下午9時22分, Karl Swedberg  wrote:
> Hi David,
>
> You can combine events with a space in the first argument  
> of .bind(): .bind('type1 type2 type3', function(event) { /*do  
> something*/});
> Pass the event object into the anonymous function and then determine  
> which event was triggered with event.type. Here is an example:
>
> $('a#cursor')
>         .css({cursor: 'url(hand.cur), default'})
>         .click(function() {
>             return false;
>         })
>         .bind('mousedown mouseup mouseout', function(event) {
>          var myCursor = (event.type == 'mousedown') ? 'url(grab.cur),  
> default' : 'url(hand.cur), default';
>          $(this).css({cursor: myCursor});
>         });
>
> Hope that helps.
>
> --Karl
>
> 
> Karl Swedbergwww.englishrules.comwww.learningjquery.com
>
> On Sep 25, 2009, at 1:48 AM, David .Wu wrote:
>
>
>
> > event mousedown and mouseup and mouseout actually do the same thing,
> > how to combine it?
>
> > $('a#cursor')
> >        .css({cursor: 'url(hand.cur), default'})
> >        .click(function() {
> >            return false;
> >        })
> >        .mousedown(function() {
> >            $(this).css({cursor: 'url(grab.cur), default'});
> >        })
> >        .mouseup(function() {
> >            $(this).css({cursor: 'url(hand.cur), default'});
> >        })
> >        .mouseout(function() {
> >            $(this).css({cursor: 'url(hand.cur), default'});
> >        });


[jQuery] $.post cross domain first sends an OPTIONS verb?

2009-09-25 Thread David P

I use $.post like so:

$.post("http://mydomain.com/some/webservice";, $.toJSON({ emailAddress:
emailAddress }), callback, "json");

this works great..the response of the POST is a json string and that
is used in the callback..now I added https:

$.post("https://mydomain.com/some/webservice";, $.toJSON
({ emailAddress: emailAddress }), callback, "json");

so it is now a cross domain post...in firebug I see that instead of
POST'ing like in the http case..it first is sending an OPTIONS
verb..why?  The webservice doesn't know how to respond to that and
gives a 403 forbidden...I need it to just send the POST like it did
when it was on the same domain...

Any insight?


[jQuery] How to combine event?

2009-09-24 Thread David .Wu

event mousedown and mouseup and mouseout actually do the same thing,
how to combine it?

$('a#cursor')
.css({cursor: 'url(hand.cur), default'})
.click(function() {
return false;
})
.mousedown(function() {
$(this).css({cursor: 'url(grab.cur), default'});
})
.mouseup(function() {
$(this).css({cursor: 'url(hand.cur), default'});
})
.mouseout(function() {
$(this).css({cursor: 'url(hand.cur), default'});
});


[jQuery] Re: Powerfull WYSIWYG editor with upload image capability

2009-09-19 Thread David D
You don't need to use ckfinker. Ckeditor 3 just needs an upload and a browse
url. You can make them in your prefered language.

David

Op 18 sep 2009 5:53 PM schreef "Rama Vadakattu" :


 you can't run CKFinder without a backend server.
http://ckfinder.com/download

Where do you store uploaded photos?
You need to store those photos at the server via back end language.

On Sep 18, 8:19 pm, Donny Kurnia  wrote: > Rama
Vadakattu wrote: > > Can any...
> Donny Kurniahttp://blog.abifathir.comhttp://hantulab.blogspot.comhttp://
www.plurk.com/user/donnykurnia


[jQuery] Re: ajax xml question

2009-09-19 Thread David .Wu

Yup, it will be correct, so weird, why does Google's character wrong.

On 9月18日, 下午7時44分, lanxiazhi  wrote:
> you may request the a.php directly in the browser ,and see if the charactors
> display correctly.
> 2009/9/18 David .Wu 
>
>
>
>
>
> > it's not work actually.
>
> > On 9月18日, 下午6時19分, lanxiazhi  wrote:
> > > Now you will need to change the header:
> > > header('Content-Type: text/xml; charset=UTF-8');


[jQuery] Re: ajax xml question

2009-09-18 Thread David .Wu

it's not work actually.

On 9月18日, 下午6時19分, lanxiazhi  wrote:
> Now you will need to change the header:
> header('Content-Type: text/xml; charset=UTF-8');


[jQuery] Re: ajax xml question

2009-09-17 Thread David .Wu

As the matter of fact, I execute the weather.php like weather.php?
weather=1
and the character was right, so the problem is happend when ajax
delivery.

On 9月18日, 下午2時39分, "David .Wu"  wrote:
> I am using utf-8 too.
>
> On 9月18日, 下午2時27分, Steven Yang  wrote:
>
> > I think you might have to check the encoding that google is usingI think
> > google should be using UTF-8. check the encoding on your side.
>
> > On Fri, Sep 18, 2009 at 2:11 PM, David .Wu  wrote:
>
> > > But I got one more question
> > >http://www.google.com/ig/api?hl=zh-tw&weather=Changhua
> > > This is the weather condition that response by my language, and the
> > > value become garbage characters exclude English, any solution?
>
> > > On 9月18日, 下午2時06分, "David .Wu"  wrote:
> > > > terrific!!! thanks a lot
>
> > > > On 9月17日, 下午5時57分, lanxiazhi  wrote:
>
> > > > > specify content type to xml:
>
> > > > > header("Content-type: text/xml");
> > > > > if ($_GET['weather']) {
> > > > > ...


[jQuery] Re: ajax xml question

2009-09-17 Thread David .Wu

I am using utf-8 too.

On 9月18日, 下午2時27分, Steven Yang  wrote:
> I think you might have to check the encoding that google is usingI think
> google should be using UTF-8. check the encoding on your side.
>
> On Fri, Sep 18, 2009 at 2:11 PM, David .Wu  wrote:
>
> > But I got one more question
> >http://www.google.com/ig/api?hl=zh-tw&weather=Changhua
> > This is the weather condition that response by my language, and the
> > value become garbage characters exclude English, any solution?
>
> > On 9月18日, 下午2時06分, "David .Wu"  wrote:
> > > terrific!!! thanks a lot
>
> > > On 9月17日, 下午5時57分, lanxiazhi  wrote:
>
> > > > specify content type to xml:
>
> > > > header("Content-type: text/xml");
> > > > if ($_GET['weather']) {
> > > > ...


[jQuery] Re: ajax xml question

2009-09-17 Thread David .Wu

But I got one more question
http://www.google.com/ig/api?hl=zh-tw&weather=Changhua
This is the weather condition that response by my language, and the
value become garbage characters exclude English, any solution?

On 9月18日, 下午2時06分, "David .Wu"  wrote:
> terrific!!! thanks a lot
>
> On 9月17日, 下午5時57分, lanxiazhi  wrote:
>
> > specify content type to xml:
>
> > header("Content-type: text/xml");
> > if ($_GET['weather']) {
> > ...


[jQuery] Re: ajax xml question

2009-09-17 Thread David .Wu

terrific!!! thanks a lot

On 9月17日, 下午5時57分, lanxiazhi  wrote:
> specify content type to xml:
>
> header("Content-type: text/xml");
> if ($_GET['weather']) {
> ...


[jQuery] ajax xml question

2009-09-16 Thread David .Wu

This is the source code that I want to get the weather from Google
API, Firefox, Safari, Opera will work, but IE can't get the value, so
I did some test, and I found the reason

xml structure in php page
$.get({"a.php"}, '', function() {}, "html"); // all browser work
besides IE
$.get({"a.php"}, '', function() {}, "xml"); // all browser not work

xml structure in xml page
$.get({"a.xml"}, '', function() {}, "html"); // all browser work
$.get({"a.xml"}, '', function() {}, "xml"); // all browser work

How to make IE accept xml that the file extension name is not xml?

http://www.google.com/ig/api?
weather=Taipei');
exit;
}
?>

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


weather









$(function() {
$('#btn').click(function() {
$.get('weather.php?weather=1', '', function(data) {
$('#res').html($(data).find('current_conditions').find
('condition').attr('data'));
});
});
});



[jQuery] Re: Changing the slider value programatically

2009-09-14 Thread David Garthe

Left this out accidentally:

I have this on the modal box page being called:






But this does not change the


[jQuery] Changing the slider value programatically

2009-09-14 Thread David Garthe

How do I reset a slider value after it has been declared from a
calling page?

I have a modal box, that has a form in it.  I use this form to add/
edit items.  Within that form, I have a slider from jquery UI.  When I
click on a link to bring up the modal box and EDIT data, I'm having
trouble populating the slider with the appropriate value.  Anyone know
how?  THANKS IN ADVANCE!

Here is the relevant code from my files:

MAIN PAGE:






MODAL FORM PAGE:







[jQuery] Re: simpleModal question. PLEASE HELP!

2009-09-09 Thread David Garthe
Worked perfectly!  Thanks Eric!



On Sep 9, 2:28 pm, Eric Martin  wrote:
> David,
>
> The problem is being caused by the data you are trying to place in the
> modal. You can fix it by wrapping the data in a div before using it in
> the modal:
>
> $(document).ready(function() {
>         [snip]
>                 $.get("form.cfm", function(data){
>                         // create a modal dialog with the data
>                         var d = $("").append(data);
>                         $(d).modal({
>         [snip]
>
> });
>
> -Eric
>
> On Sep 9, 11:17 am, David Garthe  wrote:
>
> > Hi,
>
> > I hope someone is familiar with simpleModal.  I'm trying to add some
> > effects to the popup, but keep getting errors when I add my "onOpen"
> > parameter.  Here's my code.  Thank!
>
> >         $(document).ready(function() {
> >             $('#create-user').click(function(e) {
> >                         e.preventDefault();
> >                         // load the contact form using ajax
> >                         $.get("form.cfm", function(data){
> >                                 // create a modal dialog with the data
> >                                 $(data).modal({
> >                                         overlay:80,
> >                                         overlayCss: 
> > {backgroundColor:"#cc"},
> >                                         overlayClose: true,
> >                                         position: [e.pageY,e.pageX],
>
> >                                         onOpen: function(dialog) {
> >                                                 
> > dialog.overlay.fadeIn('fast', function() {
> >                                                         dialog.data.hide();
> >                                                         
> > dialog.container.fadeIn('fast', function() {
> >                                                                 
> > dialog.data.slideDown('fast');
> >                                                         });
> >                                                 });
> >                                         }
>
> >                                 });
> >                         });
> >                 });
> >         });

[jQuery] simpleModal question. PLEASE HELP!

2009-09-09 Thread David Garthe

Hi,

I hope someone is familiar with simpleModal.  I'm trying to add some
effects to the popup, but keep getting errors when I add my "onOpen"
parameter.  Here's my code.  Thank!


$(document).ready(function() {
$('#create-user').click(function(e) {
e.preventDefault();
// load the contact form using ajax
$.get("form.cfm", function(data){
// create a modal dialog with the data
$(data).modal({
overlay:80,
overlayCss: {backgroundColor:"#cc"},
overlayClose: true,
position: [e.pageY,e.pageX],

onOpen: function(dialog) {
dialog.overlay.fadeIn('fast', 
function() {
dialog.data.hide();

dialog.container.fadeIn('fast', function() {

dialog.data.slideDown('fast');
});
});
}

});
});
});
});


[jQuery] Re: Ajax get contents question

2009-09-03 Thread David .Wu

it's funny that I can use find to get res2's html, why?
filter res get res2 failed
find res failed res2 get

On 9月3日, 下午12時11分, "David .Wu"  wrote:
> This is my testing php code, I found if I use filter, I can only get
> the content from first level of object, for example
> 12
>
> I can get res's contents by filter, but I can't get res2's contents,
> is that possible that get any thing I want through ajax?
>
>  if (isset($_POST['g'])) {
>         echo '12';
>         exit;}
>
> ?>
>  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
> http://www.w3.org/1999/xhtml";>
> 
> 
> get
> 
> 
>
> 
> 
> 
> 
> 
> $(function() {
>         $('#btn1').click(function() {
>                 $.post('get.php', {g: 1}, function(data) {
>                         var data = $(data).filter('#res').html();
>                         $('#show').html(data);
>                 });
>         });
>         $('#btn2').click(function() {
>                 $.post('get.php', {g: 1}, function(data) {
>                         var data = $(data).filter('#res2').html();
>                         $('#show').html(data);
>                 });
>         });});
>
> 
> 
> 


[jQuery] Ajax get contents question

2009-09-02 Thread David .Wu

This is my testing php code, I found if I use filter, I can only get
the content from first level of object, for example
12

I can get res's contents by filter, but I can't get res2's contents,
is that possible that get any thing I want through ajax?

12';
exit;
}
?>

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


get








$(function() {
$('#btn1').click(function() {
$.post('get.php', {g: 1}, function(data) {
var data = $(data).filter('#res').html();
$('#show').html(data);
});
});
$('#btn2').click(function() {
$.post('get.php', {g: 1}, function(data) {
var data = $(data).filter('#res2').html();
$('#show').html(data);
});
});
});





[jQuery] save to pdf

2009-08-31 Thread David .Wu

Is there any plugin can let me save the part of pag as pdf?


[jQuery] Re: [validate] problem of defining custom rules

2009-08-25 Thread david

Let's say i want now to a custom message for a class.
then i would like to define a class firstname
and then define a message for the firstname.
my problem is that instead the error message i want i get the error
message from the required class
the javascript is
$(document).ready(function() {
jQuery.validator.addClassRules("firstname", {
  required: true,
  minlength: 2
});
$("#commentForm").validate({

messages: {
firstname: "Enter your firstname"
}
});
});
and the input is now

Thanks in advance,
David

Here is the whole code


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


jQuery validation plug-in - comment form example










$(document).ready(function() {
jQuery.validator.addClassRules("firstname", {
  required: true,
  minlength: 2
});
$("#commentForm").validate({

messages: {
firstname: "Enter your firstname"
}
});
});



#commentForm { width: 500px; }
#commentForm label { width: 250px; }
#commentForm label.error, #commentForm input.submit { margin-left:
253px; }







Please provide your name, email address (won't be 
published)
and a comment

Name (required, at least 2 
characters)


E-Mail (required)



URL (optional)



Your comment (required)











On Aug 25, 8:59 am, Raju  wrote:
> try this ,
>
>  minlength="2" />
>
> Warm Regards,
>
> Mari Raj K,
> Bangalore
> +91 9740765135
>
> On Tue, Aug 25, 2009 at 11:26 AM, david  wrote:
>
> > i played with the example.html from jquery.validate 1.55 and wanted to
> > make a custom rule firstname that is required, with the message please
> > enter a firstname.
> > My changes were in the validate :
> > $("#commentForm").validate({
> >               rules: {
> >                       firstname: "required"
> >                       },
> >               messages: {
> >                       firstname: "Enter your firstname"
> >               }
> >       });
>
> > and then         > minlength="2" />
> > my problem is that it is shown as valid, even i don't enter nothing.
> > i don't know what i am making wrong
>
> > Thanks,
> > David
>
> > This is the code
> >  > "http://
> >www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> > http://www.w3.org/1999/xhtml";>
> > 
> > 
> > jQuery validation plug-in - comment form example
>
> > 
>
> > 
> > 
>
> > 
> > 
>
> > 
> > $(document).ready(function() {
> >       $("#commentForm").validate({
> >               rules: {
> >                       firstname: "required"
> >                       },
> >               messages: {
> >                       firstname: "Enter your firstname"
> >               }
> >       });
> > });
> > 
>
> > 
> > #commentForm { width: 500px; }
> > #commentForm label { width: 250px; }
> > #commentForm label.error, #commentForm input.submit { margin-left:
> > 253px; }
> > 
>
> > 
> > 
>
> > 
> >       
> >               Please provide your name, email address (won't
> > be published)
> > and a comment
> >               
> >                       Name (required, at least 2
> > characters)
> >                        > minlength="2" />
> >               
> >                       E-Mail (required)
> >                       
> >               
> >               
> >                       URL (optional)
> >                        > value="" />
> >               
> >               
> >                       Your comment (required) > label>
> >                        > class="required">
> >               
> >               
> >                        > value="Submit"/>
> >               
> >       
> > 
>
> > 
> > 


[jQuery] Re: [validate] problem of defining custom rules

2009-08-25 Thread david

Thank you very much.

On Aug 25, 8:59 am, Raju  wrote:
> try this ,
>
>  minlength="2" />
>
> Warm Regards,
>
> Mari Raj K,
> Bangalore
> +91 9740765135
>
> On Tue, Aug 25, 2009 at 11:26 AM, david  wrote:
>
> > i played with the example.html from jquery.validate 1.55 and wanted to
> > make a custom rule firstname that is required, with the message please
> > enter a firstname.
> > My changes were in the validate :
> > $("#commentForm").validate({
> >               rules: {
> >                       firstname: "required"
> >                       },
> >               messages: {
> >                       firstname: "Enter your firstname"
> >               }
> >       });
>
> > and then         > minlength="2" />
> > my problem is that it is shown as valid, even i don't enter nothing.
> > i don't know what i am making wrong
>
> > Thanks,
> > David
>
> > This is the code
> >  > "http://
> >www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> > http://www.w3.org/1999/xhtml";>
> > 
> > 
> > jQuery validation plug-in - comment form example
>
> > 
>
> > 
> > 
>
> > 
> > 
>
> > 
> > $(document).ready(function() {
> >       $("#commentForm").validate({
> >               rules: {
> >                       firstname: "required"
> >                       },
> >               messages: {
> >                       firstname: "Enter your firstname"
> >               }
> >       });
> > });
> > 
>
> > 
> > #commentForm { width: 500px; }
> > #commentForm label { width: 250px; }
> > #commentForm label.error, #commentForm input.submit { margin-left:
> > 253px; }
> > 
>
> > 
> > 
>
> > 
> >       
> >               Please provide your name, email address (won't
> > be published)
> > and a comment
> >               
> >                       Name (required, at least 2
> > characters)
> >                        > minlength="2" />
> >               
> >                       E-Mail (required)
> >                       
> >               
> >               
> >                       URL (optional)
> >                        > value="" />
> >               
> >               
> >                       Your comment (required) > label>
> >                        > class="required">
> >               
> >               
> >                        > value="Submit"/>
> >               
> >       
> > 
>
> > 
> > 


[jQuery] Re: How to hide pop is blur

2009-08-13 Thread David .Wu

How to declare other thing?

On 8月13日, 下午7時28分, Jon Banner  wrote:
> $('#show').click(function(){
>    $('#popup').fadeIn("slow", function(){
>       $(other things).click(function(){
>          $('#popup, #show').hide();
>       });
>   });
>
> });
>
> 2009/8/13 David .Wu 
>
>
>
> > There is a button control a div show or not, I want when you click
> > other things then the div will disappear too exclude div itself and
> > also the show button, how to do that?
>
> > [html]
> > 
> > 
> > .
> > 
> > 
> > 
> > ..
> > 
> > 
> > 
>
> > [JavaScript]
> > 
> > $('#show').click(function(){
> > $('#popup').toggle();
> > });
> > 


[jQuery] How to hide pop is blur

2009-08-12 Thread David .Wu

There is a button control a div show or not, I want when you click
other things then the div will disappear too exclude div itself and
also the show button, how to do that?

[html]


.



..




[JavaScript]

$('#show').click(function(){
$('#popup').toggle();
});



[jQuery] How to get variable from iframe?

2009-08-10 Thread David .Wu

a.php

..

var a = 123;


Can I catch variable a in b.php?



[jQuery] Re: Ajax response attached file

2009-08-05 Thread David

window.location.href = "file_url";

It seemed to me the best solution.

On 4 ago, 21:21, David  wrote:
> Would it be a proper solution to use a hidden iframe and set the 'src'
> attribute with the file URL? That is, in the Post methodAJAXrequest,
> in its callback function, set the attribute.
>
> On 4 ago, 20:12, elubin  wrote:
>
> > Don't do it inajax.  setup the link as a regular  tag, and the
> > browser should handle it for you.


[jQuery] Re: Ajax response attached file

2009-08-04 Thread David

Would it be a proper solution to use a hidden iframe and set the 'src'
attribute with the file URL? That is, in the Post method AJAX request,
in its callback function, set the attribute.

On 4 ago, 20:12, elubin  wrote:
> Don't do it in ajax.  setup the link as a regular  tag, and the
> browser should handle it for you.


[jQuery] Ajax response attached file

2009-08-04 Thread David

Hello,

I am doing a Port AJAX request to a PHP script on the server side.
This PHP makes a process and generates some files, which it compresses
in a .zip file and send it back to the client.

The point is I don't know how to manage the PHP zip in the Post ajax
methos 'success' function so the user can get this zip as he/she
usually download a file form the web.

Zip file gets to the browser but I don't know how to make the download
action.

Thanks


[jQuery] Re: a select question

2009-08-03 Thread David .Wu

thanks a lot, this is exactly what I want :)

On 8月3日, 下午9時44分, Liam Potter  wrote:
> I think he just wants to select anything without a certain class
> eg
> $("div:not('.abc')")
>
> Michael Lawson wrote:
>
> > mmm a little more information in regards to what exactly you want to
> > do but
>
> > $('div').eq(i); where i is the index of the div you want to access
>
> > alternatively you could also do $('div:eq(i)');
>
> > cheers
>
> > Michael Lawson
> > Development Lead, Global Solutions, ibm.com
> > Phone: 1-276-206-8393
> > E-mail: mjlaw...@us.ibm.com
>
> > 'Whether one believes in a religion or not,
> > and whether one believes in rebirth or not,
> > there isn't anyone who doesn't appreciate kindness and compassion..'
>
> > Inactive hide details for "David .Wu" ---08/03/2009 09:37:41 AM---if I
> > have 3 div, how to filter the div without class abc?"David .Wu"
> > ---08/03/2009 09:37:41 AM---if I have 3 div, how to filter the div
> > without class abc?
>
> > From:      
> > "David .Wu" 
>
> > To:        
> > "jQuery (English)" 
>
> > Date:      
> > 08/03/2009 09:37 AM
>
> > Subject:  
> > [jQuery] a select question
>
> > 
>
> > if I have 3 div, how to filter the div without class abc?
>
> > 
> > 
> > 


[jQuery] Re: a select question

2009-08-03 Thread David .Wu

thanks a lot, this is exactly what I want :)

On 8月3日, 下午9時44分, Liam Potter  wrote:
> I think he just wants to select anything without a certain class
> eg
> $("div:not('.abc')")
>
> Michael Lawson wrote:
>
> > mmm a little more information in regards to what exactly you want to
> > do but
>
> > $('div').eq(i); where i is the index of the div you want to access
>
> > alternatively you could also do $('div:eq(i)');
>
> > cheers
>
> > Michael Lawson
> > Development Lead, Global Solutions, ibm.com
> > Phone: 1-276-206-8393
> > E-mail: mjlaw...@us.ibm.com
>
> > 'Whether one believes in a religion or not,
> > and whether one believes in rebirth or not,
> > there isn't anyone who doesn't appreciate kindness and compassion..'
>
> > Inactive hide details for "David .Wu" ---08/03/2009 09:37:41 AM---if I
> > have 3 div, how to filter the div without class abc?"David .Wu"
> > ---08/03/2009 09:37:41 AM---if I have 3 div, how to filter the div
> > without class abc?
>
> > From:      
> > "David .Wu" 
>
> > To:        
> > "jQuery (English)" 
>
> > Date:      
> > 08/03/2009 09:37 AM
>
> > Subject:  
> > [jQuery] a select question
>
> > 
>
> > if I have 3 div, how to filter the div without class abc?
>
> > 
> > 
> > 


[jQuery] a select question

2009-08-03 Thread David .Wu

if I have 3 div, how to filter the div without class abc?






[jQuery] Re: Does IE support live?

2009-08-03 Thread David .Wu

got it, I need to define it again after I use ajax, it will be more
safe.

On 7月31日, 下午3時25分, rupak mandal  wrote:
> hi David, you have to bind "jump" in load callback function.
>  $(function() {
>        $.ajaxSetup({
>                cache: false
>        });
>
>        $('#btn').click(function() {
>                $('div:first').load('b.html',function(){loadCallback();});
>        });
>
> });
>
> function  loadCallback()
> {
>       $('#jump').live('change', function() {
>                alert(1);
>        });
>
> }
>
> I think this will fulfill your requirement .
>
> On Fri, Jul 31, 2009 at 12:28 PM, David .Wu  wrote:
>
> > If I load b.html in firefox, alert(1) will work, but ont work in IE.
>
> > page a.html
>
> >  >www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> > http://www.w3.org/1999/xhtml";>
> > 
> > 
> > live
> > 
> > 
>
> > 
> >  > div>
> > 
> > 
> > $(function() {
> >        $.ajaxSetup({
> >                cache: false
> >        });
>
> >        $('#btn').click(function() {
> >                $('div:first').load('b.html');
> >        });
>
> >        $('#jump').live('change', function() {
> >                alert(1);
> >        });
> > });
> > 
> > 
> > 
>
> > page b.html
> > 
> >        1
> >    2
> > 


[jQuery] Does IE support live?

2009-07-30 Thread David .Wu

If I load b.html in firefox, alert(1) will work, but ont work in IE.

page a.html


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


live







$(function() {
$.ajaxSetup({
cache: false
});

$('#btn').click(function() {
$('div:first').load('b.html');
});

$('#jump').live('change', function() {
alert(1);
});
});




page b.html

1
2



[jQuery] What is the point of the "status" param to the "get" callback, if it's always "success"

2009-07-30 Thread David Karr

I'm just reading some basic JQuery information, and I noticed that the
callback used by "get" always sends two parameters, the first being
the relevant data, and the second is a "status" value, which is always
the string "success".  Looking at code samples on the web, I never saw
anyone bother to declare or use the second parameter.  What is the
point of sending data that is never used?


[jQuery] Re: fn question

2009-07-30 Thread David .Wu

totally understand, thanks a lot

On 7月30日, 上午7時39分, Jules  wrote:
> From the jquery pluginhttp://docs.jquery.com/Plugins/Authoring
> Your method must return the jQuery object, unless explicity noted
> otherwise.
>
> $('input#btn').btnClick().css("background-color","blue") won't work
> for your 1st case but works for the 2nd one.
>
> On Jul 30, 3:14 pm, "David .Wu"  wrote:
>
>
>
> > I found these both work, so what is return for?
>
> > 
> > $.fn.btnClick = function() {
> >         this.click(function() {
> >                 alert('test');
> >         });
>
> > }
>
> > $('input#btn').btnClick();
> > 
>
> > 
> > $.fn.btnClick = function() {
> >         return this.click(function() {
> >                 alert('test');
> >         });
>
> > }
>
> > $('input#btn').btnClick();
> > 


[jQuery] fn question

2009-07-29 Thread David .Wu

I found these both work, so what is return for?


$.fn.btnClick = function() {
this.click(function() {
alert('test');
});
}

$('input#btn').btnClick();



$.fn.btnClick = function() {
return this.click(function() {
alert('test');
});
}

$('input#btn').btnClick();



[jQuery] Re: ajaxForm and validate plugin

2009-07-21 Thread David Parloir

hi András,
I suppose that after 2 weeks you found a solution, but i was in the
same situation and I was thinking "too bad there is no answer to that :
("
So, now that I've found the solution, here it goes, for the next one.

1. i create the form's validation rules:
$('#formId').validate({
rules: {
field1Id: {
required: function() {
return $("#anotherFieldId").val() == 'the value I
want';
}
}
}
});

2. i create a checkForm function:
function checkForm () {
if (!$('#formId').valid()) {
alert("Something is wrong in the form. Please check the
messages")
return false;
} else {
return true;
}
}

3. Finally, I add a beforeSubmit (which trigger the checkForm
function) at the ajaxForm:
$('#formId').ajaxForm( {
beforeSubmit: checkForm
} );

this is it :)
my sources: http://www.malsup.com/jquery/form/#code-samples and
http://www.chrillo.info/2008/10/14/jquery-ajaxform-and-validate-with-ajaxsubmit/
cheers


On Jul 5, 11:20 am, András Csányi  wrote:
> Hi all!
>
> I have a form and I want to validate before submit with [1] plugin
> because nice and good. I want to send the form's data with ajaxForm
> [2] plugin.
> The problem is the next:
> I set the ajaxForm options that before send the data validate. The
> validate plugin is working fine because I got error message(s) but the
> empty form was sended always.
>
> I want that while the form is not correct the ajaxForm don't send the data.
>
> Does know anybody example for this with these two plugins?
>
> Plugins:
> [1] -http://bassistance.de/jquery-plugins/jquery-plugin-validation/
> [2] -http://malsup.com/jquery/form/#getting-started
>
> Here is my simple code:
>
> 
>   
>     asd
>     
>     
>     
>     
>       $(document).ready(function() {
>         function formValidate() {
>           $("#formid").validate({
>             rules:{
>               asdasd: "required",
>               bsdbsd: "required"
>             },
>             messages:{
>               asdasd: "Ide kellene valamit írni!",
>               bsdbsd: "Ide se ártana balyétom!"
>             }
>           });
>         }
>         var ajaxFormOptions = {
>           beforeSubmit: formValidate()
>         }
>         $("#formid").submit(function(){
>           $(this).ajaxSubmit(ajaxFormOptions);
>           return false;
>         });
>       });
>     
>   
>   
>      enctype="multipart/form-data">
>       
>         asdasd 
>       
>       
>         bsdbsd 
>       
>       
>         
>       
>     
>   
> 
>
> I would like appreciate your kind help!
>
> --
> - -
> --  Csanyi Andras  --http://sayusi.hu-- Sayusi Ando
> --  "Bízzál Istenben és tartsd szárazon a puskaport!".-- Cromwell


[jQuery] Re: JSON form submit

2009-07-19 Thread David

If you are using JSON to construct your server request, why do you
need a params order?
I mean, in JSON format, you will have pairs detailing attribute name -
attribute value, so you will always know which parameter are you
dealing with.

On 18 jul, 15:02, NightFox  wrote:
> Hello,
>
> I'm working on an order system where I get to see all my purchase
> orders.
> But the problem is that I want to submit my result with AJAX by an
> JSON key.
>
> The first problem that I encounter is that I need to retrieve all the
> input boxes of that particular order.
> If I use $(":input") then I get all the input fields that are existing
> on that page.
>
> What do I want to achieve:
>  - Retrieve all the input boxes of that particular order
>  - Put then in an JSON string
>  - Send it to my php script
>
> If there are any obscurities I'd be glad to hear that so I can explain
> the problem more clearly!
>
> Thanks in advance,
>
> Leon Keijzer


[jQuery] get height from hidden element

2009-07-17 Thread David

Hi,

my problem is, when I try to get the height or any other graphic
property of an element which is hidden (in my case, hidden in one
jQuery UI tab), I can't manage to get the height of the element. If I
do:

$("#my_element").outerHeight()

I get zero. Whereas If I do the same when the element is visible, I
get its height.

I work with jQuery 1.3.2 and FF 3.5.

What am I doing wrong?

Thanks!


[jQuery] dom to html

2009-07-14 Thread david

So let's change the question a bit.
I have a dom element like a table with many input boxes and selects
insides. When filling the input values and selecting elements in the
select box the dom object is with
the updated values , but the innerhtml is like it was loaded. i want a
function which takes a dom element and returns the html
for example if i had a input filed a and i entered the value david, i
want that the function will return 


On Jul 14, 3:05 am, Charlie  wrote:
> still not sure if this is 2 tables and exactly what you are trying to do,
> david wrote:Dear Charlie, I mean if i have a table type="text" value="" name="a'>   name="b">and then i enter in a david and b michael i 
> want at the end
> The same i want also for selected. Is there a way to make it ? Thanks, David 
> On Jul 13, 12:02 am, Charliewrote:I think I confused 
> myself and not sure what objective isoh well, was good practice Charlie 
> wrote: After rereading this,  if tables are same size and  same config;  the 
> following clones the existing table and strips out all inputs inserting the 
> values as text in new table $("#originalTable").clone(function () {        
> $("#originalTable").clone().appendTo("body").attr("id","newTable");    
> $("#newTable td").each(function () {  var newText = 
> $(this).find("input").val(); // get value from input     
> $(this).html(newText); //replace input with new html which is just text   
>     }); Working examplehttp://jsbin.com/uroca Charlie wrote:this isn't 
> exactly clear but sounds like you are taking input values and want them as 
> straight text in a  of the new table? how you go about this will depend a 
> lot on the size and structure you have for markup as well as how much of 
> original goes into new table. Could be as simple as clone() of the original 
> table, and a $each for the td's to strip the inputs and change them to text 
> then remove rows or columns. Very hard to guess what "part of the output" 
> means. There are numerous methods, clone original ,indexing, working with 
> classes or ID's to  append  to new table. Posting a sample page of old and 
> new with a little more detail on your requirements would make solutions a lot 
> easier to identify. If can't post on server jsbin.com is excellent for this 
> david wrote:Hi all, I have a table of input elements which i create through a 
> javascript widget. When i press submit i want to make an action and a part of 
> the output should be the same unchanged tables with the values in it. I don't 
> know how to accomplish it. At first i used the html() function, but it does 
> not pass the table with the html values inserted as i would like. Has anyone 
> an idea how to make it ? Thanks, David


[jQuery] Re: send table with input elements to server

2009-07-12 Thread david

Dear Charlie,
I mean if i have a table







and then i enter in a david and b michael
i want at the end








The same i want also for selected. Is there a way to make it ?
Thanks,
David

On Jul 13, 12:02 am, Charlie  wrote:
> I think I confused myself and not sure what objective isoh well, was good 
> practice
> Charlie wrote:
>
> After rereading this,  if tables are same size and  same config;  the 
> following clones the existing table and strips out all inputs inserting the 
> values as text in new table
> $("#originalTable").clone(function () {
>        $("#originalTable").clone().appendTo("body").attr("id","newTable");
>    $("#newTable td").each(function () {
>  var newText = $(this).find("input").val(); // get value from 
> input
>     $(this).html(newText); //replace input with new html which is 
> just text
>   });
> Working examplehttp://jsbin.com/uroca
> Charlie wrote:this isn't exactly clear but sounds like you are taking input 
> values and want them as straight text in a  of the new table?
> how you go about this will depend a lot on the size and structure you have 
> for markup as well as how much of original goes into new table. Could be as 
> simple as clone() of the original table, and a $each for the td's to strip 
> the inputs and change them to text then remove rows or columns. Very hard to 
> guess what "part of the output" means. There are numerous methods, clone 
> original ,indexing, working with classes or ID's to  append  to new table.
> Posting a sample page of old and new with a little more detail on your 
> requirements would make solutions a lot easier to identify. If can't post on 
> server jsbin.com is excellent for this
> david wrote:Hi all, I have a table of input elements which i create through a 
> javascript widget. When i press submit i want to make an action and a part of 
> the output should be the same unchanged tables with the values in it. I don't 
> know how to accomplish it. At first i used the html() function, but it does 
> not pass the table with the html values inserted as i would like. Has anyone 
> an idea how to make it ? Thanks, David


[jQuery] send table with input elements to server

2009-07-12 Thread david

Hi all,

I have a table of input elements which i create through a javascript
widget.
When i press submit i want to make an action and a part of the output
should be the same unchanged tables with the values in it.
I don't know how to accomplish it.
At first i used the html() function, but it does not pass the table
with the html values inserted as i would like.
Has anyone an idea how to make it ?

Thanks,
David


[jQuery] Can I catch the property of CSS filter?

2009-07-08 Thread David .Wu

the image is like


$('img').css('filter') will get
progid:DXImageTransform.Microsoft.AlphaImageLoader(src='aa.png')

Can I get the aa.png directly?


[jQuery] documentation system for jquery

2009-07-07 Thread david

Hi all,

I wanted to ask which system you use to produce the jquery
documentation (core and plugins).

Thanks,
David


[jQuery] image resize issue

2009-06-29 Thread David .Wu

我今天有兩個放大縮小按鈕,想讓user按放大時用js把一個100x72的圖片
以寬為主每次加4px等比放大,反之亦然,但不知道小數位數該如何取才能正確控制高度
等比放大的公式為

I have two button to let user enlarge or reduce a 100px x 72px image
immediately on the page, 4px enlarge or reduce one time by width, but
I don't know how to control the height to make resize proportionally.

resize formula is below:

enlarge
(height/width)*(width+4)

reduce
(height/width)*(width-4)

I try to use xnview software to get the resize information, you can
see, the height will not resize proportionally after few clicks, for
example, if I click reduce 10 times, and click enlarge 10 times, the
image should be origin size 100x72, but it's not, how to do it right?

xnview reduce
100 72
96 69
92 66
88 63
84 60
80 58
76 55

JS reduce
100 72
96 69.12
92 66.125
88 63.130434782608695
84 60.13636363636364
80 57.142857142857146
76 54.15

xnview enlarge
100 72
104 75
108 78
112 81
116 84
120 86
124 89

JS enlarge
100 72
104 74.88
108 77.88461538461539
112 80.89
116 83.89285714285714
120 86.89655172413794
124 89.89


[jQuery] Re: getJSON parameter - long string

2009-06-26 Thread David Andrews


Hi,

There is a byte limit (2048) on the size of a url set in the server  
configuration (I think specific t IIS but maybe apache too) , if you  
dont have access to change these you will have to use POST to submit  
your string.


On 26 Jun 2009, at 11:07, saa...@gmail.com wrote:



Hi

I am trying to send with getJSON a very long string as parameter:

$.getJSON("/ajax.php",{id:myid, thetext:mytext},myAjaxResult)
where "mytext" - is value from my fckeditor.

If "mytext" value is not so long, everything is going fine, but if it
become a very long, getJSON doesn't work.

How can I solve this question?




[jQuery] Re: Autocomplete - trouble with getJSON callback function not executing?

2009-06-25 Thread David here

Thanks a bunch!

Looks like my JSON data is not correctly formatted or wrapped in the callback 
function.  Let me see if I can tweak it and see what happens.

David

> Date: Thu, 25 Jun 2009 16:24:54 -0700
> Subject: [jQuery] Re: Autocomplete - trouble with getJSON callback function 
> not  executing?
> From: jmay...@gmail.com
> To: jquery-en@googlegroups.com
> 
> 
> The link to your json file didn't work, so I couldn't look it over.
> But incorrectly formatted json will result in a failure in getJSON()
> call and your callback would never be executed. Your json has to be
> perfect, so look it over very carefully.
> 
> Here's a couple of common gotchas:
> 
> [
>   {
>   "date": "1-Jun",
>   "time": "2:00 PM",
>   },
>   {
>   "date": "3-Jun",
>   "time": "2:00 PM",
>   },
> ]
> 
> 1) Note that the "time" field on both records has a comma at the end.
> This is incorrect, the last field should have no comma at the end.
> 
> 2) Same thing on the last record, there is a comma following the
> ending curly bracket. No comma should come after the last record.
> 
> This file should fail if you try it, but will succeed when removing
> these commas. There are other formatting errors not quite as common.
> Basically, json files have to be perfect. A lot of people have json
> generators to ensure they will be correct.
> 
> hth!

_
Windows Live™: Keep your life in sync. 
http://windowslive.com/explore?ocid=TXT_TAGLM_WL_BR_life_in_synch_062009

[jQuery] Re: getJSON flicker works but not mine -- URGENT HELP

2009-06-25 Thread David here

Thanks for the pointer, Etienne.

After some more tweaks and research, it seems I have to wrap the JSON object in 
the call back function, like "jsonpx({json object}).

Hope this works!

> Date: Thu, 25 Jun 2009 21:19:17 -0400
> From: robillard.etie...@gmail.com
> To: jquery-en@googlegroups.com
> Subject: [jQuery] Re: getJSON flicker works but not mine -- URGENT HELP
> 
> 
> 
> Since I can't debug pretty much on the server-side, I'd suspect that
> somehow the data coming from flickr is more clean than from your host.
> 
> I also get the following error, indicating most likely a problem parsing
> the json data:
> 
> Error: invalid label
> Source File:
> http://include.classistatic.com/include/c3js/classifieds/rel1/auto2/a/p10.js?jsoncallback=jsonp1245978837391&_=1245978837487
> Line: 2, Column: 2
> Source Code:
>   "title": "Recent Uploads tagged cat",
> 
> How (which api) are you using to generate the json data ?
> I recommend "demjson" if you're using Python.
> 
> Hope this helps,
> Etienne
> 
> 
> dtrannn wrote:
> > 
> > Etienne,
> > 
> > I'm using getJSON because I need to do cross-domain data fetching.  I
> > thought getJSON is the best way for doing that from reading the docs.
> > 
> > No error messages show up in FF.  In HTTP watch, I see the JSON content
> > coming throw as
> > 
> > {
> > "title": "Recent Uploads tagged cat",
> > "link": "http://www.flickr.com/photos/tags/cat/";,
> > "description": "",
> > "modified": "2009-06-25T17:40:33Z",
> > "generator": "http://www.flickr.com/";,
> > .
> > .
> > .
> > }
> > 
> > but the callback never fires.
> > 
> > Any other ideas?
> > 
> > 
> > Etienne Robillard-3 wrote:
> >>
> >>
> >> Hi dtrann,
> >>
> >> I never tried the $.getJSON method before but generally have better
> >> results using the plain $.ajax method. If you switch to that
> >> alternative, you should also pay attention to specifying the "json"
> >> dataType param. Oh and what is the error message reported ? ;-)
> >>
> >> Hope this helps,
> >> Etienne
> >>
> >> dtrannn wrote:
> >>> Hi, I'm a newbie trying to understand getJSON callbacks.  I have 2
> >>> getJSON
> >>> calls below.  One for flicker which works fine - the alert goes off - but
> >>> when I tried my js file, nothing happens.  Both files are returning the
> >>> exact same JSON data.
> >>>
> >>> I know I'm doing something wrong.  Can someone help me out?
> >>>
> >>> 
> >>> 
> >>>>>> src="http://include.classistatic.com/include/c3js/classifieds/rel1/jquery-1.2.6.js";>
> >>>   
> >>>   
> >>>   $(document).ready(function(){//alert("1");
> >>>
> >>> $.getJSON("http://include.classistatic.com/include/c3js/classifieds/rel1/auto2/a/p10.js?jsoncallback=?";,
> >>>  
> >>> //$.getJSON("http://api.flickr.com/services/feeds/photos_public.gne?tags=cat&tagmode=any&format=json&jsoncallback=?";,
> >>>  
> >>> function(data){alert(data);});
> >>>   
> >>> 
> >>> 
> >>> 
> >>> 
> >>>
> >>
> >> -- 
> >> Etienne Robillard 
> >> Green Tea Hackers Club 
> >> Blog: 
> >> PGP Fingerprint: AED6 B33B B41D 5F4F A92A  2B71 874C FB27 F3A9 BDCC
> >>
> >>
> > 
> 
> 
> -- 
> Etienne Robillard 
> Green Tea Hackers Club 
> Blog: 
> PGP Fingerprint: AED6 B33B B41D 5F4F A92A  2B71 874C FB27 F3A9 BDCC

_
Windows Live™ SkyDrive™: Get 25 GB of free online storage.
http://windowslive.com/online/skydrive?ocid=TXT_TAGLM_WL_SD_25GB_062009

[jQuery] Looking for jQuery experts for Open-Source Social Annotation platform

2009-06-23 Thread David Nolen

Hello all,

I work on an open source social meta-web and annotation tool called
ShiftSpace (http://www.shiftspace.org, 
http://github.com/ShiftSpace/shiftspace/tree/master).
The ShiftSpace platform is primarily written in MooTools, however with
the release of MooTools 1.2.3, it is now possible for MooTools and
jQuery to coexist.  To see the kinds of social applications that can
be built with ShiftSpace check out http://moma.org.

At the moment the non-GreaseMonkey plugin version of ShiftSpace works
just fine running MooTools and jQuery together.  However we're looking
for people who are avid jQuery+GreaseMonkey hackers who might be
interested in the effort to make the GM version of ShiftSpace run both
libraries seamlessly.

Please check out our website for more info and/or join the discussion
at the http://groups.google.com/group/ShiftSpace-dev. If you have any
thoughts, feedback or would like to contribute please don't hesitate
to contact us.

Thanks,
David Nolen (Lead ShiftSpace Developer)


[jQuery] test post

2009-06-19 Thread David

test post


[jQuery] [Validate] showErrors does not update numberOfInvalids

2009-06-19 Thread David

Hello all,

In general the plugin is great and I have a working solution using a
global variable to keep track of invalids because of this problem in
the library.

Short description, in the validator method that I added, I am calling
showErrors because the message needs to be dynamic. I call showErrors
with the dynamic string and then return the same string from the
validator method.

However, right after that runs, while the screen is showing the error,
calls to validate().element do not return any errors.

Further background:
This is an internal application used for captuing some barcode
information. We have written the application to keep focus in a field
until it validates, we do this by checking the validity of a field on
the blur event. I am using autocomplete to move to next field when
they scan. What I am seeing is that when the field fails validation
and the screen is showing the error, the validity check passes which
causes the code in the blur event to allow focus to move to the next
screen.


Some of the rules are simple and have static messages like required
and minimum length and they all work correctly.

I have two different rules which wrap a call to Ajax synchronously. I
do not think I can use the "remote" method because the remote returns
before getting back the error which causes the blur handler to allow
focus to move to next field.

One of the ajax wrapping rules, which has a static error message,
works fine.

The other rule, which needs to get the error message from the server,
is the one showing this incorrect behavior.

I can get this to work by breaking this call up into individual calls
for every possible error message, but then I have multiple calls to
the server when I only really need one that returns the appropriate
error message.


===

As an aside I noticed that if I use a function instead of a string for
the message, the function is only called once, so I cannot work around
the error above by just returning true/false from the validator and
computing the message in the message function.


[jQuery] Re: [validate] custom error messages from remote method

2009-06-16 Thread david

Thanks.
"mir ist ein licht aufgegangen"

On Jun 16, 10:57 am, Jörn Zaefferer 
wrote:
> Nope, not anymore. The check is now more explicit: if (response ===
> true) { ... } else { displayError }, where before if was just if
> (response) ...
>
> Jörn
>
> On Tue, Jun 16, 2009 at 8:55 AM, david wrote:
>
> > Hi all.
> > In the new version of jquery.validate (1.5.3) there is an option to
> > get a remote error message from the server for invalid elements.
> > I did not find what should be the exact response from the server for
> > producing such an error message.
>
> > From the documentation:
> > "The response is evaluated as JSON and must be true for valid
> > elements, and can be any false, undefined or null for invalid
> > elements, using the default message; or a string, eg. "That name is
> > already taken, try peter123 instead" to display as the error message."
>
> > But if i return a string, isn't it evaluated as true ?
>
> > Thanks in advance,
> > David


[jQuery] Re: ajaxSetup and getJSON

2009-06-16 Thread david

Isn't it more a server side question ?
I would suggest that you try in the browser location bar to generate
the url (by hand) and see if there also the problem consists.
If yes then you have first to solve it on the server side.
I use in my scripts a session id which i pass through getjson as
arguments without the ajaxSetup method

On Jun 16, 6:12 am, Antony Currington 
wrote:
> Hi all,
>
> Is it possible to use ajaxSetup to define a username and password that
> will then be used by getJSON?
>
> I have an enviuronment where I have a web server that I'm passing a
> URL to for a web service call that returns me JSON.  I'm doing the
> call via the getJSON method, and get back the data I want, except that
> I'm being prompted to log in and I don't want the users to
> authenticate.
>
> I need to provide a username and password somewhere in the URL (or
> additional details) and so added an ajaxSetup call right before I call
> getJSON to set the username and password as follows:
>
> jQuery.ajaxSetup({username: myusername, password: mypassword });
> jQuery.getJSON(url, function (jsonObject) {
>
> //do some stuff
>
> }
>
> );
>
> For some reason I'm still getting prompted for the username and
> password for the URL, even though they're being set.
>
> I'm working with IE6, and jQuery 1.3.2.
>
> Any assistance would be greatly appreciated.
>
> Regards,
> Antony


[jQuery] [validate] custom error messages from remote method

2009-06-15 Thread david

Hi all.
In the new version of jquery.validate (1.5.3) there is an option to
get a remote error message from the server for invalid elements.
I did not find what should be the exact response from the server for
producing such an error message.

>From the documentation:
"The response is evaluated as JSON and must be true for valid
elements, and can be any false, undefined or null for invalid
elements, using the default message; or a string, eg. "That name is
already taken, try peter123 instead" to display as the error message."

But if i return a string, isn't it evaluated as true ?

Thanks in advance,
David


[jQuery] Re: [validate] how to get ajax error messages from server till it is implemented in remote method

2009-06-15 Thread david

Wow, Cool

Thank you very much

On Jun 15, 3:32 pm, Jörn Zaefferer 
wrote:
> Actually this will be implemented in the next release, due out very
> soon (hopefully today). Stay tuned for the update on bassistance.de
>
> You can also get the code now from 
> SVN:http://jqueryjs.googlecode.com/svn/trunk/plugins/validate/
>
> Jörn
>
> On Mon, Jun 15, 2009 at 11:49 AM, david wrote:
>
> > Dear all,
>
> > I wanted to ask how it is possible to get error messages from the
> > server till it is implemented in the remote method.
> > What do you think is the less work intensive  alternative.
> > I also wanted to ask if i have two fields A and B, and the values of B
> > depends on A. How do i make it with the plugin and the remote method ?
> > I saw that there is a way of writing custom methods:
> >http://groups.google.com/group/jquery-en/browse_thread/thread/e2eb521...[validate]+2+fields#622654c57434966a
> > But how do i combine it with the ajax calls?
>
> > Thanks,
> > David


[jQuery] Re: Tell me , Select option value

2009-06-15 Thread david

For alert : you must define on which event and then use the bind
function:
http://docs.jquery.com/Events/bind#examples

On Jun 15, 2:33 pm, david  wrote:
> You mean the value of the radio button.
> please take a look 
> athttp://snipplr.com/view/3372/radio-button-values-using-jquery/
>
> On Jun 15, 2:17 pm, bharani kumar 
> wrote:
>
> > Hi all ,
>
> > Am little bit confusion in radio selection ,
>
> > My doubt is very simple ,
>
> > Having two radio button ,
>
> > alert which ratio option i selected for example Male and female
>
> > Thanks


[jQuery] Re: Tell me , Select option value

2009-06-15 Thread david

You mean the value of the radio button.
please take a look at
http://snipplr.com/view/3372/radio-button-values-using-jquery/

On Jun 15, 2:17 pm, bharani kumar 
wrote:
> Hi all ,
>
> Am little bit confusion in radio selection ,
>
> My doubt is very simple ,
>
> Having two radio button ,
>
> alert which ratio option i selected for example Male and female
>
> Thanks


[jQuery] [validate] how to get ajax error messages from server till it is implemented in remote method

2009-06-15 Thread david

Dear all,

I wanted to ask how it is possible to get error messages from the
server till it is implemented in the remote method.
What do you think is the less work intensive  alternative.
I also wanted to ask if i have two fields A and B, and the values of B
depends on A. How do i make it with the plugin and the remote method ?
I saw that there is a way of writing custom methods:
http://groups.google.com/group/jquery-en/browse_thread/thread/e2eb52101bd1fc24/622654c57434966a?lnk=gst&q=[validate]+2+fields#622654c57434966a
But how do i combine it with the ajax calls?


Thanks,
David


  1   2   3   4   5   6   7   >