Andreas, if I remember correctly, the following should work:
$.each(object, function() {
return false;
});
That isn't supported. The necessary code was removed due to
unsolved problems. Actually the stuff that Michael just
posted would help a lot to solve it, though I'm not
this.id = 'NewValue';
alert( this.id );
I've got another simple question. Is this not how you set an element's
attribute? [from inside an .each()]
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/
$(function(){
$(div.OrderEntryListRow).not(.Selected).each(function(i){
alert(before: + $(this).attr(id));
$(this).attr(id, Row_ + (i+1));
$(this).html($(this).html() + ': ' + (i+1));
alert(after: + $(this).attr(id));
});
});
Any time you see
Chris, it's like this... ;-)
$() returns a jQuery object, which is an array of DOM elements with jQuery
methods that apply either to the entire array or to the first element in the
array, depending on the method.
One of those methods is .each(), which loops through the DOM element array
and
Do you want getPost to be called during the execution of initialiseForm, or
later in response to the 'submit' event? For the latter, use this (added
code in red):
function initialiseForm(formId) {
$(formId).bind('submit', function() { getPost(formId) } );
}
-Mike
_
From: [EMAIL
if have some thing like this that is called by document.ready():
function init_top_level() {
$(.top_folder).click(function(i) {
// Do a ton of stuff here
});
}
I not only want to assign the click event to my .top_folder
elements, but assign dblclick as well. I
Forgot to add us to the list...
Zvents:
http://www.zvents.com/
This is a Rails site and we completely replaced prototype.js with jQuery and
our own code. We're using thickbox, a homegrown autocompleter, my DOM
plugin, and lots of custom code.
This also puts jQuery on our partner sites:
The
Thanks for the assistance. Yes, I was basically trying to
assign a click and dblclick to the same function (to prevent
users from double-clicking and firing the func twice).
Hmm... If you assigned both click and dblclick to the same function, then
the function *would* be called twice on each
Scripting on top of an invalid HTML document won't make
your life easier (obviously). I'd try to replace spaces given
by the user to _ in the backend.
And then do what with underscores given by the user?
Come on, that was just an idea. You can leave underscores the
way they are for
var a[];
$(':checkbox').each(function() {
if (this.id) a.push(this.id);
});
I get this error:
missing ; before statement
var a[];
(curse my rudimentary javascript skills!)
OK... It says there is a missing ; before the statement var a[];.
What is before the
(If there is a better way to look at the Object, please post here)
The very best way to understand what JavaScript code is going and explore
objects is to use any JavaScript debugger, such as Firebug or Venkman for
Firefox, or the Microsoft Script Editor for IE.
If you don't have a JavaScript
Now that it is laid out in front of me it's pretty obvious,
but when you come into the thing cold, these things are not
obvious. I think it would be a good idea to explicitly state
what the object is, and that $ refers to it (I think that's
right ... now I mention it I'm not quite sure if
// this is .n much too complicated!
Guys, I don't appreciate the profanity. My 10 and 11 year old daughters are
learning JavaScript. I don't want them to be subjected to language like
that.
When you've offended some people already, offending more is probably not the
best way to fix it.
Guys, I don't appreciate the profanity. My 10 and 11 year old
daughters are learning JavaScript. I don't want them to be
subjected to language like that.
Just to clarify, my daughters don't actually read the jQuery list - yet.
Their goal is to make an online computer game for some of their
From: Michael Geary
Just to clarify, my daughters don't actually read the
jQuery list - yet. Their goal is to make an online
computer game for some of their friends to play.
Right now they're just learning about variables and
loops and a bit of HTML and CSS. Hopefully
Is there a way to just return the jquery object (so I could
see it in firebug's watch section) then pass it to another
jquery function then join them all up when I know
everything works?
$('#test :textarea').before('Current length:nbsp;span id='+
this.id
The DOM updates immediately when you add new elements. But updating the
DOM does not mean copying event handlers from deleted DOM elements to
newly added DOM elements. That appears to be the problem here: You need to
assign the click handler again after replacing the DOM element, because the
click
That's a nice trick, Jake - thanks for posting it!
Both approaches have their use. Your log plugin is great for console
logging, while breaking up the chain is great for interactive debugging
because you can set a breakpoint between lines.
-Mike
Mike, I don't like breaking the chains... I just
I'm not very familiar with InnerFade, but wouldn't you do this inside your
marker click handler, right after you call marker.openInfoWindowHtml? That's
when you have the list items available.
I'm new to jQuery and am trying to figure this out, but was
wondering if anyone has had any luck
!-- ... - is an HTML comment, not a CSS comment. So, conditional comments
go in your HTML code, not in CSS code.
div.SiteHeader{
border: 1px solid #336566; /*AA*/
width: 850px;
background-color: #E3F0D6; /*D5F0D5,CDD9E5*/
height: 60px;
text-align: left;
margin:
!-- ... - is an HTML comment, not a CSS comment. So, conditional
comments go in your HTML code, not in CSS code.
Michael, so that only works with inline styles?
You can use them with any HTML code. Inline style tags, link tags,
script tags, whatever.
Do a View Source on www.zvents.com for
$(document).ready(function(){
function resizeDiv(that){
var x = $(that);
if(x.height() 600){
x.css(height,600px);
}
};
$(#mydiv).each(function(){resizeDiv(this)});
});
My question: is it better to define this function as above
and pass this or to define an
When you create a named function is is basically a static
object stored in funcname of the scope it was defined in.
when you declare a var in a function it is also a static
object attached to the function object. As such mydata is a
single static object and effectively a single object in
$.fn.border = function(prefix){
var classNames = [ 'north', 'east', 'south', 'west', 'northeast',
'southeast', 'southwest', 'northwest'];
return this.each(function(){
for (var index in classNames){
className = (prefix || '')+ classNames[index];
$(this).wrap(div
I'm trying to get animate() to fade font-weight but it's not working.
I've tried the following:
$('a').mouseover(function() {
$(this).animate({fontWeight: 'bold'}, 'slow'); });
But that doesn't work - I've also tried to put quotes around
the fontWeight and tried font-weight.
I get
If you change only the hash, it won't reload the page - but it won't create
a unique URL for search engines. If you change anything else in the URL, it
will reload the page.
Changing the hash does get you a URL get people can copy and bookmark. But
Google won't see the hash.
It really is a case
Recently I've been trying to use ON with jQuery. I met with obstacle.
I couldn't use this keyword in certain cases to get my main object
reference...
var myObject = {
layout: { 'align': '' },
start: function() {
$('form').bind('submit', this.buildLayout);
I have a quandary. I open an iframe with some arbitrary
content in it. I want to be able to click on something within
the iframe to cause the iframe (and the div tag that contains
the iframe) to go away. I am having trouble getting to the
iframe. I know it's possible as I've seen it
I was able to take what you sent me and simplify it down to this:
var frameWindow = document.parentWindow || document.defaultView;
var outerDiv = $(frameWindow.frameElement.parentNode);
cls = $('div.tb_close', outerDiv).get(0);
Because I actually want to operate on a
As you can see from your first (presumably working?) example, .contentWindow
is a property of an HTML element.
Therefore, the real question is, How do I get the HTML Element?
If you are inside an $('foo').each() callback function, then this is the
HTML element. So, you could use:
I'm trying to get some simple things to work using jquery,
and everything currently works the way I'd like it to in
Firefox. However, in Opera, Safari, and Internet Explorer,
nothing works right -- and I haven't been able to figure out
where the hang up is.
My entire jquery code can
$.get(parser.php,
{
type: type,
user: user,
},
trailing commas only work in firefox!
user: user,
has a trailing comma!
Great catch, Jake.
Here's a tip - use ActiveState Komodo for your JavaScript editing, and get
syntax checking as you
There are several ways you could refactor that code. Here's one approach:
$('#normal, #standard, #profi').click( function() {
var idnums = { normal:1, standard:2, profi:3 };
$('#bereit').ScrollTo( 800 );
for( var id in idnums ) {
var n = idnums[id];
What if I specify a div as display:inline in my css? Hiding
then showing this div using the above script would change
it's display to block.
Good point!
I was about to suggest making a list of the block level elements to avoid
having to create DOM elements to test, but either approach would
elem.style.display=block when there is a speed
designated. Plain .show() returns them to inline.
On Feb 14, 2007, at 5:37 PM, Michael Geary wrote:
The real problem here is that there is *no such thing* as showing an HTML
element. All you can do is set it to block or inline. This suggests that
show
You may use a period in an id still being valid XHTML, but in this
case you cannot use the id as a (CSS) selector, because the
period is a class selector.
I'm not convinced it's not a bug in jQuery because it doesn't
make sense to specify a class on an Id. I'm not going to make
a
This is untested code, but it's one way you could do it with jQuery:
$(function() {
location = $('[EMAIL PROTECTED]')attr('href').replace( /_spam$/, '' );
});
_
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Christopher Jordan
Sent: Saturday, February 24, 2007
: [jQuery] KICK-BUTT javascript based Zoom feature
Wow. that looks simple.
I guess the jQuery core has everything else needed to
produce the close-up effect?
Rick
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Michael Geary
Sent: Saturday, February 24, 2007 2:07 PM
To: 'jQuery
...and if I seem too much like a smart aleck today, my apologies! No offense
intended. I was just having some fun with the juxtaposition of that URL is
busted and anyone know how to accomplish this in jQuery... :-)
_
From: Michael Geary
The actual code for the close-up effect would
Now, my mark-up is wrong. I should have wrapped the nested
ul in it's own li, but I missed it. Testing looked good
in FF 2, .next() was returning the nested ul, and I didn't
even notice the problem. In IE6/7 however,
.next() returned the next li, and not the ul which was in
fact next
Nothing to do with SEO. The display and visibility properties do two
different things:
http://www.w3.org/TR/CSS21/visuren.html#display-prop
http://www.w3.org/TR/CSS21/visufx.html#visibility
-Mike
_
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Microtoby
Sent:
Is there a way to change the title of a document after an
ajax Call. I'm using an ajax history system and I would like
to view specific document title in the back button list.
I've try this but doesn't seem to work :
$(title).html(Dynamic Title);
I can see the change in
I'm having trouble seeing the advantage of adding static
functions to jQuery as in:
jQuery.log = {
error : function() { ... },
warning : function() { ... },
debug : function() { ... },
};
as opposed to:
function log() { ... }
log.prototype.error = function() { ... }
I was poking around the DOM looking for incorrectly scoped
variables and I found the following node:
window.undefined = undefinedundefined
What is this for?
The window object has a property named undefined whose value is the
undefined value.
IOW, when you run code like this:
if( foo
This works for me:
$.ajax({
url: 'email.pl',
type: post,
data: {
rm: 'deleteLetter',
ID: myForm.letterSelect.value
},
dataType: 'json',
success: function( ret ) {
alert( ret.a );
}
});
I believe the order in which you pass the
I want to make a remote request to a different server than
the current page is hosted on, in order to get JSON data
(padded with a callback).
This is typically handled by inserting script elements on
the current page with the src as the remote URL, (Right?),
but I couldn't find an easy
101 - 146 of 146 matches
Mail list logo