/scripts/jquery/ajaxManager/
Thanks
Rupak
On Wed, Aug 26, 2009 at 2:25 AM, Hector Virgen djvir...@gmail.com wrote:
Hello,
Is there a way to stop or cancel an ajax request on demand, similar to
pressing stop in the browser? I would like to provide the user with a
cancel button on a loading
, Aug 26, 2009 at 9:16 AM, Cesar Sanz the.email.tr...@gmail.comwrote:
Why to re-invent the wheel?
- Original Message -
*From:* Hector Virgen djvir...@gmail.com
*To:* jquery-en@googlegroups.com
*Sent:* Wednesday, August 26, 2009 9:43 AM
*Subject:* [jQuery] Re: How to cancel an AJAX
Hello,
Is there a way to stop or cancel an ajax request on demand, similar to
pressing stop in the browser? I would like to provide the user with a
cancel button on a loading dialog that, when clicked, closes the dialog
and cancels the ajax request. I have the dialog working (thanks to
jQuery-UI)
Hello,
I have two jQuery collections that I'd like to merge into one:
var foo = $('#foo');
var foobars = foo.nextAll('.bar');
I've tried using $.add() to combine the two, but it doesn't seem to be
working:
foo.add(foobars);
foo.css('border', '2px solid #f00'); // only #foo is affected
I've
I'm actually working with definition list:
dl
dt id=fooFoo/dt
dd class=barBar 1/dd
dd class=barBar 2/dd
dt id=bazBaz/dt
dd class=flurpFlurp/dd
/dl
The definition list will contain a variable amount of dt and dd tags, so
what I am trying to do is select all dt tags, then loop through
That HTML should be traversable without any modifications.
What I would do is traverse up to the containing tr by using $.closest()
var tr = $(this).closest('tr');
Then, find the a with the name attribute:
var a = tr.find('a[name]');
from there, you can pull the 5029 out of the name attribute
Oh, that makes sense. Thanks!
--
Hector
On Fri, Aug 14, 2009 at 2:13 PM, Ricardo ricardob...@gmail.com wrote:
.add() returns the merged collections, but it doesn't change 'foo'.
you have to reassign it:
foo = foo.add(foobars);
On Aug 14, 2:36 pm, Hector Virgen djvir...@gmail.com wrote
If you're doing an ajax-like file upload (using jQuery) then you can add a
hint in your post data, like format=ajax. Normal file uploads would not have
this hint, so you can use that to choose how to handle the upload.
--
Hector
Sent from Temecula, California, United States
On Thu, Jul 30, 2009
Within your click function, this refers to the element that was clicked
(in this case, either #bridge1 or #bridge2). You can then get the
(immediate) children of that element that match the selector 'p' and toggle
that.
$('#bridge1,#bridge2').click(function(){
If you know how long the movie is, you can use the native
window.setTimeout() function.
// Displays alert after 5 seconds
window.setTimeout(function()
{
alert('5 seconds have passed');
}, 5000);
--
Hector
On Tue, Jul 21, 2009 at 1:48 PM, Mats dothebizz...@gmail.com wrote:
I have a page
I am building a page that loads a css file through javascript. To help
prevent flash of unstyled content[1], I am loading the CSS file as early
as possible (before document.ready()). I am using jQuery 1.3.2.
In Firefox 3.5.1 and Chrome 2.0.172.37 this is working properly, but in IE6
the browser
(link);
Any ideas why the jQuery way is crashing IE6?
--
Hector
On Mon, Jul 20, 2009 at 11:47 AM, Hector Virgen djvir...@gmail.com wrote:
I am building a page that loads a css file through javascript. To help
prevent flash of unstyled content[1], I am loading the CSS file as early
as possible
Try using :checked instead of [checked]
$([id^='item-']:checked)
--
Hector
On Mon, Jul 20, 2009 at 9:09 AM, SvenV sven.vanoirb...@gmail.com wrote:
I don't get it
In my page I have several checkboxes like this one:
input id=item-8 type=checkbox/
This is my Jquery code:
function
I've run into this problem too and found that I get better results by
accessing the value attribute instead of using .val():
$('#aUsers option:selected').each(function() {
console.log('user: ' + $(this).attr('value'));
});
--
Hector
On Mon, Jul 20, 2009 at 2:40 AM, debussy007
I suggest disabling the submit button so the user won't be surprised when
clicking it has no affect.
--
Hector
On Mon, Jul 20, 2009 at 12:59 PM, James james.gp@gmail.com wrote:
The code you provided is just the check when the field has the blurred
event called. Are you also doing the
Try using the handle option.
http://jqueryui.com/demos/sortable/#option-handle
--
Hector
On Sun, Jun 21, 2009 at 5:59 AM, Collaborate orhed...@gmail.com wrote:
Hi!
I'm wondering how I can limit the dragability of an sortable item,
to ex. a element inside the item.
Meaning, I only want
I am building a basic draggable+sortable page based on this demo:
http://jqueryui.com/demos/draggable/#sortable
http://jqueryui.com/demos/draggable/#sortableMy sortable list will start
out empty and the user can drag various draggables onto the sortable.
I want to add a delete icon to each of
;
if (!item.find('img.delete').length) {
var img = $('img src=delete.png class=delete);
img.click(function(event) {
item.remove();
});
item.append(img);
}
});
--
Hector
On Mon, Jul 6, 2009 at 9:38 AM, Hector Virgen djvir...@gmail.com wrote:
I am
Hello,
I am building a plugin and need to use live() to capture click events on
elements with a configurable class name, but only if they are children of
specific node (that may or may not have an ID).
For example, I want to create several containers (divs) on the page, and if
any element with a
Is there a way for plugins to know the context of the jQuery object?
According to the jQuery Core docs, I can create a jQuery collection by
passing in a selector and a context, and I should be able to retrieve the
context from the object's context property, but it's not working within
plugins.
You might want to pull the variable declaration out of the anonymous
function so that it can be used later (outside the function):
var str = ;
$(#theSelectsID).change(function () {
str = $(this).val();
});
// later
alert(str);
--
Hector
On Wed, Jul 1, 2009 at 11:25 AM, James
You can remove the title attribute from the elements with javascript, and it
won't affect the markup (as seen by search engines and when viewing source):
$('[title]').removeAttr('title');
--
Hector
On Wed, Jun 17, 2009 at 8:17 AM, Anyulled anyul...@gmail.com wrote:
I have a series of
I usually create a transparent overlay over the page to prevent
additional actions. Usually a div with position:fixed does the job.
var showOverlay = function()
{
var overlay = $('div/div');
overlay.addClass('overlay');
overlay.css({
position: 'fixed',
top: 0,
No need for a div with that code, the keyup and keydown events are observed
at the document level.
-Hector
On Fri, Apr 17, 2009 at 8:52 AM, bharani kumar
bharanikumariyer...@gmail.com wrote:
Hi ,
Can u tell me ,
i have to create any div ID ? ,
Or simply paste this code ?
You might be able to capture key combos by observing the document for
keydown and keyup events, and storing the key's down/up state in a variable.
Then, when the 's' key is pressed, check if 'ctrl' is also pressed.
But like Ricardo said, CTRL+S may not be capturable since it's a browser
shortcut.
, Hector Virgen djvir...@gmail.com wrote:
You might be able to capture key combos by observing the document for
keydown and keyup events, and storing the key's down/up state in a variable.
Then, when the 's' key is pressed, check if 'ctrl' is also pressed.
But like Ricardo said, CTRL+S may
I blogged recently about making an object-oriented jQuery plugin. It
basically allows you to access your plugin as an object and call methods on
it like any regular javascript object.
http://www.virgentech.com/blog/view/id/9
I hope it helps :)
-Hector
On Fri, Apr 10, 2009 at 3:07 AM, poppiez
Can you use an ordered list? li elements are block level just like divs.
-Hector
On Thu, Apr 9, 2009 at 1:46 PM, Eric Garside gars...@gmail.com wrote:
What's the advantage of assigning the identifier to the class? Like,
how are you using it once you create the classes. I'm assuming there's
Something like this might work:
var ajaxResponse;
$.ajax({
url: 'ajax.php',
complete: function(response) {
ajaxResponse = response;
}
});
-Hector
On Thu, Apr 9, 2009 at 3:44 PM, Nic Hubbard nnhubb...@gmail.com wrote:
I have an $.ajax() call that I am using to GET some
@Karl: Thanks, that sounds like a good reason to me :) I wasn't aware of
XHTML not allowing document.write()
@Ricardo: The $('head').append() approach looks great.
-Hector
On Mon, Apr 6, 2009 at 11:31 AM, Karl Swedberg k...@englishrules.comwrote:
On Apr 5, 2009, at 11:30 PM, Hector Virgen
{ visibility:hidden }/style');
On Apr 4, 9:27 pm, Derba ryancolantu...@gmail.com wrote:
That works a lot better. Thanks for putting up with my questions
hector.
On Apr 4, 8:21 pm, Hector Virgen djvir...@gmail.com wrote:
Actually, it might be better to just start off with 0 opacity
Try setting the opacity to 0 when you set it to visible.
-Hector
On Sat, Apr 4, 2009 at 4:15 PM, Derba ryancolantu...@gmail.com wrote:
the css visible seems to make it visible before it has a chance to
fade in, but I will tinker with it some to see if I can get it to work.
No problem, Derba. Glad to hear it worked :)
-Hector
On Sat, Apr 4, 2009 at 4:27 PM, Derba ryancolantu...@gmail.com wrote:
That works a lot better. Thanks for putting up with my questions
hector.
On Apr 4, 8:21 pm, Hector Virgen djvir...@gmail.com wrote:
Actually, it might be better
You may want to try a different approach. For example, you could use
javascript to add a new style rule to the CSS that sets the image to
visibility: hidden. This would have to happen *before* the dom has finished
downloading to ensure that it always hidden, so no need to wrap it in
My mistake, I don't think you can write to the document after it has loaded.
Try this instead:
document.write('style
type=text/css#mainimage{visibility:hidden}/style');
$(window).load(function() {
//when everything is finally loaded, fade image in
$(#mainimage).css({visibility: 'visible'});
no
javascript to mean that the website is rendered useless.
On Apr 4, 7:48 pm, Hector Virgen djvir...@gmail.com wrote:
You may want to try a different approach. For example, you could use
javascript to add a new style rule to the CSS that sets the image to
visibility: hidden. This would
}, 1000);
});
-Hector
On Sat, Apr 4, 2009 at 4:18 PM, Hector Virgen djvir...@gmail.com wrote:
Try setting the opacity to 0 when you set it to visible.
-Hector
On Sat, Apr 4, 2009 at 4:15 PM, Derba ryancolantu...@gmail.com wrote:
the css visible seems to make it visible before it has a chance
Yes, parents() returns all parents that match the given selector. closest()
will match the nearest parent that matches the selector.
-Hector
On Fri, Apr 3, 2009 at 1:45 AM, Brian Gallagher sinkingf...@gmail.comwrote:
Sorry wasn't at the computer yesterday, that worked a treat, thanks.
So
$(this).siblings() only returns the immediate descendents of 'this'.
Try using $(this).find() instead.
-Hector
On Wed, Apr 1, 2009 at 9:28 AM, sinkingfish sinkingf...@gmail.com wrote:
Hi I trying to write a script which allows for easily hiding and revealing
content by just specifying the
You should try using Firebug. You can print directly to the Firebug console
from within PHP, or you can just echo some message and look at the
response tab of the firebug console.
-Hector
On Wed, Apr 1, 2009 at 11:56 AM, LinkGuru i...@legalanalytics.co.uk wrote:
Hi, I am looking for some help
IMHO Canvas is still the best choice for pixel editing. Take a look at some
of Google's achievements with the canvas tag:
http://www.chromeexperiments.com/detail/javascript-canvas-raytracer/
-Hector
On Sun, Mar 29, 2009 at 10:50 PM, Shedokan shedo...@yahoo.com wrote:
thanks for all of your
Try observing window.document instead of window.
-Hector
On Mon, Mar 30, 2009 at 5:30 PM, liec lie...@gmail.com wrote:
$(window).keydown(function(e){
if (e.keyCode == 13)
sendmsg();
});
$(window).keydown(function(ke){
switch (ke.keyCode)
{
Instead of calling .hide() and .show(), try setting the css manually
with .css({display: 'none'}) and .css({display: 'inline'})
Or, if you want to keep the animations, you can float left the LI
elements instead of making them inline.
On 3/29/09, LaUr3nTiU laurentiu.ter...@gmail.com wrote:
Why is the result of clicking an a link unexpected? Is Javascript required
to use your website? If so, then it may be in your interest to make those
links work without javascript. Then you would use Javascript to enhance the
static pages. That way users without Javascript (including search engines
Try focusing the text field right after it is created by calling focus()
directly on the element. That's the only way to make sure blur is fired when
the user clicks somewhere else.
-Hector
On Mon, Mar 9, 2009 at 4:18 PM, bart b...@ivwd.nl wrote:
Hi all,
I've set something up which runs at
but to no success.
Hector, it still does the same thing even with the preventDefault()
method in place.
On Feb 23, 11:43 pm, Hector Virgen djvir...@gmail.com wrote:
Try preventing the default action of the event:
$(#btnAddSession).click(function(event){
$(#addproductsForm).dialog(open
I'm not sure but it sounds like an autocomplete plugin might be what you're
after.
This might be a good place to start looking:
http://plugins.jquery.com/search/node/autocomplete+type%3Aproject_project
-Hector
On Mon, Feb 23, 2009 at 6:09 PM, pramudya81 pramudy...@gmail.com wrote:
Anyone
How funny, I just blogged about developing jQuery plugins the other day :)
http://www.virgentech.com/blog/view/id/9
-Hector
On Mon, Feb 23, 2009 at 6:57 PM, chris thatcher
thatcher.christop...@gmail.com wrote:
I was wondering if there was any interest I could stir up in the
experienced
Try preventing the default action of the event:
$(#btnAddSession).click(function(event){
$(#addproductsForm).dialog(open);
event.preventDefault(); // prevents the link from being followed
});
-Hector
On Mon, Feb 23, 2009 at 7:01 PM, Steven Yang kenshin...@gmail.com wrote:
have you
I just together a quick tagger plugin the other day that might help
you. You can check out the demo here:
http://www.virgentech.com/code/tagger
On 2/18/09, murphyhg murph...@gmail.com wrote:
I need to implement a tagging keyword solution for my application in
ColdFusion. I am looking for a
What is the Number() function? I haven't seen that before. Can you use
parseFloat or parseInt in its place?
-Hector
On Tue, Feb 3, 2009 at 11:02 AM, Zaliek zali...@gmail.com wrote:
I've finished my shipping calculator script, but now for some reason
Math.ceil used on var sum in my script
Nevermind, I just found the bug report for this:
http://dev.jquery.com/ticket/3933
-Hector
On Tue, Jan 27, 2009 at 2:04 PM, Hector Virgen djvir...@gmail.com wrote:
Hello,
I just updated to jQuery 1.3 and I am having trouble with the following
selector:
var options = $('option[value
Hello,
I just updated to jQuery 1.3 and I am having trouble with the following
selector:
var options = $('option[value=]');
Firebug says:
[Exception... 'Syntax error, unrecognized expression: value=]' when
calling method: [nsIDOMEventListener::handleEvent] nsresult: 0x8057001e
You can use delete for unsetting items in objects, but I'm not sure if it
works with variables in general:
var myObject = {
foo: 'Foo',
bar: 'Bar
};
delete myObject['foo'];
-Hector
On Tue, Jan 27, 2009 at 2:33 PM, MorningZ morni...@gmail.com wrote:
x = null;
On Jan 27, 5:22 pm,
Or you could do this:
var img = your image element wrapped in br /s
$('#foo').html(img);
-Hector
On Wed, Dec 17, 2008 at 9:36 AM, brian bally.z...@gmail.com wrote:
On Wed, Dec 17, 2008 at 11:13 AM, ken jqu...@kenman.net wrote:
I need to replace the contents of #foo.
I would love to
Try reading the value attribute directly:
timecode = $(this).attr('value');
-Hector
On Wed, Dec 17, 2008 at 3:00 AM, MacTommy macto...@spray.se wrote:
Hi, I try to catch selected choice in my dropdown inside IE7.
span id=prefix
select
option value=108:00 -
The .show() and .hide() functions are on-demand functions -- they'll happen
immediately when the code is called. What you need to do is observe the
user's actions and show/hide the div based on what they are doing.
For that, you can use .mouseover() and .mouseout with callback functions.
The
(function()
{
$(\'#menu2\').hide();
});
}
);
/script
...or do I need to place the code you gave me in the body somehow?
On Wed, Dec 10, 2008 at 10:51 AM, Hector Virgen [EMAIL PROTECTED]wrote:
The .show() and .hide() functions are on-demand functions -- they'll
happen immediately
I usually use $.each() to iterate over arrays. It makes it easier to do
things like this:
var myArray = [a, b, c];
$.each(myArray, function(key, val)
{
// return early if key is too low
if (key 1) return;
// do something with val
});
I'm not sure if there's a built-in way to do the
You can add a second class to your CSS rule by appending another dot and the
class name:
// Finds child elements that contain both classes
$('div').find('.class-one.class-two');
-Hector
On Mon, Dec 8, 2008 at 7:28 PM, mgl [EMAIL PROTECTED] wrote:
Hello again,
Does anyone know how (or if it
You can't blur a div. Only elements that can be focused can be blurred.
AFAIK, that's form input elements (input, select, etc.)
You'll have to use another event or listener to make the div disappear.
-Hector
On Fri, Dec 5, 2008 at 9:21 AM, Echilon [EMAIL PROTECTED] wrote:
I have a div which
selector in filter(), gathering matches from the source, rather than
running
through the source and comparing each element with each selector.
Did that make sense?
On Mon, Dec 1, 2008 at 5:15 PM, Hector Virgen [EMAIL PROTECTED]
wrote:
Is there a way to make $.fn.find() return
I usually create my functions/classes outside of $(document).ready(), and
then call them from within $(document).ready().
-Hector
On Tue, Dec 2, 2008 at 10:02 AM, ricardobeat [EMAIL PROTECTED] wrote:
Yes you can, but you need to wait for the DOM to be ready to
manipulate any elements, so
Is there a way to make $.fn.find() return the elements in the order they
appear in the dom instead of grouped by selector?
For example, let's say I have a form and I want to get the first form
control, whether it's an input, select, or textarea. Here's some basic HTML:
form id=#myform
I've been thinking about this over the weekend and came up with a way to
write class-based plugins while still following the jQuery convention. Maybe
someone else has done this before but I couldn't find any documentation on
this subject.
The idea is to extend the base jQuery object with the
jQuery#children() only returns the immediate children of the element. If you
want to dig deeper, you should use jQuery#find()
$('#header2').find('.menu_head'); // returns all divs with the class
menu_head within the div with id header2.
-Hector
On Mon, Nov 24, 2008 at 5:57 PM, chitgoks [EMAIL
Does anyone know of a good example of an object-oriented plugin for jQuery?
The reason I ask is that the jQuery convention is to return *this* at the
end of the plugin to allow for chaining. While that's great for simple
plugins, some of my advanced plugins instantiate object that I would like to
I just built one of these types of auto-completers the other day, and what I
had to do was create multiple hidden inputs with the name appended in
brackets. That way each of the values would be submitted instead of just the
last one.
So if you have a text input like this:
input type=text
From what I undstand, jQuery#val() returns the value of the first matched
element.
Sample HTML:
input type=hidden name=test[] value=foo /
input type=hidden name=test[] value=bar /
$('input[type=hidden][name=test\[\]]').val(); // returns foo
Is there an easy way to get an array of values from
You should take a look at jQuery's built-in tabs plugin. It may already do
what you're looking for.
http://docs.jquery.com/UI/Tabs
-Hector
On Fri, Nov 21, 2008 at 1:44 PM, halcyonandon [EMAIL PROTECTED] wrote:
Hi,
I'm new to JQuery, but I need to convert some regular, working,
javascript
Yes. Any element on the page will respond to click events, except for
disabled form inputs.
$('div#myDiv').click(function()
{
alert('myDiv was clicked');
});
-Hector
On Fri, Nov 21, 2008 at 2:40 PM, lukas [EMAIL PROTECTED] wrote:
Is it possible to click or select a DIV with jquery?
This might work better with filter() (untested):
$('*').filter('#main, #main *').mouseover(function() {
});
-Hector
On Thu, Nov 20, 2008 at 8:07 AM, [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:
Hi,
I want to apply a mouseover event on all elements but one and its
children. I can't use
This is a common problem with ajax requests. What's happening is the
selector only applies to elements that exist on the page at the time the
selector was called.
Once your ajax request has updated the page with more elements, they won't
have click events because they didn't exist when the
Oops, i meant they won't have target='_blank'
:)
-Hector
On Thu, Nov 20, 2008 at 9:18 AM, Hector Virgen [EMAIL PROTECTED] wrote:
This is a common problem with ajax requests. What's happening is the
selector only applies to elements that exist on the page at the time the
selector was called
) return n;
} while(next.length);
return this.filter('nada');
};
var next = first.nextOf('li.item:not(.disabled)');
- ricardo
On Nov 18, 10:57 pm, Hector Virgen [EMAIL PROTECTED] wrote:
Correction: that last console.log does report Third as expected.
-Hector
On Tue, Nov 18, 2008
This may be a little longer but it checks each body class individually:
$.each($(document.body).attr('class').split(' '), function(class)
{
$('h3.' + class).addClass('foundMatch');
});
-Hector
On Wed, Nov 19, 2008 at 8:30 AM, alanfluff [EMAIL PROTECTED]wrote:
Hey Liam,
No worries! And
Math.ceil() should do the trick:
Math.ceil(3.); // 4
Math.ceil(3.0); // 3
-Hector
On Wed, Nov 19, 2008 at 8:22 AM, Pierre Bellan [EMAIL PROTECTED] wrote:
Hi,
In javascript, you have the Math object. This is the perfect solution for
your problem
Bye
Pierre
Lily Tomlin - The
I ran into this same problem today and wrote up this quick plugin that
accepts a boolean or function:
$.fn.extend({
showIf: function(fn)
{
var result;
switch (typeof fn) {
case 'function':
result = fn.call(this);
break;
default:
result = fn;
}
if (result) {
$(this.show());
} else {
Oops, fixed a typo:
$.fn.extend({
showIf: function(fn)
{
var result;
switch (typeof fn) {
case 'function':
result = fn.call(this);
break;
default:
result = fn;
}
if (result) {
$(this).show();
} else {
$(this).hide();
}
return $(this);
}
});
-Hector
On Wed, Nov 19, 2008 at 9:29 AM, Hector
That depends. If your popup is a child-element of the overlay, then clicking
the popup will fire the click event of the overlay.
So you should make them sibling elements:
div id=overlay/div
div id=popup/div
-Hector
On Wed, Nov 19, 2008 at 9:40 AM, jonhobbs [EMAIL PROTECTED] wrote:
Liam,
, Hector Virgen [EMAIL PROTECTED] wrote:
This may be a little longer but it checks each body class individually:
$.each($(document.body).attr('class').split(' '), function(class)
{
$('h3.' + class).addClass('foundMatch');
});
-Hector
On Wed, Nov 19, 2008 at 8:30 AM, alanfluff
There is a problem with your syntax. There's no dot between jQuery and ().
jQuery(document).ready(function () {
jQuery('#regpage h3 a').click(function () {
alert('hello');
return false;
});
})
-Hector
On Wed, Nov 19, 2008 at 10:31 AM, c.barr [EMAIL PROTECTED] wrote:
Use
If the image is clicked, you can then traverse up the dom to the parent td
with a title.
$(this).parents('td[title]:eq(0)').attr('title'); // returns the value of
the 'title' attribute
-Hector
On Wed, Nov 19, 2008 at 3:14 PM, Ashish [EMAIL PROTECTED] wrote:
tr
td title=This is the
Can you post some sample code? It might be a syntax error.
-Hector
On Wed, Nov 19, 2008 at 3:45 PM, TI Wizard [EMAIL PROTECTED] wrote:
Anyone?
On Nov 18, 7:58 pm, TI Wizard [EMAIL PROTECTED] wrote:
Javascript and default JQuery (and UI) stuff works inside of a DIV
which was loaded with
undefined as well though img has a title attribute. do I need to tell
jquery to provide $(this) to this function.
On Nov 19, 3:17 pm, Hector Virgen [EMAIL PROTECTED] wrote:
If the image is clicked, you can then traverse up the dom to the parent
td
with a title.
$(this).parents('td[title]:eq
...
Also, I have another page with the AjaxForm plugin which works, which
is odd.
The plugin JS files are loaded inside of the main page, the page which
loads the others (if that makes sense...)
On Nov 19, 3:47 pm, Hector Virgen [EMAIL PROTECTED] wrote:
Can you post some sample code
For multiple updates with one ajax call, you might want to try sending back
a JSON response.
For example, in PHP you could do this:
?php
$response = array(
'test1' = 'Username',
'test2' = 'Thank you for subscribing'
);
echo json_encode($response);
?
Then, in your JS file, your ajax
You can use jQuery#find()
$(this).find('a').css(color, red);
That will turn all hyperlinks within this red.
-Hector
On Wed, Nov 19, 2008 at 8:17 PM, George [EMAIL PROTECTED] wrote:
I meant all A links inside that DIV the one that is in $(this)
On Nov 19, 11:14 pm, George [EMAIL
=A-value
The spec notes that:
The field value defaults to the content of the OPTION element.
( http://www.w3.org/MarkUp/html-spec/html-spec_8.html#SEC8.1.3.1 )
Karl Rudd
On Tue, Nov 18, 2008 at 5:39 AM, Hector Virgen [EMAIL PROTECTED] wrote:
Hello,
I'm having a problem with a CSS
I would use jQuery#parents() for this.
$('#r2').parents('td').attr('rowspan', '1');
In case you are using nested tables, you may want to limit it to the first
parent td found:
$('#r2').parents('td:eq(0)').attr('rowspan', '1');
-Hector
On Tue, Nov 18, 2008 at 7:00 AM, manuel muñoz solera
Try this:
$('#select option[selected]').html();
-Hector
On Tue, Nov 18, 2008 at 8:42 AM, debussy007 [EMAIL PROTECTED] wrote:
Hi,
to get the selection option value, I use
$('#select').val();
But how do I get the content of the option ?
In other words:
select id=select
option
An event object is always passed as the first argument to the function,
which contains the information you need.
$('#form').submit(function(event)
{
// Get the element that fired the event
var element = event.target;
});
For more info check out the Events guide:
have suggestions/links? I guess
I'd like to know the id and the name, thanks!
On Nov 18, 10:53 am, Hector Virgen [EMAIL PROTECTED] wrote:
An event object is always passed as the first argument to the function,
which contains the information you need.
$('#form').submit(function(event
element = event.target;
alert( $(element).attr(id) );
return false;
}
);
I get form back instead of the id of my submit button ... thoughts
on what I'm doing wrong?
MS
On Nov 18, 12:06 pm, Hector Virgen [EMAIL PROTECTED] wrote:
event.target returns
I think this should work:
$('input.subscrCheckbox[type=checkbox][checked]');
-Hector
On Tue, Nov 18, 2008 at 1:30 PM, [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:
Hi,
How do I write a JQuery expression that will give me all the elements
that are inputs of type=checkbox, that have
Would it help to set the opacity using a stylesheet instead of using
javascript?
-Hector
On Tue, Nov 18, 2008 at 1:19 PM, jaredh123 [EMAIL PROTECTED] wrote:
Hopefully this makes sense to someone:
I'm working on a site that is using
http://htmldog.com/articles/suckerfish/
[EMAIL PROTECTED] wrote:
$(.subscrCheckbox:checkbox) should also work.
http://docs.jquery.com/Selectors
On Nov 18, 4:36 pm, Hector Virgen [EMAIL PROTECTED] wrote:
I think this should work:
$('input.subscrCheckbox[type=checkbox][checked]');
-Hector
On Tue, Nov 18, 2008 at 1:30 PM
For IE, use filter:
.css_test{
opacity: 0.5; // for all browsers except IE
filter: alpha(opacity = 50); // for IE
}
I found that here:
http://joseph.randomnetworks.com/archives/2006/08/16/css-opacity-in-internet-explorer-ie/
Maybe this will help?
-Hector
On Tue, Nov 18, 2008 at 1:50 PM,
, Hector Virgen [EMAIL PROTECTED] wrote:
$(.subscrCheckbox:checkbox) would return all checkboxes with the class
name of 'subscrCheckbox', including those that are not checked.
$(.subscrCheckbox:checkbox[checked]) is probably the shortest selector
you
could use that meets your requirements
I usually check if the variable == 'undefined':
if (var == 'undefined') {
// var is not set
}
I don't know if jQuery has one but it'd be simple to write your own.
This is untested but might work :)
$.extend({
isset: function(var) {
return (var != 'undefined');
}
});
-Hector
1 - 100 of 134 matches
Mail list logo