[jQuery] Re: should be using .find . . .

2008-04-20 Thread hubbs

I cannot get it to work, here is what I tried:

function loadTest() {
 $.ajax({
   type: "GET",
   url: "home.html",
   data: "",
   success: function(html){
   $(html).find("#footer");
   $("#loadTest").append(html);
   }
 });

Any help would be appreciated!

On Apr 20, 10:22 pm, hubbs <[EMAIL PROTECTED]> wrote:
> Sorry, not sure how I started a new topic...
>
> I am trying to use the ajax POST and GET function, and at the same
> time, use .find to filter the results so I only return a div with a
> specific ID.  I have tried, and I am failing to get it working.  Any
> help would be great!
>
> On Apr 20, 10:20 pm, hubbs <[EMAIL PROTECTED]> wrote:
>
> > Could anyone help with this?  I figure that I should be using
> > the .find function, but I am not sure how to use to to filer my
> > response text, and only display the id that I want.  The example seems
> > to not be working, or I should be changing it somehow, and I am not
> > sure.
>
> > Anyone?


[jQuery] Re: should be using .find . . .

2008-04-20 Thread hubbs

Sorry, not sure how I started a new topic...

I am trying to use the ajax POST and GET function, and at the same
time, use .find to filter the results so I only return a div with a
specific ID.  I have tried, and I am failing to get it working.  Any
help would be great!

On Apr 20, 10:20 pm, hubbs <[EMAIL PROTECTED]> wrote:
> Could anyone help with this?  I figure that I should be using
> the .find function, but I am not sure how to use to to filer my
> response text, and only display the id that I want.  The example seems
> to not be working, or I should be changing it somehow, and I am not
> sure.
>
> Anyone?


[jQuery] should be using .find . . .

2008-04-20 Thread hubbs

Could anyone help with this?  I figure that I should be using
the .find function, but I am not sure how to use to to filer my
response text, and only display the id that I want.  The example seems
to not be working, or I should be changing it somehow, and I am not
sure.

Anyone?


[jQuery] Re: Trouble with attr() and IE7, and onclick...

2008-04-20 Thread Karl Rudd

The only thing I could see that might be wrong is in "uncheckAll()".
Don't need the "on" as the second argument to "removeAttr()". That
shouldn't cause any problems though.

Do you have a "live" version of the page that we could look at? It
doesn't have to be "working", just a static HTML version of the page
with the JavaScript.

Karl Rudd

On Mon, Apr 21, 2008 at 6:49 AM,  <[EMAIL PROTECTED]> wrote:
>
>  Anyone?
>


[jQuery] Re: IE debugging advice, please

2008-04-20 Thread Karl Rudd

Apart from the usual "alert()" option you might like to try Firebug Lite:

  http://www.getfirebug.com/lite.html

Karl Rudd

On Mon, Apr 21, 2008 at 12:42 PM, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
>
>  As I stumble towards discovery of jQuery and all things Javascript, I
>  frequently get knocked down by IE ;) It throws fatal errors far more
>  often than Firefox (whose debugger I can understand) but IE's debug
>  option invariably points to an 'error' in the jQuery core. I assume
>  that's not the *real* error; just the point in the main script at
>  which *my* script caused a fault.
>
>  Please could someone point me towards a better debugger for ie?
>  I should emphasise that I really am floundering in the dark here.
>  Ideally, I need something dead simple. I can't even use Firebug
>  properly!
>
>  Any & all advice much appreciated, as ever :)
>  Cherry.
>


[jQuery] Re: jQuery style guide?

2008-04-20 Thread [EMAIL PROTECTED]

Karl, you're a great teachr and I diligently work through your
tutorials wherever I find them! Thanks for the links :))

On Apr 21, 4:22 am, Karl Swedberg <[EMAIL PROTECTED]> wrote:
> Hi Cherry,
>
> When Jonathan Chaffer and I wrote our books on jQuery, we put together
> a number of pages to exemplify the concepts we were explaining.
> Perhaps you will find them helpful in gaining a better understanding
> of some of the basics:
>
> http://book.learningjquery.com/
>
> In particular, related to CSS selectors, see this page:
>
> http://book.learningjquery.com/3810_02_code/selectors.html
>
> Click on a heading and then press a Toggle button to see which
> elements in the "CSS DOM Tree" are selected. The third set of
> examples, with the ".myclass" heading, are particularly relevant here:
>
> $('.myclass')
> $('p.myclass')
> $('.otherclass.myclass')
>
> Cheers,
>
> --Karl
> _
> Karl Swedbergwww.englishrules.comwww.learningjquery.com
>
> On Apr 20, 2008, at 10:58 PM, [EMAIL PROTECTED] wrote:
>
>
>
> > You are correct in this case, Scott. I tend to do my CSS
> > 'automatically' these days (though it was as tricky to learn, in the
> > beginning, as this is!) and probably don't think often enough about
> > the rules.
>
> > In far more general terms, however, I really do believe a style guide
> > for jQuery beginners is desperately needed! Surely the purpose of a
> > Javascript library is to make js wizadry more available to all - yet
> > there's virtually NO documentation suitable for newcomers such as
> > myself.
>
> > If it weren't for this group, I'd have abandoned jQuery & gone for
> > MooTools months ago. Moo, being older, comes with a far more complete
> > set of "plug'n'play" actions; the core itself is no easier to work
> > with than jQuery but you can achieve more, faster, by piggybacking on
> > others' work.
>
> > As both a bit of a pedant and an evangelist, I love the opportunity
> > jQuery - with this group - provides, in terms of learning new skills
> > and building my own little apps to my own specs :)
>
> > But the available guidance for newbies is abysmal. I really can't
> > overstress the significance of this group!!
>
> > So give yourselves a big pat on the back :)
> > And please try to supress your irritation if I ask a question that
> > seems elementary to you ;)
>
> > Cherry.
>
> > On Apr 20, 7:20 pm, Scott González <[EMAIL PROTECTED]> wrote:
> >> Your problem actually has nothing to do with JavaScript; it is purely
> >> CSS.
>
> >>http://www.w3.org/TR/REC-CSS2/selector.html
>
> >> On Apr 19, 10:38 pm, "[EMAIL PROTECTED]"
>
> >> <[EMAIL PROTECTED]> wrote:
> >>> As anyone who's flicked over my beginner's blog will know, jQuery
> >>> provides a constantly vertical learning curve (!) It isn't made any
> >>> easier by the lack of basic instruction.
>
> >>> I realise this is largely because of my very basic Javascript
> >>> knowledge - but some of the problems I encounter are special to
> >>> jQuery, and I'd love to know whether somebody has already written a
> >>> style guide?
>
> >>> Example: I've just discovered I needed to concatenate a selector.
> >>> Normally, one can use:
> >>> $( '#someid .someclass' ) - as advertised by jQuery, the CSS
> >>> selector.
> >>> I have a heading + class to select with jQuery. After more than half
> >>> an hour of failed experiments, I found it must be:
> >>> $( 'h2.someclass') - as not advertised anywhere that I know of!
>
> >>> Can I find a reference to this kind of thing?? I'm having a hard
> >>> enough time as it is!
>
> >>> thanks -
> >>> Cherry
> >>> (http://jquery.cherryaustin.com)


[jQuery] Re: Postal Code Validation

2008-04-20 Thread [EMAIL PROTECTED]

Nice one, Ian :)

