[jQuery] Get input value from a loaded page

2008-05-17 Thread dearste

Hi all,
i have load into div a page:

$("#top").load("top.html");

Into top.html thare's a finput like this:



How can i do for retrieve some input value??
I have try this

var numsg = $("#counter").val();

but not work.

Thanks.


[jQuery] $.get work in firefox not IE?

2008-05-17 Thread robert123


Hi, I use the below code to get some html codes from a 'url' and then
write into a div messages

$.get(url,{},function(data) {

 $('#messages').html(data);
 });


it will work well in firefox, but for IE, it will not show the html
data although it is getting data from the url, anyone knows the
reason? thanks



www.generics.ws
www.genericsmed.com


[jQuery] Re: Corners and IE 7 problem

2008-05-17 Thread Kyle

 http://epistemicdev.info/lsn/test.php

For the curious. First is an unordered list with floats. Second is an
unordered list with block display. Third is a handful of floating
divs. Perfect in FF, Safari. Struggles in IE.


[jQuery] Re: Corners and IE 7 problem

2008-05-17 Thread Kyle

Well the problem, as far as I can tell, is that the li items are
floats instead of blocks.



[jQuery] Re: Can jquery change the period in an OL to a hypen?

2008-05-17 Thread Karl Swedberg


Hi Eric,

Another way you could go about this is to continue using the  but  
hide the numbers through CSS:


ol {
list-style: none;
}

Then you could prepend the number with the hyphen to each 

Inside a document ready, you could do something like this (untested):

$('li').each(function(index) {
$(this).prepend( (index+1998) + ' - ');
});


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



On May 17, 2008, at 2:00 PM, EricC wrote:



Thank you so much for this example. It works quite well on the content
of the  but it does not modify the behavior of the  meaning
that period stays. Ah well I thought it was a long shot, I guess I am
going with a table, lol.




[jQuery] Re: Can jquery change the period in an OL to a hypen?

2008-05-17 Thread EricC

Thank you so much for this example. It works quite well on the content
of the  but it does not modify the behavior of the  meaning
that period stays. Ah well I thought it was a long shot, I guess I am
going with a table, lol.


[jQuery] Corners and IE 7 problem

2008-05-17 Thread Kyle

I've used the jQuery Corner plugin for some time now and have always
had an easy time. However, for some reason, I'm running into trouble
now.

The code works perfectly in FF/win, FF/mac, Safari/mac but not IE7/win
(haven't tested anything else). In IE7/win it will only apply the
corners to the side of the element that corresponds to the text
alignment.

For instance:

 $("#tabs ul li").corner("top 8px");

Will round the top left corner only when #tabs ul { text-align:
left; }. If centered, the corners apply to both the top left and top
right, but they're centered and reversed (very odd).

Here's everything:

#tabs{
margin-top: 10px;
}
#tabs ul{
margin-left: 50px;
text-align:left;
}
#tabs ul li{
float:left;
margin: 0px 
10px;

background-color: #454545;
}
#tabs ul 
li.active,#tabs ul li.active a,#tabs ul li.hover,#tabs
ul li.hover a{

background-color: #93DAFF;
color: #454545;
}
#tabs ul li a{
color: 
#fff;

font-weight: bold;

letter-spacing: 1px;
}
#tabs 
ul li a span{

display:block;

padding: 12px 18px;
}



Yale 
University
Applications
Statistics
Ciolli
OCI



Any ideas?


[jQuery] Re: Any way to avoid having this IE warning message?

2008-05-17 Thread Michael Geary

The idea with setTimeout is not to wait until the page loads - you don't
have to guess at a specific timeout value - but to simply break up a long
script into pieces that don't have to all run at once. The typical
setTimeout interval for this purpose is 1 millisecond, i.e. the shortest
possible timeout.

IOW, if a script has to do a thousand things, have it do a hundred of them,
then a short timeout, then another hundred, another timeout, etc.

However, for what you're trying to do here, that doesn't sound like the
right way to fix it. I would use event delegation instead. Simply set a
*single* .click and .blur handler on the document body or on some element
that contains your table code, and inside the handlers, check to see if the
element that was clicked or blurred is one you're interested in.

A direct translation of your code would look something like this:

$(function() {
$('body')
.click( function( event ) {
var $target = $(event.target);
if( $target.is('.updateBtn') ) {
varrowId = $target.parents('tr').attr('id');
saveRow(rowId);
alert('ItemUpdated');
}
})
.blur( function( event ) {
var $target = $(event.target);
if( $target.is('tr.rowData:text, tr.rowData textarea') ) {
varid = $target.parents('tr').attr('id');
saveRow(id);
}
});
});

