No. Cross domain also applies to different sub-domains, protocols, and
ports.
On Nov 20, 11:17 am, webspee...@gmail.com webspee...@gmail.com
wrote:
Outside of my domain, I can understand. I'll have to hold off for a
bit then.
Although the page will be remote, it will be accessible
Try $('#filterlist_wrapper ul li:gt('+left_col+')')
On Nov 17, 3:35 pm, Magnificent
imightbewrongbutidontthin...@gmail.com wrote:
It should read:
I'm storing my counts in variables, but it doesn't look like :gt
and :lt can accept a VARIABLE value as it's parameter.
It works when I put
If you used Andrew's example, then you added a jQuery object to the
canvasClasses array. Calling innerHTML on a jQuery object won't work.
Try canvasClasses[0].html('htmlhere')
On Nov 4, 3:35 pm, shaf shaolinfin...@gmail.com wrote:
That doesnt work either.
On Nov 4, 11:28 pm, Andrew Tan
Where are you including the scripts? If they're in the head, then you
need to wrap your selector in a document.ready function, as the script
is running before your div exists in the DOM.
Try including your scripts just before the closing body tag.
On Oct 30, 7:44 pm, numerical25
Try this:
$(tr:not(:contains(Brown))).css(background-color, Red);
On Oct 30, 12:58 pm, Aaron Gusman ict.aarongus...@gmail.com wrote:
I have a table with 2 columns and four rows. I am currently able to
highlight the row which contains a specific piece of text. But what I
want to do is to
var panelID = panel_ + $(input).val();
You're problem is the selector; look at it for a second to see why it
won't work (think about what exactly it's selecting). If you want the
value of the button that was clicked, just reference it with 'this',
as in
var panelID = panel_ + this.value;
or
:46 am, mkmanning michaell...@gmail.com wrote:
.toggle() allows you to rotate through multiple functions, you might
want to check it out in the
docs:http://docs.jquery.com/Events/toggle#fnfn2fn3.2Cfn4.2C...
On Oct 21, 2:58 am, The Danny Bos danny...@gmail.com wrote:
I've got one
to 'YYY'
the third click ... etc
Know what I mean?
On Oct 22, 6:04 pm, mkmanning michaell...@gmail.com wrote:
Well, if you just want to loop through the array to change the
background color, you don't really need toggle then. Try this:
$(#item_list li div a).click(function
'],
Thanks again,
On Oct 22, 6:27 pm, mkmanning michaell...@gmail.com wrote:
Yeah, the snippet I wrote updates the color; you can add an ajax call
to update your db as well, if the value your updating in the db is the
color, or else the value is in an array that's indexed the same
.toggle() allows you to rotate through multiple functions, you might
want to check it out in the docs:
http://docs.jquery.com/Events/toggle#fnfn2fn3.2Cfn4.2C...
On Oct 21, 2:58 am, The Danny Bos danny...@gmail.com wrote:
I've got one for ya, JQuery and Ajax.
I want to have a button image,
Operations like .val() return a string, so If you need to extend a
string you have to use String.prototype:
String.prototype.slug = function(){return this.trim().etc...}
The way you've done it works, but in the same way 'trim' works, i.e.
you have to pass the string to the function:
There are several plugins:
http://plugins.jquery.com/project/parseQuery
On Oct 17, 7:41 am, ReynierPM rper...@uci.cu wrote:
Hi every:
It's possible to get values from URL with jQuery like PHP? For example
suppose you have this URL: form.html?s=okval=rperezm. In PHP is simple:
[code]
A couple things. First off, the syntax you're using won't get you the
anchor's color:
$('a:link',this).css('color');
This is a shortcut for:
$(this).find('a:link').css('color')
which basically means find the anchors inside this anchor. If you want
the anchor's original color, just use:
The problem with something like the desired approach:
if (option.name == Option1) {
is that 'name' is a valid key, so if you had an object like
{'name':'john'}
option.name would equal 'john' (same problem if you tried option.key).
Also, though your example only has one key, an object can
Never used the plugin, but doing the sort you want is fairly simple:
$('#refmenu').click(function(){
var sorted = $.makeArray($('#listli')).sort(function(a,b){
return ($(a).children('a').attr('title') $(b).children('a').attr
('title')) ? -1 : 1;
});
$('#list').html(sorted);
});
HTH
$('td:last-child')
On Oct 12, 9:45 am, MorningZ morni...@gmail.com wrote:
with this html:
table
tbody
tr
td.../tdtd.../tdtd.../td
/tr
tr
td.../tdtd.../tdtd.../td
/tr
tr
td.../tdtd.../tdtd.../td
You could replace the file input when the URL field is focused:
$('#fu').replaceWith('input id=fu type=file /');
where #fu is the file input.
On Oct 12, 11:53 am, amuhlou amysch...@gmail.com wrote:
hmm yeah, I did a quick google search and it appears that allowing you
to access a file
It's not jQuery, it's just basic same origin policy. From your
example, the calls are cross domain because you were using
'www.pomona.edu' in the getJSON call from 'pomona.edu'. Those are
different hosts.
On Sep 14, 10:16 am, roryreiff roryre...@gmail.com wrote:
The problem ended up being my
Use .live()
http://docs.jquery.com/Events/live#typefn
On Sep 2, 1:51 am, Daniel battlew...@googlemail.com wrote:
Hi There,
I'm having trouble accessing some Elements with jQuery after I created
them and added them to the HTML. I want to add some Checkboxes to my
Site as soon as the user
You could just add name attributes to the text fields (e.g. input
type=text id=item_01 name=item_01 class=item_field
value=123/ ) and then just use data:$('#myForm').serialize().
That will give you a querystring like:
item_01=123item_02=456item_03=789 (you can't pass an array to
'data', it
.remove() will also remove all event handlers and internally cached
data
http://docs.jquery.com/Manipulation/remove#expr
On Sep 1, 4:18 pm, roydukkey royduk...@gmail.com wrote:
Is it necessary to unbind events from elements before removing them.
As like the following:
Play around with this:
$('input[value*=||]').change(function(){
var $this = $(this),val = $this.val().split('||')[1];
if($this.is(':checked')){
$this.removeAttr('disabled').siblings('input[value$='+val+']').attr
('disabled','disabled');
} else {
:
persons.sorted
would give me:
[person2,person1,person3]
Using Ruby to understand JavaScript is a strange path, but my mind
does what it can.
-Audrey
On Aug 27, 4:49 pm, mkmanning michaell...@gmail.com wrote:
I'm gonna go out on a limb and assume you want them sorted
alphabetically
I'm gonna go out on a limb and assume you want them sorted
alphabetically, by span content:
var sorted = $.makeArray($('#names span')).sort(function(a,b){
return ($(a).text() $(b).text()) ? -1 : 1;
});
$('#names').html(sorted);
On Aug 25, 9:14 pm, Audrey Lee audrey.lee.is...@gmail.com wrote:
I'm assuming you want the current value of the checked checboxes. Just
use .serialize()
var inputs = $(input[name^='day']).change(function () {
console.log(inputs.serialize());
});
the output of serialize() is a query string, just split on '' for an
array of key=value that you can then
A couple things that could help in debugging:
ID's are unique, and can't begin with a number. Check the quotes on
this line around #favorites:
var appendHTML = $(‘#favorites’).html();
On Aug 19, 12:48 pm, Rick Faircloth r...@whitestonemedia.com
wrote:
Hi, Dhruva, and thanks for the reply…
Numeric ID's aren't valid, and also an ID can't start with a number.
I'd also recommend removing the inline onclick; you can simplify the
code by just adding a click event on the UL and delegating:
$('#tab_list').click(function(e){
e = $(e.target), i = $(this).find('li').removeClass
outerHTML is an IE addition to the DOM and not supported by Firefox.
If you want to get it with jQuery just append the element to a div and
get its html():
$('div').append( $(table:first).clone() ).html()
On Aug 18, 4:37 pm, Jules jwira...@gmail.com wrote:
Use DHTML property.
@OP: From your example, it appears that the number you want is the
categoryid param in the anchor's href. If that's always the case, you
could save all the DOM traversing and just extract it from the anchor:
$('a:contains(Edit)').click(function(){
var n = /categoryid=(\d+)/.exec(this.href);
Well, the easy answer is just send JSON in both cases, with the HTML
as part of the JSON response. $.ajax returns the XMLHttpRequest that
it creates, so you could get the content type in your success function
and eval the JSON yourself:
var xhr = $.ajax({ ...
success: function(data){
The solution doesn't work. $(h2).text() concatenates all the text
from every h2 (it would also miss any markup inside the h2). If you
want to extract the contents into a variable, then you'll have to
iterate over the collection of h2's to do the manipulation.
There are other ways to accomplish
Is your iframe on the same domain? If not, you can't do this.
On Jul 25, 10:39 am, kknaru isai...@gmail.com wrote:
hi there, i just started working with iframes and i'm stucked :D
so...i have this code inside a html file:
iframe id=myframe
ptext/p
/iframe
what i'm trying to do
You could also just use conditional comments:
!--[if IE 6]
script src=http://path_to_ie_specific_script.js; type=text/
javascript/script
![endif]--
or set a style within the comments and detect that.
On Jul 15, 8:59 am, w1ntermut3 ben.r.ca...@googlemail.com wrote:
Thank you :)
I'm trying
Is there another way to accomplish this?
$(.post).hover(function () {
$(this).find('.category,.comments').show();
}, function () {
$(this).find('.category,.comments').hide();
});
On Jul 13, 9:50 am, aakoch outofthem...@gmail.com wrote:
I find it frustrating that the
ul has a previous sibling (the h1); I suspect there's a head tag
that's the body's previous sibling. In both cases then, prevAll()
would result in a length of 1.
Also I assume you meant the second paragraph, which starts with In
addition to this the earth.
On Jul 9, 12:27 am, Shashank
I did not know about eq and I don't have all fing day to figure this
http://docs.jquery.com/Core/index
http://docs.jquery.com/Traversing/eq
Most everything you will need is in the docs. It's worth spending some
time studying them.
On Jul 9, 11:52 am, expresso dschin...@gmail.com wrote:
I did
FYI this:
if ('http://example.com/foo/bar.html' === $('a', $(this)).attr
('href')) {
alert('Hooray!');
}
is the same as your original code, except for the full url.
On Jul 8, 3:25 am, brightdad...@googlemail.com
brightdad...@googlemail.com wrote:
Yes it worked!
On Jul 8, 10:09 am,
There are also some currency formatting plugins:
http://plugins.jquery.com/project/currencyFormat
(or search currency under plugins)
On Jul 7, 3:11 am, weidc mueller.juli...@googlemail.com wrote:
hi,
thats my code:
endpreis =Math.round(endpreis*100)/100;
to round the price of something
The effects functions apply a style of display:block, which causes
problems for tables. Try
wrapping the table in a div and apply the effect to the div .
On Jul 7, 5:45 pm, Will D willb...@gmail.com wrote:
I have a similar issue with hiding / showing table data.
I have a single table with two
For JSONP, the server needs to wrap the response in the supplied
callback. The cross-domain getJSON function is basically appending a
script to the page, with the contents of that script being a function
containing the data you want to pass back. Play around with the URL in
the flickr example
You mentioned Access to restricted URI denied, which is a cross-
domain error. Just as an FYI, making a request to a different port
number will trigger this. Something to always keep in mind when
working with ajax.
On Jul 6, 10:09 am, expresso dschin...@gmail.com wrote:
Ok, so their sending
http://plugins.jquery.com/project/parseQuery
(minified it's 449 bytes
http://plugins.jquery.com/files/jquery.parsequery.min_.js_.txt)
On Jul 5, 1:41 pm, candlerb b.cand...@pobox.com wrote:
Hello, a quick question in case I'm being stupid :-)
I see that jQuery provides a function to turn
Yes and no. The first filters out all inputs that are not checkboxes
before returning the jQuery object.
The second returns all inputs, including checkboxes, and then filters
out those that aren't checkboxes.
The difference is that with the latter, you can operate on the
filtered result, for
Would this not be 2 different ways to do the same thing?
Yes and no.
The first finds all inputs and excludes checkboxes, returning the
result in the jQuery object.
The second finds all inputs and returns them to the jQuery object,
then excludes those that are checkboxes.
WIth the latter, you
uploadPicture{errors:[This file was already uploaded]}
isn't valid JSON or JSONP
if uploadPicture is a callback function then it needs ( ) :
uploadPicture( {errors:[This file was already uploaded]} );
On Jul 1, 9:25 pm, Ricardo ricardob...@gmail.com wrote:
No. JSONP provides a way to pass
It uses a GET request, so yes, it converts the name:value pairs into a
querystring. Fiddler's fine but you can view the request in Firebug
(which overall has more value for web development).
On Jun 29, 8:00 pm, expresso dschin...@gmail.com wrote:
http://docs.jquery.com/Ajax/jQuery.getJSON
I
Quick example:
$(document).ready(function(){
var floater = function(){
$('img').animate( {'marginTop':(Math.random() * $(window).height())
+ 'px','marginLeft':(Math.random() * $(window).width()) + 'px'},
2000,'linear',function(){
setTimeout(floater,10);
} );
}
In a GET request the length of the URL is also browser dependent. IE
has the shortest (at least as of IE7) at 2,083 characters with no more
than 2,048 in the path portion. A non-scientific 2006 test showed
Firefox to accept at least 100,000 characters, Safari at 80,000
characters, Opera at
Some quick source code:
HTML:
spanAll/span spanB/span ... spanW/span
select size=6
optionBellucci, Monica/option
optionBernhardt, Daniel/option
optionChou, Collin/option
optionFishburne, Laurence/option
optionGaye, Nona/option
optionHulme, Lachy/option
optionLees, Nathaniel/option
optionLennix,
If you want a really simple example:
function test(o) {
var defaults = {
test: ''
};
for(var k in o){
defaults[k] = o[k];
}
alert(defaults.test);
}
test({test: 'It works!'});
(nb. also assigns new properties to 'defaults')
You're opening a blank window; it has no DOM to manipulate (you'd have
to resort to document.write).
On Jun 23, 4:29 pm, ieatsleepsurf michael.schwart...@gmail.com
wrote:
Goal: From window A, I want to manipulate the DOM of window B, where
window B is the result of calling window.open().
My
I had
concocted and work with jQuery 1.3.2.
On Jun 19, 9:16 pm, bombaru bomb...@gmail.com wrote:
Thanks mkmanning!!! I'll give this a try tomorrow and let you know.
Looking at it though... I'm pretty confident it will do the trick.
It's amazing how much more efficiently the original
The default value is 'on'. You need to assign a value to each radio;
also the selector you're using selects all of the radios without
distinguishing between selected or not.
Try this to experiment with:
$(':radio.star').click(function(){
console.log($(this).val());
});
Your html should
Try this:
$('.main ul').each(function(){
var $this = $(this), lis = $this.append($('li').text('More').click
(function(){
lis.toggle();
$(this).text($(this).text() === 'More' ? 'Less' : 'More');
})).find('li:gt(9):not(:last)').hide();
});
Since you
had the $this left over from a different approach :P
On Jun 19, 3:59 pm, mkmanning michaell...@gmail.com wrote:
Try this:
$('.main ul').each(function(){
var $this = $(this), lis = $this.append($('li').text('More').click
(function(){
lis.toggle
the fact.
On Jun 17, 11:47 pm, Loony2nz loony...@gmail.com wrote:
Hi all,
Just for clarification, there is only one form on the page at any one
time.
Thank you all for you thoughts. I'm going to try them tonite.
On Jun 2, 9:40 am, mkmanning michaell...@gmail.com wrote:
if you
If you're testing whether an element's display is either 'none' or
'block|inline|static|etc.' (i.e. not 'none') you can also do this:
$('#subnav-1').is(':visible')
or alternately
$('#subnav-1').is(':hidden')
Either of these returns a boolean.
On Jun 17, 11:20 pm, Jake Barnes
A couple quick examples that might help (there're many more ways):
console.log( $('table tr:last').prev() );
var trow = $('table tr');
console.log( $(trow[trow.length-2]) );
console.log( trow.eq(trow.length-2) );
Modify the selectors as needed for multiple/nested tables.
HTH
On Jun 16, 10:46
$('ul').find('li[typeref=E][typeid=1]')
NB: an id attribute that starts with a number isn't valid markup.
On Jun 16, 10:05 am, Paul Hutson hutsonphu...@googlemail.com wrote:
Hello,
I've been trying to work this out for a bit now but seem to have come
a bit unstuck.
I'd like to be able to
You can simplify your approach; it's not necessary to copy the
properties to the new link as you can just get them at runtime when
the link is clicked (you also don't need to iterate over all the
anchors):
$('a href=/modalwindow.htmlimg src=/images/button.jpg//
a').click(function(){
var
The only way currently to do this in Javascript is to use canvas.
On Jun 10, 5:27 am, David .Wu chan1...@gmail.com wrote:
Can I make image vertical or horizontal flip by jQuery?
The @ before name has been deprecated as of jQuery 1.2
A shortcut for getting (or setting) a form value is $(this).val();
You can use .serialize() to get the values of a form in toto, or for
specific form fields:
//to get checked values from both groups (assuming they're in a form)
$(fieldset:has(legend:contains('Promotions'))).hide()
On Jun 11, 10:43 am, Jesse jesseainsk...@gmail.com wrote:
I'm sure that I'm just missing something simple. Basically, I'm trying
the hide the fieldset element if it contains legendPromotions/
legend but I can't get it to work. Here is my
I think the answers, though informative, have gotten off track. If you
want to open a specific DIV based on the hash in the URL, just use:
var div = window.location.hash;
$(div).show();
You should put the necessary checks to make sure there is in fact a
hash in the url, etc.
On Jun 10, 3:24
Here's a couple other ways:
/F$/.test($('label').text());
or
$('label').text().substr(-1) === F;
On Jun 10, 3:24 pm, ldexterldesign m...@ldexterldesign.co.uk wrote:
Easy guys,
labelA B C D E F/label
Anyone got any tips on how to find out if the last letter of my label
is 'F'?
For the example markup you give it's very simple, just do this:
$('ul li a').each(function(){
$(this).replaceWith( $(this).children() );
});
On Jun 9, 6:26 am, Adardesign adardes...@gmail.com wrote:
Run a .each() to retrieve the images, and delete .remove()
the images and place them
$(div:not(#+pid+) form span).css(background-color,yellow);
On Jun 9, 8:19 am, squalli2008 m...@paskell.co.uk wrote:
Hi,
Im trying to select all spans in divs containing forms that dont have
a certain id
$(div:not([id='#'+pid]) form span).css(background-color,
yellow);
This selects
Yes you do, if you want to filter by ID. Unless the variable pid =
#some_id.
On Jun 9, 1:29 pm, Danny d.wac...@prodigy.net wrote:
You probably don't want the '#' character in there:
$(div:not(+pid+) form span).css(background-color,yellow);
On Jun 9, 11:45 am, mkmanning michaell...@gmail.com
The above post fails due to this:
obj.animate({ opacity:myOpacity}, 500);
animation();
The animation() function will be called immediately each time. It
should be in obj.animate's callback function. That being said, the OP
was asking how to do this without resorting to setTimeout().
To do
should be in the head area of the document.
No it shouldn't. You can put it in the head if you like, but
Javascript blocks downloads, it's ideally a behavior layer that
enhances presentation, etc. Much has been written about putting js at
the close of the body as a best practice:
You already set the postBody in your first jQuery conversion: data
The docs should provide you with all the explanations you need.
On Jun 5, 12:31 pm, deex deecodame...@gmail.com wrote:
Hey all...
I am doing a conversion of prototype to jquery and am stuck on a
script... I can't figure out
It's not a cross-domain security issue, it's a JSONP issue (maybe an
authentication issue). Twitter's API allows you to make GET requests
which are returned as JSON with an option to specify a callback
function. Afaik it doesn't support JSONP however. You can add
callback=some_function and the
Waseem's answer doesn't look good for a couple reasons, most
importantly calling obj.remove(). That will delete the image from the
DOM, which renders every action before it pretty useless :P
It also doesn't take into account the OP's request to also include the
caption text if it exists.
Try
This still won't move the optional caption text (see my post above).
On Jun 6, 4:21 pm, Charlie charlie...@gmail.com wrote:
One reason I follow this board is to learn how to do things I haven't
encountered. I had no idea off top of my head how to do what you want but in
quest to learn
For FF:
window.getSelection().removeAllRanges();
range = document.createRange()
range.setStart(YOUR_ELEMENT, start_position);
range.setEnd(YOUR_ELEMENT, end_position); //0
window.getSelection().addRange(range);
For IE the equivalent is something like:
get the range with
The problem with parents() in the example given is that if your page
structure is more complex, and has nested tables for example, then
parents() will return all parent tables. Likewise if there are tr's
preceding the tr in your example. Here's a couple ways to get the text
you're asking for:
is better only if you want certain forms not to have
the class name or if you have inputs that are not within forms.
On Tue, Jun 2, 2009 at 3:07 AM, mkmanning michaell...@gmail.com wrote:
Or you could just do this:
$(':input,:checkbox,:radio').addClass('YOUR_CLASSNAME');
On Jun 1, 10:24 am
$(h1).css({'color':color});
On Jun 2, 11:50 am, jeff jeffreykarbow...@gmail.com wrote:
Hello, I am trying to get the color of an element and change the color
of another element with that color. Does this make sense?
What is wrong with this? I would like all of the H1 tags to inherent
the
To set the value of a form field, use this:
$(#myFieldId).val()
To do this without setting the field to an empty value, modify your
original approach:
$(#MyForm).submit(function(){
var params = $(this).serializeArray();
$.post('/register.php',
Or you could just do this:
$(':input,:checkbox,:radio').addClass('YOUR_CLASSNAME');
On Jun 1, 10:24 am, waseem sabjee waseemsab...@gmail.com wrote:
script
$(function() {
var myforms = $(form);
myforms.each(function(i) {
var myform = myforms.eq(i);
var myfields = $(input, myform);
If you're html is as you say, you're closing a dl with a div:
dl class=entryphp rendered content /div
As an aside, why not just chain the js?
$('#resume_education dl:first').removeClass('entry').addClass
('first_entry');
On May 24, 7:09 pm, Dave Maharaj :: WidePixels.com
d...@widepixels.com
We've been using jQuery served by Google for almost a year, on a site
that gets about 5 million pageviews a month, with no problems. Is your
page using https by any chance?
On May 22, 3:58 pm, intrader intra...@aol.com wrote:
I am having a problem when loading jSquey from the Google CDN as
A quick look in the jQuery source is always a good start:
hover: function(fnOver, fnOut) {
return this.mouseenter(fnOver).mouseleave(fnOut);
}
On May 22, 9:28 pm, Mattsson carol.matts...@gmail.com wrote:
Hello, I'm very new to jQuery and trying out some of the
There are other non-library solutions to domready out there:
One of the first:
http://dean.edwards.name/weblog/2006/06/again/
or taken from Mootools:
http://snipplr.com/view/6029/domreadyjs/
etc.
Just Google domready, and as Richard said, look at jQuery's source.
On May 21, 6:25 pm, Michael
You might want to doublecheck that when you click the elements you
took out of the loop, you really get what you say. Given your example,
if you click #page2 it should alert 'page3' also.
You don't really need the loop to attach the click and get at the
number if it's part of the id:
You can make your own:
jQuery.fn.fadeToggle = function(speed, easing, callback) {
return this.animate({opacity: 'toggle'}, speed, easing, callback);
};
Probably a little beyond you right now, but study it and check out the
docs.
HTH :)
On May 16, 9:50 am, Sobering stefan.sober...@gmail.com
Btw, you could also combine both effects:
jQuery.fn.slideFadeToggle = function(speed, easing, callback) {
return this.animate({opacity: 'toggle', height: 'toggle'}, speed,
easing, callback);
};
On May 16, 9:49 pm, mkmanning michaell...@gmail.com wrote:
You can make your own
.parent() gets you the immediate parent of the element, .parents()
traverses up through all ancestors, so you could use .parents('.user')
and it wouldn't matter how deep you nest the link. You can also
use .closest(), which finds the closest parent that matches the
specified selector:
);
You'll have to adjust the selector, too, if that div isn't the first
one in your document.
--Karl
Karl Swedbergwww.englishrules.comwww.learningjquery.com
On May 4, 2009, at 9:29 PM, mkmanning wrote:
Sorry, maybe my response was somewhat confusing, but I don't believe
(function($) {$.fn.METHOD_NAME = function() {FUNCTION_CODE}})
(jQuery);
It's a self-invoking anonymous function passing the global jQuery
object as an argument so that it can be referenced inside the function
as '$'. $.fn is simply equivalent to $.prototype (which ==
jQuery.prototype).
Google
No options with Ajax cross-domain (for now). If you can change the
service to wrap the XML in a function call or assign it to a variable
you can use $.getScript().
predefine a function or method:
my_function(xml){
//do something with the xml
}
call .getScript():
Accessing the elements by index returns the element itself. To call
jQuery methods you'd need to do this:
divs = $('div');
div2 = divs[2];
$(div2).addClass('red');
or alternately you could do:
div2 = $(divs[2]);
div2.addClass('red');
you can also use .eq(#):
div2 = divs.eq(2)
, Karl Swedberg k...@englishrules.com wrote:
On May 2, 2009, at 9:28 PM, mkmanning wrote:
Don't use .text(), you'll get an array-like object of text nodes.
Tiny clarification: you'll get a concatenated string of text nodes.
--Karl
Karl
You spelled function 'funtion' and the first thing you do is return
false, so everything after that is ignored--by js and me :)
On May 2, 12:39 am, Amit amit.mca...@gmail.com wrote:
$(document).ready(
funtion(){
return false;
$(#send).click(
Don't use .text(), you'll get an array-like object of text nodes. Try
var text = $('div').contents().filter(function(){return
this.nodeType==3;});
console.log(text)
On May 2, 6:06 pm, nick nboutel...@gmail.com wrote:
Thanks for the response. Are you sure thats correct though?
If that's all you need for the search property, then just use
window.location.host + '?key=val#'
On May 1, 1:39 pm, buntu buntu.w...@gmail.com wrote:
Here is an example:
I need to append '?key=val1' to the current url which is
www.mysite.com/web/test.html
and this I can do using:
To get just the text nodes:
$('div').contents().filter(function(){return this.nodeType==3;});
If you want to filter out 'empty' nodes:
$('div').contents().filter(function(){return this.nodeType==3
this.nodeValue.replace(/\W/g,'')!='';});
Take it from there :)
On May 1, 4:06 pm, nick
There is no second half of my function, those are two distinct
functions. A variable declared with 'var' in the first one isn't
available to the second (without the 'var' it's global and would be
available, but that's not recommended). You can use .data() to store
the width and retrieve it in the
A couple thoughts:
'alt' isn't a valid attribute of span; use 'title'.
Using jQuery doesn't necessarily equate to easier.
//POJS
for (var i = 0; i elem.length; i++) {
if(!elem[i].title){elem[i].title=;}
}
//jQuery
$('span').each(function(){
if(!this.title){this.title=;}
});
On Apr 29,
Use a regex:
$('body').html( $('body').html().replace(/(that|your)/g,'b$1/
b') );
On Apr 28, 9:39 am, kazim mehdi kazim.me...@gmail.com wrote:
hi
by using the following code i am able to find only first occurrences
of the keywords can anyone help me to make it work for all of the
1 - 100 of 368 matches
Mail list logo