Without the extras, here's a regex for UK post codes:
/^[A-Z]{1,2}\d[\dA-Z]?\s?\d[A-Z]{2}$/i
and one for UK phones (includes mobiles):
^\\s*\\(?(020[7,8]{1}\\)?[ ]?[1-9]{1}[0-9{2}[ ]?[0-9]{4})|(0[1-8]{1}
[0-9]{3}\\)?[ ]?[1-9]{1}[0-9]{2}[ ]?[0-9]{3})\\s*\$

Made these ages ago & have forgotten how - but they work. Done for PHP
- is javascript regex different?

On Apr 20, 8:47 pm, Ian <[EMAIL PROTECTED]> wrote:
> I've noticed a lot of requests for Postal Code validation. I don't
> know if anyone posted one, but here is an addon method I wrote for
> Canadian postal codes.
>
> $.validator.addMethod("postalCode", function(value) { // Addon method
> for validating postal codes. Valid formats are (X1X 1X1) or (X1X1X1)
> or (X1X-1X1).
> return value.match(/^[a-zA-Z][0-9][a-zA-Z](-| )?[0-9][a-zA-Z]
> [0-9]$/);
>
> }, 'Please enter a valid postal code');
>
> You can then use the rule postalCode:true to validate.


[jQuery] Re: jQuery style guide?

2008-04-20 Thread Karl Swedberg


Hi Cherry,

When Jonathan Chaffer and I wrote our books on jQuery, we put together  
a number of pages to exemplify the concepts we were explaining.  
Perhaps you will find them helpful in gaining a better understanding  
of some of the basics:


http://book.learningjquery.com/

In particular, related to CSS selectors, see this page:

http://book.learningjquery.com/3810_02_code/selectors.html

Click on a heading and then press a Toggle button to see which  
elements in the "CSS DOM Tree" are selected. The third set of  
examples, with the ".myclass" heading, are particularly relevant here:


$('.myclass')
$('p.myclass')
$('.otherclass.myclass')


Cheers,

--Karl
_
Karl Swedberg
www.englishrules.com
www.learningjquery.com



On Apr 20, 2008, at 10:58 PM, [EMAIL PROTECTED] wrote:



You are correct in this case, Scott. I tend to do my CSS
'automatically' these days (though it was as tricky to learn, in the
beginning, as this is!) and probably don't think often enough about
the rules.

In far more general terms, however, I really do believe a style guide
for jQuery beginners is desperately needed! Surely the purpose of a
Javascript library is to make js wizadry more available to all - yet
there's virtually NO documentation suitable for newcomers such as
myself.

If it weren't for this group, I'd have abandoned jQuery & gone for
MooTools months ago. Moo, being older, comes with a far more complete
set of "plug'n'play" actions; the core itself is no easier to work
with than jQuery but you can achieve more, faster, by piggybacking on
others' work.

As both a bit of a pedant and an evangelist, I love the opportunity
jQuery - with this group - provides, in terms of learning new skills
and building my own little apps to my own specs :)

But the available guidance for newbies is abysmal. I really can't
overstress the significance of this group!!

So give yourselves a big pat on the back :)
And please try to supress your irritation if I ask a question that
seems elementary to you ;)

Cherry.

On Apr 20, 7:20 pm, Scott González <[EMAIL PROTECTED]> wrote:

Your problem actually has nothing to do with JavaScript; it is purely
CSS.

http://www.w3.org/TR/REC-CSS2/selector.html

On Apr 19, 10:38 pm, "[EMAIL PROTECTED]"

<[EMAIL PROTECTED]> wrote:

As anyone who's flicked over my beginner's blog will know, jQuery
provides a constantly vertical learning curve (!) It isn't made any
easier by the lack of basic instruction.



I realise this is largely because of my very basic Javascript
knowledge - but some of the problems I encounter are special to
jQuery, and I'd love to know whether somebody has already written a
style guide?



Example: I've just discovered I needed to concatenate a selector.
Normally, one can use:
$( '#someid .someclass' ) - as advertised by jQuery, the CSS  
selector.

I have a heading + class to select with jQuery. After more than half
an hour of failed experiments, I found it must be:
$( 'h2.someclass') - as not advertised anywhere that I know of!



Can I find a reference to this kind of thing?? I'm having a hard
enough time as it is!



thanks -
Cherry
(http://jquery.cherryaustin.com)




[jQuery] Re: jQuery style guide?

2008-04-20 Thread [EMAIL PROTECTED]

You are correct in this case, Scott. I tend to do my CSS
'automatically' these days (though it was as tricky to learn, in the
beginning, as this is!) and probably don't think often enough about
the rules.

In far more general terms, however, I really do believe a style guide
for jQuery beginners is desperately needed! Surely the purpose of a
Javascript library is to make js wizadry more available to all - yet
there's virtually NO documentation suitable for newcomers such as
myself.

If it weren't for this group, I'd have abandoned jQuery & gone for
MooTools months ago. Moo, being older, comes with a far more complete
set of "plug'n'play" actions; the core itself is no easier to work
with than jQuery but you can achieve more, faster, by piggybacking on
others' work.

As both a bit of a pedant and an evangelist, I love the opportunity
jQuery - with this group - provides, in terms of learning new skills
and building my own little apps to my own specs :)

But the available guidance for newbies is abysmal. I really can't
overstress the significance of this group!!

So give yourselves a big pat on the back :)
And please try to supress your irritation if I ask a question that
seems elementary to you ;)

Cherry.

On Apr 20, 7:20 pm, Scott González <[EMAIL PROTECTED]> wrote:
> Your problem actually has nothing to do with JavaScript; it is purely
> CSS.
>
> http://www.w3.org/TR/REC-CSS2/selector.html
>
> On Apr 19, 10:38 pm, "[EMAIL PROTECTED]"
>
> <[EMAIL PROTECTED]> wrote:
> > As anyone who's flicked over my beginner's blog will know, jQuery
> > provides a constantly vertical learning curve (!) It isn't made any
> > easier by the lack of basic instruction.
>
> > I realise this is largely because of my very basic Javascript
> > knowledge - but some of the problems I encounter are special to
> > jQuery, and I'd love to know whether somebody has already written a
> > style guide?
>
> > Example: I've just discovered I needed to concatenate a selector.
> > Normally, one can use:
> > $( '#someid .someclass' ) - as advertised by jQuery, the CSS selector.
> > I have a heading + class to select with jQuery. After more than half
> > an hour of failed experiments, I found it must be:
> > $( 'h2.someclass') - as not advertised anywhere that I know of!
>
> > Can I find a reference to this kind of thing?? I'm having a hard
> > enough time as it is!
>
> > thanks -
> > Cherry
> > (http://jquery.cherryaustin.com)


[jQuery] IE debugging advice, please

2008-04-20 Thread [EMAIL PROTECTED]

As I stumble towards discovery of jQuery and all things Javascript, I
frequently get knocked down by IE ;) It throws fatal errors far more
often than Firefox (whose debugger I can understand) but IE's debug
option invariably points to an 'error' in the jQuery core. I assume
that's not the *real* error; just the point in the main script at
which *my* script caused a fault.