(Well, a direct translation with a couple of liberties - I used the shorter
form of $(document).ready, and I compulsively changed the double quotes to
single quotes - which I recommend getting in the habit of doing, so when you
generate HTML code from your JS code, you can use double quotes in the HTML
without messy escaping.)

As you can see, the code sets a single handler each for .click and .blur on
the BODY element. (You could use any other element that contains your
table.) It uses event.target to get the element that was actually clicked or
blurred, and then .is() to test the element against your original selectors.
This will ignore clicks and blurs on other elements and process the ones for
the elements you're interested in.

I tried to understand the use of the varrowId, rowId, varid, and id
variables but couldn't make any sense of them. Are there some typos in
there, and missing "var" declarations? Or are those supposed to be global
variables?

Reading between the lines, I'm guessing that the actual intent of the code
may be more like this:

$(function() {
$('body')
.click( function( event ) {
var $target = $(event.target);
if( $target.is('.updateBtn') ) {
save( $target );
}
})
.blur( function( event ) {
var $target = $(event.target);
if( $target.is('tr.rowData:text, tr.rowData textarea') ) {
save( $target );
}
});

function save( $target ) {
saveRow( $target.parents('tr').attr('id') );
}
});

Does that look like what you want?

-Mike

> From: [EMAIL PROTECTED]
> 
> Thanks for the link and your response, but I guess I'm slow.  
> I have two event handlers (click and blur) that I want to 
> definite within my document.ready function.  How am I 
> supposed to use setTimeout?  How do I how long to set the 
> timeout for if I don't know how long it will take for the 
> page to load?

> On May 16, 4:09 pm, "Karl Rudd" <[EMAIL PROTECTED]> wrote:
> > "Chunk" the code up using setTimeout().
> >
> > 
> http://groups.google.com/group/jquery-en/browse_thread/thread/
> aabbe7e...
> >

> > On Sat, May 17, 2008 at 5:56 AM, [EMAIL PROTECTED]
> >
> > > I have a page has a lot of data and can run slowly.  As soon as I 
> > > try and load this page, IE tells me
> >
> > >http://screencast.com/t/mXOBRKW1T2
> >
> > > (the script is causing this page to run slowly, 
> continue?).  Anyway, 
> > > I notice when I take out this block of JQuery code, the message
> > > disappears:
> >
> > >        $(document).ready(function() {
> > >                $('.updateBtn').click(function(){
> > >                        var rowId = $(this).parents("tr").attr("id");
> > >                        saveRow(rowId);
> > >                        alert("Item Updated");
> > >                });
> >
> > >                $('tr.rowData :text, tr.rowData
textarea').blur(function() {
> > >                        var id = $(this).parents("tr").attr("id");
> > >                        saveRow(id);
> > >                });
> > >        });
> >
> > > Unfortunately, I need this code because I want to define these 
> > > behaviors on my page.  Is there a way to rewrite the 
> > > above so that IE doesn't complain?



[jQuery] Re: [blockUI] proposed IE6 patch to allowBodyStretch option

2008-05-17 Thread Mike Alsup

> I've downloaded the latest blockUI code and despite using the new
> allowBodyStretch option, the overlay still will not completely cover
> the viewport in IE6, for short pages.

Hi Brian,

I'm not seeing the same problem as you describe.  Does this page work for you:

http://www.malsup.com/jquery/block/small.html

In my testing with IE6, the entire window is blocked.  In fact, the
block is actually a bit too tall.


> $('html,body').height($(window).height());

I don't believe this will work correctly if the page is resized while
a block is active.  Can you confirm?

Mike


[jQuery] Re: Any way to avoid having this IE warning message?

2008-05-17 Thread [EMAIL PROTECTED]

Hi,

Thanks for the link and your response, but I guess I'm slow.  I have
two event handlers (click and blur) that I want to definite within my
document.ready function.  How am I supposed to use setTimeout?  How do
I how long to set the timeout for if I don't know how long it will
take for the page to load?

Thanks ,- Dave