Please could someone point me towards a better debugger for ie?
I should emphasise that I really am floundering in the dark here.
Ideally, I need something dead simple. I can't even use Firebug
properly!

Any & all advice much appreciated, as ever :)
Cherry.


[jQuery] Re: Ajax Calls + IE Issues

2008-04-20 Thread Damian

Ok, figured this out.  IE is caching the previously called data.  The
AJAX calls are using get instead of post.  Simple fix...a timestamp
has been added to the end of my ajax call. This ensures that the page
url is always different.  IE will not use its cached data any longer.
Hope this helps someone.

On Apr 20, 3:24 pm, Damian <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I'm currently developing a small web application and IE (6 & 7 tested)
> is not functioning as expected when submitting information via AJAX.
> In each case, the data to be submited is being sent via a form that is
> brought into the page with a previous AJAX call.
>
> All other browsers (Firefox, Opera & Safari) that have been tested
> with the application function as expected.
>
> For example, A user is able to tag content created by them or sent to
> them from another user.  A tag link is provided.  When clicked it
> pulls in a form via the .load function that allows the user to enter
> tags and update.
>
> Lets say this is the first time that the user has tagged this item.
> The form displays and the input field is blank.  The user enters data
> into the form and clicks the update button.  The database is updated
> and all seems well. But, if the user clicks the "Tag" link again, the
> form displays in its original state (i.e. Blank).  In all other
> browsers, when clicked again, the form displays the data that the user
> previously submitted.  The only way to get IE to display the updated
> data is to clear its cache.
>
> How can I ensure that IE displays the updated form each time it is
> called?
>
> Here is the jQuery code:
>
> $("a.tag").click(function(){
>
> var y = $(this).attr("id");
> var i = y.split(".");
> var url = "http://www.siteurl.com/showtags/"; + i[2];
> $("div.message_forward").hide();
> $("div.message_tags").hide();
> $("div.message_publish").hide();
> $("div.loadoption:eq(" + i[1] + ")").toggle();
> $("div.message_tags:eq(" + i[1] + ")").load(url, function(){
> $("div.message_tags:eq(" + i[1] + ")").fadeIn("slow");
> $("div.loadoption:eq(" + i[1] + ")").toggle();
> $("form.tagtag").ajaxForm(updateTagOptions);
>
> }
> );
> return false;
>
> });
>
> var updateTagOptions = {
>
> success: tagResponse,
> resetForm: false};
>
> function tagResponse(responseText, statusText)  {
>
>  $(".message_tags").fadeOut("slow");
>
> }
>
> $("form.tagtag").submit(function(){
>
> $(this).ajaxSubmit(updateTagOptions);
> return false;});


[jQuery] Re: Adding load to ajax POST function

2008-04-20 Thread hubbs



On Apr 20, 3:28 pm, Sephi-Chan <[EMAIL PROTECTED]> wrote:
> Hello,
>
> You can look the code of the load function in the jQuery source. It's what i
> did few days ago whereas i want do this (filter the response).
>
> I make something like this :
>
> $.ajax({
>         url : 'remotePage.php',
>         dataType : 'html',
>         complete : function(response){
>
>                 var filteredResponse = jQuery("").append(
>                         response.responseText.replace(
>                                 //g,
>                                 ""
>                         )
>                 ).find('div#ajax');
>
>                 $('div#ajaxContent').append((html));            
>         }
>
> });
>
> This script take only the text which is in the div#ajax bloc in the remote
> page. Then this content is put in the div#ajaxContent of the calling page.
>
> Sephi-Chan
> --


For some reason this is not working for me.  Is this script correct?

Also, it seems that the jquery load function is so nice and clean, is
there no way to do something similar when using the ajax get?


[jQuery] Load image without html page

2008-04-20 Thread hubbs

I was trying to figure out if it is possible to use ajax to just load
in an image, rather than loading in an html page that contains the
image tag?  I know that there is a way to assemble the tag, and then
write it, but I am not sure.  Any help using jquery?


[jQuery] Re: Error-Message: is not a function

2008-04-20 Thread Ryura

If I recall correctly, match() always returns an array. Try:
catid = $(this).attr("name").match(/\[.+\]/)
[0];

On Apr 20, 3:41 pm, Sen <[EMAIL PROTECTED]> wrote:
> No ideas?


[jQuery] jQuery Form Builder

2008-04-20 Thread Web Specialist
Hi all

After some search I found 2 examples about jQuery Form Builder:

- http://www.phpletter.com/form_builder/demo.html

- http://elpaso.homelinux.org/formbuilder/

All very nice but impossible to download form builded.

Somebody knows another examples related to Form Builder in jQuery?

Cheers
Marco Antonio


[jQuery] Re: Adding load to ajax POST function

2008-04-20 Thread Sephi-Chan


Hello,

You can look the code of the load function in the jQuery source. It's what i
did few days ago whereas i want do this (filter the response).

I make something like this :

$.ajax({
url : 'remotePage.php',
dataType : 'html',
complete : function(response){

var filteredResponse = jQuery("").append(
response.responseText.replace(
//g,
""
)
).find('div#ajax');

$('div#ajaxContent').append((html));
}
});

This script take only the text which is in the div#ajax bloc in the remote
page. Then this content is put in the div#ajaxContent of the calling page.


Sephi-Chan
-- 
View this message in context: 
http://www.nabble.com/Adding-load-to-ajax-POST-function-tp16799597s27240p16799706.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Ajax Calls + IE Issues

2008-04-20 Thread Damian

Hello,

I'm currently developing a small web application and IE (6 & 7 tested)
is not functioning as expected when submitting information via AJAX.
In each case, the data to be submited is being sent via a form that is
brought into the page with a previous AJAX call.

All other browsers (Firefox, Opera & Safari) that have been tested
with the application function as expected.

For example, A user is able to tag content created by them or sent to
them from another user.  A tag link is provided.  When clicked it
pulls in a form via the .load function that allows the user to enter
tags and update.

Lets say this is the first time that the user has tagged this item.
The form displays and the input field is blank.  The user enters data
into the form and clicks the update button.  The database is updated
and all seems well. But, if the user clicks the "Tag" link again, the
form displays in its original state (i.e. Blank).  In all other
browsers, when clicked again, the form displays the data that the user
previously submitted.  The only way to get IE to display the updated
data is to clear its cache.

How can I ensure that IE displays the updated form each time it is
called?



Here is the jQuery code:

$("a.tag").click(function(){

var y = $(this).attr("id");
var i = y.split(".");
var url = "http://www.siteurl.com/showtags/"; + i[2];
$("div.message_forward").hide();
$("div.message_tags").hide();
$("div.message_publish").hide();
$("div.loadoption:eq(" + i[1] + ")").toggle();
$("div.message_tags:eq(" + i[1] + ")").load(url, function(){
$("div.message_tags:eq(" + i[1] + ")").fadeIn("slow");
$("div.loadoption:eq(" + i[1] + ")").toggle();
$("form.tagtag").ajaxForm(updateTagOptions);

}
);
return false;

});



var updateTagOptions = {

success: tagResponse,
resetForm: false
};
function tagResponse(responseText, statusText)  {

 $(".message_tags").fadeOut("slow");
}

$("form.tagtag").submit(function(){

$(this).ajaxSubmit(updateTagOptions);
return false;});




[jQuery] Adding load to ajax POST function

2008-04-20 Thread hubbs

I am using the ajax POST from the examples on the jQuery site.

$.ajax({
   type: "POST",
   url: "some.php",
   data: "name=John&location=Boston",
   success: function(html){
$("#results").append(html);
   }
 });

I would like to add the "load" option onto this, so that I filter the
server response, and only return a specific ID:

$("#results").load("test.html #testing2");

How would I use these 2 together, to achieve what I am needing?


[jQuery] Re: Trouble with attr() and IE7, and onclick...

2008-04-20 Thread vincehofmeister

Anyone?


[jQuery] REMINDER: jQuery Site Detection Greasemonkey Script

2008-04-20 Thread Rey Bango


Hi everyone. The number of jQuery-powered sites being listed is
incredible and the numbers just continue to grow.

One of the methods that I use to find sites is via jQuery Team Member 
Paul Bakaus' awesome jQuery Site Detection Greasemonkey Script. It's a 
small script that detects the jQuery object and displays a small icon in 
the lower-right corner of the browser if it finds a jQuery-powered site.


To install it, just follow these simple instructions:

This is a Greasemonkey user script.  To install it, you need
Greasemonkey 0.3 or later: http://greasemonkey.mozdev.org/

Restart Firefox and visit this script:
http://paul.jquery.com/jquerydetector.user.js

Under Tools, there will be a new menu item to "Install User Script".
Accept the default configuration and install.

That's it!

I want to thank Paul for this wonderful script.

Rey...
jQuery Project Team


[jQuery] Re: jQuery in the wild

2008-04-20 Thread Shelane

I just noticed the MLB thing.  I was checking out the Giants and Cards
today on gameday and cheked firebug and say jQuery.  That's awesome!!!

On Mar 23, 8:39 pm, "Benjamin Sterling"
<[EMAIL PROTECTED]> wrote:
> Looks like MLB.com and in turnhttp://phillies.comare now using jQuery
> 1.2.1, looks like they are using jcarousel and corners.
> --
> Benjamin 
> Sterlinghttp://www.KenzoMedia.comhttp://www.KenzoHosting.comhttp://www.benjaminsterling.com


[jQuery] Re: ui.tabs + ajax question

2008-04-20 Thread Alexandre Plennevaux

Hi Klaus, i've updated the wiki, if you want to double check:
http://docs.jquery.com/UI/Tabs


Cheers !

Alexandre

On Sat, Apr 19, 2008 at 12:50 PM, Klaus Hartl
<[EMAIL PROTECTED]> wrote:
>
>  On Apr 19, 8:42 am, "Alexandre Plennevaux" <[EMAIL PROTECTED]>
>  wrote:
>
> > hey hey, good to know. Is this actually documented somewhere or do you
>  > want me to complete the wiki ?
>
>  I haven't documented that. Would be nice if you would do it...
>  appreciated!
>
>
>  --Klaus
>



-- 
Alexandre Plennevaux
LAb[au]

http://www.lab-au.com


[jQuery] Re: Problem using html(val) with firefox (works in IE7)

2008-04-20 Thread Eric Fehse

Update: I found the mistake myself: There were two elements with the
same id. Now everything works as expected.

On Apr 19, 5:33 pm, Eric Fehse <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I am writing a little web app that is supposed to show a table as a
> reaction to an ajax call to the server.
>
> So after the ajax post request, the server renders an html-table. This
> table is then inserted in a container div on the page using the
> "html(val)" method.
>
> In IE7 this works fine.
>
> Firefox shows a strangely different behavior: when the ajax call is
> done for the first time, i.e. when the container div is still empty,
> the table is correcty inserted and displayed. But on all subsequent
> calls, the page is not changed.
>
> There are no javascript errors; I checked that the new html table is
> actually passed to the callback function that is supposed to change
> the dom (and as I said: this works in IE).
>
> When I reload the whole page and then trigger the ajax call, the
> correct data are displayed; after that, nothing changes anymore.
>
> Here's my code:
>
> $(document).ready( function() {
> $("button#btn_search").click( function() {
> var search_term = $("input#txt_search").val();
> data = {'search_term': search_term};
> $.post('/voc_lookup/', data, display_results);
> return false;
> });
>
> })
>
> function display_results(data) {
> $("div#results").html(data);
>
> }
>
> The html table that is to be inserted looks like this (django
> template):
> {{cards|length}} Treffer gefunden
> 
> 
> 
> Schwedisch
> Deutsch
> 
> {% for card in cards %}
> 
> {{card.id}}
> {{card.entry_sv}}
> {{card.entry_de}}
> 
> {% endfor %}
> 
>
> On the page is a ""
>
> Does anyone have any idea what the problem might be? Any help will be
> appreciated!
>
> Cheers,
> Eric


[jQuery] Re: Slide Panel

2008-04-20 Thread Jan David

I'm trying to achieve the same, but with an overlayed panel sliding up
from the bottom of the screen. Do you know if that is possible using
this script?

Jan David

On 20 mrt, 21:47, uneuronh <[EMAIL PROTECTED]> wrote:
> hey thanks, it worked :)
>
> On Mar 19, 5:36 am, "Richard D. Worth" <[EMAIL PROTECTED]> wrote:
>
> > Wrap the panel and the button in a div with position:absolute;
>
> > Here's a tutorial:
>
> >http://www.barelyfitz.com/screencast/html-training/css/positioning/
>
> > - Richard
>
> > Richard D. Worthhttp://rdworth.org/
>
> > On Tue, Mar 18, 2008 at 3:19 PM, uneuronh <[EMAIL PROTECTED]>
> > wrote:
>
> > > Hi all,
>
> > > I am working on slide panel similar to
> > >http://www.webdesignerwall.com/demo/jquery/simple-slide-panel.html
>
> > > Problem: The panel which slides down pushes all the div' s in the page
>
> > > Excepted: The panel should act as an overlay on the current page
> > > without pushing any div's down
>
> > > This is my jquery code used
>
> > > $(document).ready(function(){
> > >        $(".btn-slide").click(function(){
> > >                $("#service").slideToggle("slow");
> > >                return false;
> > >        });
> > > });
>
> > > Things tired:
>
> > > I gave z-index to the panel, didnt work , still contents below the
> > > slider  gets pushed down
>
> > > Please give  some reference, where i can read /learn from


[jQuery] Postal Code Validation

2008-04-20 Thread Ian

I've noticed a lot of requests for Postal Code validation. I don't
know if anyone posted one, but here is an addon method I wrote for
Canadian postal codes.

$.validator.addMethod("postalCode", function(value) { // Addon method
for validating postal codes. Valid formats are (X1X 1X1) or (X1X1X1)
or (X1X-1X1).
return value.match(/^[a-zA-Z][0-9][a-zA-Z](-| )?[0-9][a-zA-Z]
[0-9]$/);
}, 'Please enter a valid postal code');


You can then use the rule postalCode:true to validate.