On May 16, 4:09 pm, "Karl Rudd" <[EMAIL PROTECTED]> wrote:
> "Chunk" the code up using setTimeout().
>
> http://groups.google.com/group/jquery-en/browse_thread/thread/aabbe7e...
>
> Karl Rudd
>
> On Sat, May 17, 2008 at 5:56 AM, [EMAIL PROTECTED]
>
>
>
> <[EMAIL PROTECTED]> wrote:
>
> > Hi,
>
> > I have a page has a lot of data and can run slowly.  As soon as I try
> > and load this page, IE tells me
>
> >http://screencast.com/t/mXOBRKW1T2
>
> > (the script is causing this page to run slowly, continue?).  Anyway, I
> > notice when I take out this block of JQuery code, the message
> > disappears:
>
> >        $(document).ready(function() {
> >                $('.updateBtn').click(function(){
> >                        var rowId = $(this).parents("tr").attr("id");
> >                        saveRow(rowId);
> >                        alert("Item Updated");
> >                });
>
> >                $('tr.rowData :text, tr.rowData
> > textarea').blur(function() {
> >                        var id = $(this).parents("tr").attr("id");
> >                        saveRow(id);
> >                });
> >        });
>
> > Unfortunately, I need this code because I want to define these
> > behaviors on my page.  Is there a way to rewrite the above so that IE
> > doesn't complain?
>
> > Thanks, - Dave- Hide quoted text -
>
> - Show quoted text -


[jQuery] Re: Concat

2008-05-17 Thread Tane Piper

var imagename = $('a').attr('href');
var newname = 'M' + imagename;
$('a').attr('href', newname);