[jQuery] Re: Error-Message: is not a function

2008-04-20 Thread Sen

No ideas?


[jQuery] Re: jQuery Cycle - Manually selecting next slide

2008-04-20 Thread Mindwraps

Splendid !

I was looking for the functionality in the second link you posted.
Navigating via existing markup. Guess I ignored the 'Even more demos'
link at the bottom of your page and had to end up there via this
post :)

In any case, great plugin. Thanks for the great work so far.

On Apr 9, 11:00 pm, "Mike Alsup" <[EMAIL PROTECTED]> wrote:
> >  Thanks for replying. I meant more like using my own anchors to
> >  navigate through the different slides.
>
> That is fully supported.  See these two demos for ideas:
>
> http://www.malsup.com/jquery/cycle/pager2.htmlhttp://www.malsup.com/jquery/cycle/pager3.html


[jQuery] Re: Odd behaviour with the "one()" event handler

2008-04-20 Thread Scott González

Use click instead of mouseup, that's the event that triggers the
default behavior in browsers.


On Apr 20, 3:07 am, Yansky <[EMAIL PROTECTED]> wrote:
> I'm not sure if I'm misinterpreting how to use the "one()" event handler
> properly, but when I tried to use it in the bit of code below, I was unable
> to prevent the button from submitting the form (which it was now inserted
> into). I tried "return false" as well as an "event.preventDefault()", but
> clicking on the button still seemed to submit the form.
>
> The only way I could get it to prevent submitting the form was to use the
> .mouseup() event handler rather than .one().
>
> Why didn't "return false" or "event.preventDefault();" stop the form from
> being submitted?
>
> The piece of code:
>
> $('#modewc').parent().append(' id="remHwb">Remove Word Breaks');
>
> if(!$("[EMAIL PROTECTED]'preview']")[0]){
>
> $('#remHwb').attr('disabled','disabled');
>
> }
>
> else{
> $('#remHwb').one("mouseup", function(e){
>
>e.preventDefault();
>
> var sdf = 
> $.trim($('.bodytext:last>p').html()).split("\xAD\x20")
>
> $('#body').val('');
>
> for(var p=0;p
> if( (p == sdf.length-1) && ((sdf[p].length<34) || 
> (sdf[p].indexOf(' ')>
> 0)) ){
>
> 
> $('#body').val($('#body').val()+sdf[p].replace(RegExp("", "gim"),
> "\n"));
>
> break;
>
> }
> else{
>
> sdf[p] = 
> sdf[p].slice(0,-2)+'[**]'+sdf[p].slice(-1);
>
> }
> sdf[p] = sdf[p].replace(RegExp("", "gim"), "\n");
>
> $('#body').val($('#body').val()+sdf[p]);
>
> }
>
> $(this).attr('disabled','disabled');
>
> return false;
>
> });}
>
> --
> View this message in 
> context:http://www.nabble.com/Odd-behaviour-with-the-%22one%28%29%22-event-ha...
> Sent from the jQuery General Discussion mailing list archive at Nabble.com.


[jQuery] Re: jQuery style guide?

2008-04-20 Thread Scott González

Your problem actually has nothing to do with JavaScript; it is purely
CSS.

http://www.w3.org/TR/REC-CSS2/selector.html


On Apr 19, 10:38 pm, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> As anyone who's flicked over my beginner's blog will know, jQuery
> provides a constantly vertical learning curve (!) It isn't made any
> easier by the lack of basic instruction.
>
> I realise this is largely because of my very basic Javascript
> knowledge - but some of the problems I encounter are special to
> jQuery, and I'd love to know whether somebody has already written a
> style guide?
>
> Example: I've just discovered I needed to concatenate a selector.
> Normally, one can use:
> $( '#someid .someclass' ) - as advertised by jQuery, the CSS selector.
> I have a heading + class to select with jQuery. After more than half
> an hour of failed experiments, I found it must be:
> $( 'h2.someclass') - as not advertised anywhere that I know of!
>
> Can I find a reference to this kind of thing?? I'm having a hard
> enough time as it is!
>
> thanks -
> Cherry
> (http://jquery.cherryaustin.com)


[jQuery] jQuery Question of the Week! Iframes and Loading!

2008-04-20 Thread Joe

So I'm building a custom CMS solution for a site that exclusively uses
jQuery, but the cool part is that the CMS is entirely placed in a
single web page.  I accomplish this by showing and hiding only the
necessary  required for the respective tab that is clicked AND
using a ton of AJAX to interact with the databases.

However, I am recently stumped as to how to get the following to work.

I need the contentWindow height of an iframe.  Sounds easy.  No.  I
keep a variable set called maxHeight so I know what value to change
the height of the "content"  (which holds all other divs)
depending on which tab is clicked (Insert News, Mailing List, etc.).

One of these divs contains an iframe (within the content div) and I
can't seem to get the proper height because it is appears I have wait
for the page to LOAD (and the subsequent iframe to load) before I can
calculate the height.  Well this isn't effective because I need to
know this height when the DOM is READY.

Essentially, I am taking the entire structure of the page and cloning
and placing it in a temporary div.  Then I show all the divs and then
calculate the height of the iframe to get the maxHeight value.
Unfortunately, this is always zero.  Any suggestions?





iframe { display:block; width:100%; border:none;  width:100%; height:
100%;}






function resizeFrame(f)
{
alert(f.contentWindow.document.body.offsetHeight + " is the
offsetheight");
f.style.height = f.contentWindow.document.body.offsetHeight + 'px'  
;
}

$().ready(function(){

$('iframe').load(function()
{
alert('entered');
resizeFrame(this);

});

});











[jQuery] [Announce] jMaps3 RC1 Released

2008-04-20 Thread Tane Piper

Hey folks,

Today I am happy to announce that jMaps version 3 has been released
today.  This version is classed as a release candidate as I have not
confirmed all bugs have been fixed, and some internals might still
change slightly, however the API itself has stabilised.

The plugin now has a proper page with API documentation and demos, and
is available at http://jmaps.digitalspaghetti.me.uk/

The plugin also now more modular, so you can write your own macros
under the $.jmap namespace and call them using the $.jmap() function.
I'll hopefully get some documentation on this written soon too.

Id also like to get more feedback from users on where the plugin works
well and not so well, and improve this for version 3.1.  I'd also
appreciate feedback on the documentation if its not very clear.

-- 
Tane Piper
Blog - http://digitalspaghetti.me.uk
Skype: digitalspaghetti

This email is: [ x ] blogable [ ] ask first [ ] private


[jQuery] Re: Superfish current state

2008-04-20 Thread DRoss

Hey Joel,

I added the code from Stan's site via the link in the other thread:
http://stanlemon.net/index/articles/hiding-a-superfish-menu.html
It is a little buggy like when roll over the main navs too fast they
sometimes get stuck (the subnavs don't always appear as expected).

The site using these Superfish navs is going live soon so, for now,
I'll leave it the way it was and will check back for an update every
so often.

This test page is using the new fade in/fade out script:
http://rossinteractive.com/projects/testnav/

Thanks,
David





[jQuery] Re: Im having trouble with selectors

2008-04-20 Thread alex.allah

You cannot put DD tag into DT.
Look http://www.w3schools.com/TAGS/tag_dd.asp

PS When working with DOM use firebug :)


[jQuery] Re: Im having trouble with selectors

2008-04-20 Thread alex.allah

You cannot put DD tag inside DT
Read: http://www.w3schools.com/TAGS/tag_dd.asp

PS  Use firebug when working with DOM


[jQuery] Re: Im having trouble with selectors

2008-04-20 Thread alex.allah

 tag cannot contain 

Correct structure is:





read: http://www.w3schools.com/TAGS/tag_dd.asp


[jQuery] Re: Which method is better?

2008-04-20 Thread Michael Geary

As always, you would need to run a test to really know which is faster.
Create a large number of elements and try both versions.

My gut sense is that method 1 will be faster. Running the three .each()
loops won't be much different than running the single .each() loop over all
the elements - take a look at the source code for .each() and you'll see
that there isn't much setup overhead, and you are looping over the same
number of elements either way. (I assume the presence of .someClass4 in
method 2 but not method 1 is just a typo.)

However, method 2 has all the extra overhead of making *three* .hasClass()
calls on each element. That's a significant amount of extra overhead.

Method 1 is also cleaner and simpler, and since it's likely to be faster,
it's what I would use.

-Mike

> From: alex.allah
> 
> Method #1
> 
> $('.someClass1').each(function(){
>   // Some stuff here
> });
> 
> $('.someClass2').each(function(){
>   // Some stuff here
> });
> 
> $('.someClass3').each(function(){
>   // Some stuff here
> });
> 
> Method #2
> 
> $('.someClass1, .someClass2, .someClass3, 
> .someClass4').each(function() {
> 
>   var el = $(this);
> 
>   if (el.hasClass('someClass1'))
>   {
>   // Some stuff here
>   }
> 
>   if (el.hasClass('someClass2'))
>   {
>   // Some stuff here
>   }
> 
>   if (el.hasClass('someClass3'))
>   {
>   // Some stuff here
>   }
> });
> 
> 
> Which method is faster and better?
> 



[jQuery] Re: Im having trouble with selectors

2008-04-20 Thread Karl Swedberg


Hi Clint,

The dt element should never be the parent of a dd. Maybe you were  
thinking of dl?


In that case you could select a dl that has a hidden dd descendant  
element this way:


$('dl:has(dd:hidden)').addClass('menu_bg').trigger('click');


--Karl
_
Karl Swedberg
www.englishrules.com
www.learningjquery.com



On Apr 20, 2008, at 1:36 AM, justclint wrote:




Im new to using jquery so forgive my question that is probably so  
simple.


Im trying to select the parent of element that contains a hidden  
element.


In my case I need to grab the dt that contains hidden dd's.

this is what I have but is not working:

$('dt').has('dd:hidden').addClass('menu_bg').trigger('click');

Ive also tried:

$('dd:hidden:parent').addClass('menu_bg').trigger('click');

and Ive tried many other variations but cant seem to get it.

What am I doing wrong?

Thanks in advance!

Cheers,

Clint
--
View this message in context: 
http://www.nabble.com/Im-having-trouble-with-selectors-tp16790638s27240p16790638.html
Sent from the jQuery General Discussion mailing list archive at  
Nabble.com.






[jQuery] Re: jQuery style guide?

2008-04-20 Thread Klaus Hartl

In addition, the W3C specs as a reference:

http://www.w3.org/TR/CSS21/selector.html
http://www.w3.org/TR/css3-selectors/

Not all of the CSS3 selectors are supported though and there are quite
a few non spec selectors added by jQuery. Find out here:

http://docs.jquery.com/Selectors

--Klaus



On Apr 20, 5:57 am, "Karl Rudd" <[EMAIL PROTECTED]> wrote:
> It'd probably be a good idea to brush up on CSS selectors as that's
> how jQuery does it's "selecting":
>
> http://www.westciv.com/style_master/academy/css_tutorial/selectors/in...
>
> Karl Rudd
>
> On Sun, Apr 20, 2008 at 1:38 PM, [EMAIL PROTECTED]
>
> <[EMAIL PROTECTED]> wrote:
>
> >  As anyone who's flicked over my beginner's blog will know, jQuery
> >  provides a constantly vertical learning curve (!) It isn't made any
> >  easier by the lack of basic instruction.
>
> >  I realise this is largely because of my very basic Javascript
> >  knowledge - but some of the problems I encounter are special to
> >  jQuery, and I'd love to know whether somebody has already written a
> >  style guide?
>
> >  Example: I've just discovered I needed to concatenate a selector.
> >  Normally, one can use:
> >  $( '#someid .someclass' ) - as advertised by jQuery, the CSS selector.
> >  I have a heading + class to select with jQuery. After more than half
> >  an hour of failed experiments, I found it must be:
> >  $( 'h2.someclass') - as not advertised anywhere that I know of!
>
> >  Can I find a reference to this kind of thing?? I'm having a hard
> >  enough time as it is!
>
> >  thanks -
> >  Cherry
> >  (http://jquery.cherryaustin.com)


jquery-en@googlegroups.com

2008-04-20 Thread Dmitry Bykadorov

Oh, yes. I'm forget to say about little experiment:

I create local site with one file: http://temp/search.php - it returns
simle html table.

In my app i call this scrip remotely:

$.search = function() {
$.ajax({
url: "http://temp/search.php";,
dataType: "html",


And this works :(


On Apr 19, 7:56 pm, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> Hello Dmitry,
>
> I can't answer you - I know little about jQuery 'Ajax' - but wanted to
> thank you for reducing your question to fewer than 23 posts [grin]!
>
> Hope you now get the reply you're hoping for.
> Cheers,
>
> Cherry.
>
> On Apr 18, 5:25 am, Dmitry Bykadorov <[EMAIL PROTECTED]>
> wrote:
>
>
>
> > Here is my code:
>
> > $.search = function() {
> >     $.ajax({
> >         url: "/search/engine",
> >         dataType: "html",
> >         type: "POST",
> >         timeout: 1,
> >         cache: false,
> >         data: {
> >             a: $("#a").val(),
> >             b: $("#b").val(),
> >             c: $("#c").val(),
> >             page: 1,
> >             records_per_page: 10
> >         },
> >         complete: function(){
> >              // empty now
> >         },
> >         success: function(data, status){
> >             $("#tab1").html(data);
> >         },
> >         error: function(XMLHttpRequest, textStatus, errorThrown){
> >             $("#tab1").html("Search Error > div>");
> >         }
> >     });
>
> > }
>
> > On Apr 18, 12:48 am, Dmitry Bykadorov <[EMAIL PROTECTED]>
> > wrote:
>
> > > Hello all!
>
> > > I have some funny things with jquery.
>
> > > In developing my first application was confronted with such a problem:
> > > $.ajax () incorrectly works in IE6 and IE7.
>
> > > Example 1. jquery.autocomplete plugin. FF, Opera, Safari - all is
> > > well. In IE request sent to the server returns the data (text /
> > > plain), but the data do not appear on the autocomplete box.
>
> > > Example 2. simply jQuery.ajax (). The situation is similar, but I
> > > decided to find a solution. First it turned out that - IE does not
> > > consider a request successfully completed - triggered error callback
> > > (textStatus = parsererror).
>
> > > The sequence of roughly this:
>
> > > about line 2712 (jquery.js) if request successfull, we enter in the
> > > function jQuery.httpData (xml, s.dataType). In this feature, it seems
> > > the problem is in command of these lines:
>
> > > var data = xml ? r.responseXML : r.responseText;
> > > if (xml && data.documentElement.tagName == "parsererror")
> > > (
> > > throw "parsererror";
> > > )
>
> > > in that place I have a xml = false, r.responseText not even displayed
> > > as follows:
>
> > > alert (r.responseText)
>
> > > Does someone have seen such ajax trouble? What it involves, and how to
> > > avoid it?- Hide quoted text -
>
> - Show quoted text -


[jQuery] Re: Traversing AJAX Response?

2008-04-20 Thread Nicolas R

If you convert your response to a jQuery object then yes. So something
like $(response).find('#mylinks') should work, if used in the success
callback function. Your response doesnt need to be in XML, HTML is
just fine.


On Apr 19, 5:46 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> Is it possible to parse the HTML of an AJAX response and grab only a
> certain piece of the response to be displayed by the caller?
>
> Specifically, I'm trying to modify a page so that when I hover over a
> certain set of links, a pop-up window is displayed with the link's
> target in the pop-up.  The problem is that the URL is an entire
> webpage, and I only want to display a certain piece of text from this
> webpage.  Is it possible to traverse the AJAX response using selectors
> so that I can grab a certain div class and display its text?


[jQuery] Im having trouble with selectors

2008-04-20 Thread justclint


Im new to using jquery so forgive my question that is probably so simple. 

Im trying to select the parent of element that contains a hidden element. 

In my case I need to grab the dt that contains hidden dd's. 

this is what I have but is not working:

$('dt').has('dd:hidden').addClass('menu_bg').trigger('click'); 

Ive also tried:

$('dd:hidden:parent').addClass('menu_bg').trigger('click');

and Ive tried many other variations but cant seem to get it. 

What am I doing wrong?

Thanks in advance!

Cheers,

Clint
-- 
View this message in context: 
http://www.nabble.com/Im-having-trouble-with-selectors-tp16790638s27240p16790638.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Odd behaviour with the "one()" event handler

2008-04-20 Thread Yansky

I'm not sure if I'm misinterpreting how to use the "one()" event
handler properly, but when I tried to use it in the bit of code below,
I was unable to prevent the button from submitting the form (which it
was now inserted into). I tried "return false" as well as an
"event.preventDefault()", but clicking on the button still seemed to
submit the form.

The only way I could get it to prevent submitting the form was to use
the .mouseup() event handler rather than .one().

Why didn't "return false" or "event.preventDefault();" stop the form
from being submitted?

The code:

$('#modewc').parent().append('Remove Word Breaks');

if(!$("[EMAIL PROTECTED]'preview']")[0]){

$('#remHwb').attr('disabled','disabled');

}
else{
$('#remHwb').one("mouseup", function(e){

   e.preventDefault();

var sdf = $.trim($('.bodytext:last>p').html()).split("\xAD\x20")

$('#body').val('');

for(var p=0;p 0)) ){


$('#body').val($('#body').val()+sdf[p].replace(RegExp("",
"gim"), "\n"));

break;

}
else{

sdf[p] = 
sdf[p].slice(0,-2)+'[**]'+sdf[p].slice(-1);

}
sdf[p] = sdf[p].replace(RegExp("", "gim"), "\n");

$('#body').val($('#body').val()+sdf[p]);

}

$(this).attr('disabled','disabled');

return false;

});
}


jquery-en@googlegroups.com

2008-04-20 Thread Dmitry Bykadorov

Yes! The problem has solved. The root of the problem in incorrect
encoding in .htaccess file (UTF8 instead UTF-8). Internet Explorer
does not know encoding UTF8 and throws "parsererror" (and shows Error:
system error: -1072896658 in js error window).

On Apr 19, 7:56 pm, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> Hello Dmitry,
>
> I can't answer you - I know little about jQuery 'Ajax' - but wanted to
> thank you for reducing your question to fewer than 23 posts [grin]!
>
> Hope you now get the reply you're hoping for.
> Cheers,
>
> Cherry.
>
> On Apr 18, 5:25 am, Dmitry Bykadorov <[EMAIL PROTECTED]>
> wrote:
>
>
>
> > Here is my code:
>
> > $.search = function() {
> >     $.ajax({
> >         url: "/search/engine",
> >         dataType: "html",
> >         type: "POST",
> >         timeout: 1,
> >         cache: false,
> >         data: {
> >             a: $("#a").val(),
> >             b: $("#b").val(),
> >             c: $("#c").val(),
> >             page: 1,
> >             records_per_page: 10
> >         },
> >         complete: function(){
> >              // empty now
> >         },
> >         success: function(data, status){
> >             $("#tab1").html(data);
> >         },
> >         error: function(XMLHttpRequest, textStatus, errorThrown){
> >             $("#tab1").html("Search Error > div>");
> >         }
> >     });
>
> > }
>
> > On Apr 18, 12:48 am, Dmitry Bykadorov <[EMAIL PROTECTED]>
> > wrote:
>
> > > Hello all!
>
> > > I have some funny things with jquery.
>
> > > In developing my first application was confronted with such a problem:
> > > $.ajax () incorrectly works in IE6 and IE7.
>
> > > Example 1. jquery.autocomplete plugin. FF, Opera, Safari - all is
> > > well. In IE request sent to the server returns the data (text /
> > > plain), but the data do not appear on the autocomplete box.
>
> > > Example 2. simply jQuery.ajax (). The situation is similar, but I
> > > decided to find a solution. First it turned out that - IE does not
> > > consider a request successfully completed - triggered error callback
> > > (textStatus = parsererror).
>
> > > The sequence of roughly this:
>
> > > about line 2712 (jquery.js) if request successfull, we enter in the
> > > function jQuery.httpData (xml, s.dataType). In this feature, it seems
> > > the problem is in command of these lines:
>
> > > var data = xml ? r.responseXML : r.responseText;
> > > if (xml && data.documentElement.tagName == "parsererror")
> > > (
> > > throw "parsererror";
> > > )
>
> > > in that place I have a xml = false, r.responseText not even displayed
> > > as follows:
>
> > > alert (r.responseText)
>
> > > Does someone have seen such ajax trouble? What it involves, and how to
> > > avoid it?- Hide quoted text -
>
> - Show quoted text -


[jQuery] Which method is better?

2008-04-20 Thread alex.allah

Method #1

$('.someClass1').each(function(){
// Some stuff here
});

$('.someClass2').each(function(){
// Some stuff here
});

$('.someClass3').each(function(){
// Some stuff here
});

Method #2

$('.someClass1, .someClass2, .someClass3, .someClass4').each(function()
{

var el = $(this);

if (el.hasClass('someClass1'))
{
// Some stuff here
}

if (el.hasClass('someClass2'))
{
// Some stuff here
}

if (el.hasClass('someClass3'))
{
// Some stuff here
}
});


Which method is faster and better?


jquery-en@googlegroups.com

2008-04-20 Thread Dmitry Bykadorov

Cherry, no thanks :) I don't know how this bug appears - in other
thread also (IE XML Parsing problem from newb).

Now about my ajax issue - simple example works fine. But when i try it
wit my zend framework app - it doesn't work. I'm spent many hours and
going crazy :(


On Apr 19, 7:56 pm, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> Hello Dmitry,
>
> I can't answer you - I know little about jQuery 'Ajax' - but wanted to
> thank you for reducing your question to fewer than 23 posts [grin]!
>
> Hope you now get the reply you're hoping for.
> Cheers,
>
> Cherry.
>
> On Apr 18, 5:25 am, Dmitry Bykadorov <[EMAIL PROTECTED]>
> wrote:
>
>
>
> > Here is my code:
>
> > $.search = function() {
> >     $.ajax({
> >         url: "/search/engine",
> >         dataType: "html",
> >         type: "POST",
> >         timeout: 1,
> >         cache: false,
> >         data: {
> >             a: $("#a").val(),
> >             b: $("#b").val(),
> >             c: $("#c").val(),
> >             page: 1,
> >             records_per_page: 10
> >         },
> >         complete: function(){
> >              // empty now
> >         },
> >         success: function(data, status){
> >             $("#tab1").html(data);
> >         },
> >         error: function(XMLHttpRequest, textStatus, errorThrown){
> >             $("#tab1").html("Search Error > div>");
> >         }
> >     });
>
> > }
>
> > On Apr 18, 12:48 am, Dmitry Bykadorov <[EMAIL PROTECTED]>
> > wrote:
>
> > > Hello all!
>
> > > I have some funny things with jquery.
>
> > > In developing my first application was confronted with such a problem:
> > > $.ajax () incorrectly works in IE6 and IE7.
>
> > > Example 1. jquery.autocomplete plugin. FF, Opera, Safari - all is
> > > well. In IE request sent to the server returns the data (text /
> > > plain), but the data do not appear on the autocomplete box.
>
> > > Example 2. simply jQuery.ajax (). The situation is similar, but I
> > > decided to find a solution. First it turned out that - IE does not
> > > consider a request successfully completed - triggered error callback
> > > (textStatus = parsererror).
>
> > > The sequence of roughly this:
>
> > > about line 2712 (jquery.js) if request successfull, we enter in the
> > > function jQuery.httpData (xml, s.dataType). In this feature, it seems
> > > the problem is in command of these lines:
>
> > > var data = xml ? r.responseXML : r.responseText;
> > > if (xml && data.documentElement.tagName == "parsererror")
> > > (
> > > throw "parsererror";
> > > )
>
> > > in that place I have a xml = false, r.responseText not even displayed
> > > as follows:
>
> > > alert (r.responseText)
>
> > > Does someone have seen such ajax trouble? What it involves, and how to
> > > avoid it?- Hide quoted text -
>
> - Show quoted text -


[jQuery] Drupal jQuery plugin wrapper

2008-04-20 Thread Hans Riemenschneider
Hi Group!

I've been struggling with implementing jQuery plugins into Drupal 6. I've
spent a day and a half attempting various means of creating the wrapper
Drupal will understand.

Also, which is the preferred method (and when?)
drupal_add_js http://api.drupal.org/api/function/drupal_add_js/6
jQuery plugins module http://drupal.org/project/jquery_plugin

If anyone who has installed a jQuery plugin into a Drupal 6 site could
please dumb down the process for me, I'd be very grateful.

Thank you!


[jQuery] Re: DataTables plugin

2008-04-20 Thread fbloggs

It's ok - but not as nice as Ingrid or Flexigrid.


On Apr 17, 1:02 am, theallan <[EMAIL PROTECTED]> wrote:
> Hello all,
>
> I've recently being trying out jQuery for the first time and it has been
> absolutely outstanding. I'm currently working on a project that needs tables
> with filter, pagination, sorting etc, and I found that no one plugin does
> all of this, so I thought it would be interesting to try and create my own.
>
> As a result I've bashed out the DataTables plugin, and I thought it'd post
> it to see what you all think!
>
> http://plugins.jquery.com/project/DataTables
>
> Thanks
> Allan
>
> --
> View this message in 
> context:http://www.nabble.com/DataTables-plugin-tp16673213s27240p16673213.html
> Sent from the jQuery General Discussion mailing list archive at Nabble.com.


[jQuery] Re: deferring script loading

2008-04-20 Thread Christof Donat

Hi,

> Thanks, it seems to have worked:-)
> I suppose it doesn't harm to set the time interval to a value greater
> than 10, right?

Of course not. That just increases the time between the moment, jQuery is 
available and the moment your code is evaluated. It should still work of 
course.

Christof




[jQuery] Odd behaviour with the "one()" event handler

2008-04-20 Thread Yansky


I'm not sure if I'm misinterpreting how to use the "one()" event handler
properly, but when I tried to use it in the bit of code below, I was unable
to prevent the button from submitting the form (which it was now inserted
into). I tried "return false" as well as an "event.preventDefault()", but
clicking on the button still seemed to submit the form.

The only way I could get it to prevent submitting the form was to use the
.mouseup() event handler rather than .one(). 

Why didn't "return false" or "event.preventDefault();" stop the form from
being submitted?

The piece of code:

$('#modewc').parent().append('Remove Word Breaks');

if(!$("[EMAIL PROTECTED]'preview']")[0]){

$('#remHwb').attr('disabled','disabled');

}
else{
$('#remHwb').one("mouseup", function(e){

   e.preventDefault();

var sdf = $.trim($('.bodytext:last>p').html()).split("\xAD\x20")

$('#body').val('');

for(var p=0;p
0)) ){


$('#body').val($('#body').val()+sdf[p].replace(RegExp("", "gim"),
"\n"));

break;

}   
else{

sdf[p] = 
sdf[p].slice(0,-2)+'[**]'+sdf[p].slice(-1); 

}
sdf[p] = sdf[p].replace(RegExp("", "gim"), "\n");

$('#body').val($('#body').val()+sdf[p]);

}   

$(this).attr('disabled','disabled');

return false;

});
}
-- 
View this message in context: 
http://www.nabble.com/Odd-behaviour-with-the-%22one%28%29%22-event-handler-tp16790652s27240p16790652.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: Traversing AJAX Response?

2008-04-20 Thread Yansky


It's possible to traverse the AJAX response using selectors if the ajax
response is in XML format. If it's just a string of html code, then you will
have to use string methods to get the piece of html you're after.
http://www.w3schools.com/jsref/jsref_obj_string.asp

I usually do something like this:

ajaxStringResponse.split('')[1].split('')[0];


[EMAIL PROTECTED] wrote:
> 
> 
> Is it possible to parse the HTML of an AJAX response and grab only a
> certain piece of the response to be displayed by the caller?
> 
> Specifically, I'm trying to modify a page so that when I hover over a
> certain set of links, a pop-up window is displayed with the link's
> target in the pop-up.  The problem is that the URL is an entire
> webpage, and I only want to display a certain piece of text from this
> webpage.  Is it possible to traverse the AJAX response using selectors
> so that I can grab a certain div class and display its text?
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Traversing-AJAX-Response--tp16789239s27240p16790651.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.