eppytx wrote:
> I have the following jquery in an "gallery" page:
>
> $(document).ready(function(){
>   $("#thumbnail a").click(function(){
>   $("#picture a").attr({"href": $(this).attr("href")});
>   $("#picture img").attr({"src": $(this).attr("href"), "title": 
> $(">
> img", this).attr("title")});
>   $("#picture h2").html($("> img", this).attr("title"));
>   return false;
>   });
>   $("#picture>img").load(function(){$
> ("#picture>img:hidden").fadeIn("slow")});
> });
>
>
> The page has a list of thumbnails going down the right side, and when
> clicking on the tn, this jquery will put the larger image in the
> middle of the page (id=picture).  Currently it will put the href from
> the tn into the ("#picture a").attr above, , but I
> want to be able to slightly change the href by adding a "M" to the
> front, .
>
> So the question is how can I concatenate a letter to the front of the
> href attribute?
>
> I am new to query & jquery, I can read it enough to somewhat tell what
> it is doing, but don't know enough to do much changing.
>
> I appreciate any help any one can offer.
>
> Thanks
> jimmy
>   



[jQuery] Re: Turn off Cache Busting in $.getScript

2008-05-17 Thread JoeM

So then since the cross domain scripts are fetched by adding a script
tag.

All of the above methods for turning caching on/off via the ajax
settings do not apply?

The cross domain script acquisition appears to ALWAYS have the cache
busting on.

Is there a place to request as a feature maybe in next release - or
when appropriate - a new parmenter
for $.getScript() that could turn off cache busting even for the cross
domain case.

Thanks!
Joe

On May 15, 12:28 pm, "Mike Alsup" <[EMAIL PROTECTED]> wrote:
> > Can you clarify if - in FACT- setting cache:true will affect
> > $.getScript() when it is getting the script from a different domain?
> > (and perhaps what technique $.getScript uses under the covers for the
> > cross domain case?)
>
> > Also - the direct use of the cache parameter in an $.ajax( options) -
> > call - certainly will not work Cross Domain right?
>
> > Is there a reason there cannot be a separate cache parameter in
> > $.getScript() in future that handles both same domain and cross domain
> > cases?
>
> The answers are in the code.
>
> $.getScript calls $.ajax (via $.get)
> $.ajax always uses $.ajaxSettings for default settings
> $.ajax always turns off caching when requesting scripts
> cross domain scripts are fetched using a script tag
> same domain scripts are fetched via XHR


[jQuery] Concat

2008-05-17 Thread eppytx

I have the following jquery in an "gallery" page:

$(document).ready(function(){
$("#thumbnail a").click(function(){
$("#picture a").attr({"href": $(this).attr("href")});
$("#picture img").attr({"src": $(this).attr("href"), "title": 
$(">
img", this).attr("title")});
$("#picture h2").html($("> img", this).attr("title"));
return false;
});
$("#picture>img").load(function(){$
("#picture>img:hidden").fadeIn("slow")});
});


The page has a list of thumbnails going down the right side, and when
clicking on the tn, this jquery will put the larger image in the
middle of the page (id=picture).  Currently it will put the href from
the tn into the ("#picture a").attr above, , but I
want to be able to slightly change the href by adding a "M" to the
front, .

So the question is how can I concatenate a letter to the front of the
href attribute?

I am new to query & jquery, I can read it enough to somewhat tell what
it is doing, but don't know enough to do much changing.

I appreciate any help any one can offer.

Thanks
jimmy


[jQuery] Re: Can jquery change the period in an OL to a hypen?

2008-05-17 Thread bjorsq


Try this:

$(document).ready(function() {
$('ol li').each(function() {
$(this).html($(this).html().replace('/\./', ' -'));
});
});

What this does is go through all li elements of all ol lists and perform a
String.replace() on the existing content ($(this).html()) and replace the
existing content with the result. The regex replaces the first period with a
space, followed by a hyphen. To replace all periods, use the g modifier
(/\./g), or you could be more specific for your example by requiring the
year (/^([0-9]{4})\./ - I know this only matches 4 digit numbers, so doesn't
validate years, but this is just an example!)




EricC-3 wrote:
> 
> 
> So the title says it all pretty much. I have a design and I need to
> have some running numbers along the side of a list. An ol would be
> perfect and it is rendering:
> 
> 1998. Item 1
> 1999. Item 2
> 
> To match the designs I need it to be:
> 
> 1998 - Item 1
> 1999 - Item 2
> 
> I could just make a table but it would be cooler if I could change it
> somehow. I have spent an hour or so looking around and  there does not
> seem to be a CSS/HTML way.
> 
> Cheers.
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Can-jquery-change-the-period-in-an-OL-to-a-hypen--tp17290680s27240p17292847.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] [Announce] Password Strength Meter 2 release

2008-05-17 Thread Tane Piper

Hey folks,

Just a quick update to let you all know that I've released a new version
of my password strength meter plugin:

http://digitalspaghetti.me.uk/2008/05/new-password-strength-meter-released/

This version has a lot of improvements over the last few versions, and
now includes a method within the name space to add your own custom
validation methods, like so:

digitalspaghetti.password.addRule('twelvechar', function (word, score) {
return word.length >= 12 && score;
}, 3, true);

This would return true once the word is >= 12 chars, and returns a score
of 3.  The final true makes sure the validation method is added to the
list.  You can write any type of validation rule here you like, and even
override existing ones.  This was inspired by Jorn's validation plugin,
and the whole re-write was inspired by Doug Crockford's videos on YUI -
I suggest anyone serious about JavaScript development to check them out.

Any comments and feedback are welcome.



Tane Piper
Freelance Developer
http://digitalspaghetti.me.uk


[jQuery] Re: Autocomplete - is bgiframe required?

2008-05-17 Thread Aaron Barker

I just submitted a bug on this a few days ago, which also contains a
fix for it

http://dev.jquery.com/ticket/2866

Copied here for posterity

Line 634 is currently:

list.bgiframe();

and should be

if($.fn.bgIframe) list.bgiframe();

On May 16, 12:28 pm, rolfsf <[EMAIL PROTECTED]> wrote:
> I'm getting a javascript error in Firefox (list.bgiframe is not a
> function) with the autocomplete plugin if I don't include bgiframe,
> but the documentation seems to imply that bgiframe is optional.
>
> Is bgiframe required?


[jQuery] Re: jQuery UI

2008-05-17 Thread Richard D. Worth
This is a great article. Thank you for sharing, and I'm looking forward to
more.

A minor note: 1.5b2 and 1.5b4 require alpha and beta versions of jQuery
1.2.4. They are included in each zip file (if you download the whole thing),
or can be grabbed here:

http://dev.jquery.com/view/tags/ui/1.5b2/jquery-1.2.4a.js
http://dev.jquery.com/view/tags/ui/1.5b4/jquery-1.2.4b.js

Also, they include dimensions; it's no longer a separate plugin. Your dialog
tutorial may not have hit any issues with using 1.2.3, but other plugins
have some.

Don't forget - the docs are a wiki, so include links to your tutorials
there.

- Richard

Richard D. Worth
http://rdworth.org/

On Fri, May 16, 2008 at 11:20 AM, mdrisser <[EMAIL PROTECTED]> wrote:

>
> I've just started playing around with the jQuery UI and while I was at
> it I decided to put together a series of tutorials on implenting the
> UI, I've never written any tutorials before, so it may not be the
> best, but I hope that it will be useful to someone.
>
> You can find it at http://mdrisser.r1designs.net/blog
>
> Let me know what you guys think and how I can improve the series.
>
> Thanks in advance
>


[jQuery] Re: Easy way to filter and sort a list

2008-05-17 Thread Eric Ongerth

Have you looked at http://plugins.jquery.com/project/autocompletex ?

On May 16, 11:09 pm, hubbs <[EMAIL PROTECTED]> wrote:
> Would i use .filter() for this?
>
> On May 16, 11:42 am, hubbs <[EMAIL PROTECTED]> wrote:
>
> > I am looking for a way to easily filter, and short a list.  I found
> > the tableFilter plugin, but it is an overkill for what I need, and I
> > don't want to use tables.  I want to be able to filter a list of
> > items, and also sort this list by ABC.  I love the idea of the
> > filtering being linked to an input box, so when you start typing
> > something, it will filter the list, find what you are looking for, and
> > remove the rest.
>
> > Any suggestions on what I could use?


[jQuery] Can jquery change the period in an OL to a hypen?

2008-05-17 Thread EricC

So the title says it all pretty much. I have a design and I need to
have some running numbers along the side of a list. An ol would be
perfect and it is rendering:

1998. Item 1
1999. Item 2

To match the designs I need it to be:

1998 - Item 1
1999 - Item 2

I could just make a table but it would be cooler if I could change it
somehow. I have spent an hour or so looking around and  there does not
seem to be a CSS/HTML way.

Cheers.


[jQuery] Re: $.post() not sending info

2008-05-17 Thread riscphree

Ah, I see now. I went ahead and got the Forms plugin working and that
was really so easy to do. At least I know how to do it another way
now.

Thanks!

On May 17, 12:05 am, Jason Huck <[EMAIL PROTECTED]> wrote:
> If this code is verbatim, then I would say it's because your $.post()
> call does not include a "submit" param, which is what sendsuggest.php
> is checking for in order to process the submission.
>
> - jason
>
> On May 16, 7:59 pm, riscphree <[EMAIL PROTECTED]> wrote:
>
> > I've got a suggestion form that inserts into a db table when they
> > submit, my jquery is located in a /js folder, while this page is in /,
> > and my db settings are in /includes/
>
> > Here is my $.post
>
> > $.post("../sendsuggest.php",
> >{ subject: subjectVal, message: messageVal,
> > theusername: theUser  },
> >   function(data){
> >   $("#sendSuggestion").slideUp("normal", function()
> > {
>
> >  $("#sendSuggestion").before('Success > h1>Thank you for your comments! > p>');
> >   });
> >   }
> >  );
>
> > sendsuggest.php is something like this
>
> > if(isset($_POST['submit'])) {
> >$theuser = $_POST['theusername'];
> >$subject = $_POST['subject'];
> >$message = $_POST['message'];
> >include("includes/database.inc");
> >connect_to_cms();
> >$sql = mysql_query("INSERT INTO suggestions(user,message,subject)
> > VALUES('$theuser', '$message', '$subject')");
>
> > }
>
> > On my page, the slideUp works and this line: $
> > ("#sendSuggestion").before('SuccessThank you for your
> > comments!');
>
> > works as well, but I can't figure out why it isn't inserting into the
> > db. Any hints?


[jQuery] Re: Problem with function

2008-05-17 Thread lukas

Thanks, but it still doesn't work...

On May 16, 6:06 pm, Wizzud <[EMAIL PROTECTED]> wrote:
> You need to enclose the jQuery code inside Document Ready 
> ...http://docs.jquery.com/Tutorials:How_jQuery_Works#Launching_Code_on_D...
>
> On May 16, 5:17 pm, lukas <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hello! I wanted to write my first jquery code and failed to replace
> > all these markups with a simple jquery command attaching this function
> > - return hs.htmlExpand(this, { objectType: 'iframe' } ) -  to all
> > markups automatically:
>
> > e.g.: 
>
> > What am I doing wrong here?:
>
> > (placed in head section)
>
> > 
> >  $("a").click(function(event){
> >    event.preventDefault();
> >    return hs.htmlExpand(this, { objectType: 'iframe' } )
> >  });
> > 
>
> > Thank you!!- Hide quoted text -
>
> - Show quoted text -


[jQuery] Need some help....

2008-05-17 Thread Aaron

Hi I  want to know how I could test if I added the javascript right???

like I am not sure if  when I added the javascript with the right
path .


I know I have to use the