at first glance, you may be expecting the :hidden selector to work
differently than it actually does:
http://docs.jquery.com/Selectors/hidden
the original implementation, before 1.3.2, checked for either
display:none or visibility:hidden, whereas the new implementation
selects elements ...if it
just out of curiosity, have you checked to make sure you aren't using
the $.ajax() method (or one of its convenience methods) elsewhere? i
see in the first set of headers that the X-Requested-With header is
present, which is generally added by jQuery (and most other libs) when
a request is
i'm not sure i understand... hard-coded numbering? something like this
(?) :
HTML
ul
li1 spanList Item/span/li
li2 spanList Item/span/li
li3 spanList Item/span/li
/ul
if you are looking for a numbered list, you should be using the ol/
tag, although the ol/ tag is going to have the same
inside of the function that you pass to click(), the keyword this
will point to the raw DOM element that dispatched the event. so, in
your example, you need to add:
$(document).ready( function ()
{
$(.delete).click(function()
{
what do you mean by snappy? you could always just use CSS (not sure
how this questions relates to jQuery or JavaScript at all) to replace
the bullet with your own image:
HTML:
ul
liList Item 1/li
liList Item 2/li
liList Item 3/li
/ul
CSS:
ul li {list-style-type:none;background:transparent
At the moment I'm not so interested in the right/smart way to write an
a tag. It's more interesting to me to see what the jQuery click()
function can and cannot do
ok, then read the source. we're trying to offer solutions to the
problem, but if you just want some info on what jQuery's click
can you post a test page? just by scanning, there isn't anything that
jumps out at me as being broken/syntactically incorrect...
just a tip, though, you can combine your selectors to make that part
more efficient:
$(function(){
$('#username, #password, #valicode').keydown(function(event){
also, just as a head's up... even when you store numbers as the
value attribute on an option/ tag, they are interpreted as strings
in javascript. so, from your example above, you might also consider
switching your condition to:
// Compare as string instead
if ($(#id_status).val() === '6'){
charlie and dave are correct: you should use elements semantically to
ensure your content runs on as many platforms/devices/configurations
as possible. with that being said, there is a simple answer to your
original question:
HTML:
strong id=fake_linkHome/strong
JS:
Aptana (built on Eclipse) also has great jQuery support.
http://aptana.com/
On Nov 19, 9:28 am, devilmike devilm...@gmail.com wrote:
This isn't specifically for jQuery, but NetBeans handles it extremely
well. I use the Early Access for PHP version.
Michael
On Nov 19, 4:13 am, Ankur_Patel
if you have to keep your JavaScript inline, you should use the onclick
attribute instead of using the javascript: pseudo-protocol. it was
never fully standardized, and is a lingering piece of old-school
JavaScript usage. so for your example above, use:
a id=a1 onclick=doSomething();#a1/a
an even
should also be pretty easy to roll your own :not-checked selector:
$.expr[:][not-checked] = function(elem, i , m) {
// use === false to avoid undefined checked property
// creating false positives
return elem.checked === false;
}
On Nov 19, 3:00 pm, Charlie Griefer
jayarjo,
you might be interested in firequery, an experimental firebug
extension that visualizes jQuery manipulations.
http://firequery.binaryage.com/
On Oct 29, 7:54 am, Bjarki bjar...@gmail.com wrote:
Using firebug:
you can write $('selector').data('events') in the console and run it.
then
hi lukas,
you can't specifically listen for refreshes, but you can listen for
unload events. an unload event is dispatched when:
- a link is clicked to navigate away from the page
- the window.location property is changed
- the tab is closed
- the browser window is closed
- etc
to play around
Hi Ryan,
The reason you are having problems is likely due to the way jQuery
determines DOM readiness. As noted above, if functions are passed to $
() or $(document).ready() after the DOM has loaded, they are executed
immediately. This produces the behavior you are expecting. But when
jQuery
Hi Julijan,
It sounds like what you need is a :text-equals filter The reason
:contains fails in this case is because it does a global match. By
anchoring the same RegExp against the beginning and end of the string,
you should be able to select elements whose text matches exactly:
// Existing
I think this is a known limitation of jsonp as a technique, not a bug
with jquery itself. Jsonp works by appending a script tag to the DOM,
whose src attribute points to the URL you specify. The URL is
expected to wrap a json object in a function call to the function you
specify, and the returned
hi GonzoDesign -
this is a straight port. i'm not that familiar with mootools, so one
aspect that may be off is the selection of elements. i'm assuming $
('europe') returns the element with an ID of europe but if not
you'll need to change the ported selectors. you can read up on how
jQuery
hey Shane,
Nick's comments above simply reinforce the need for explicit variable
declaration. ignoring the var keyword, even when picking names that
don't collide with properties of the window object, is a dangerous
practice. it leads to hard-to-spot bugs, scope issues, and a whole
mess of other
are you using the validate plugin? i'm not familiar with it at all,
but for a simple validation like this you could do:
// DOM-ready handler
$(function() {
// Listen for onsubmit events for the form
$(#signupForm).submit(function() {
// Get the checkbox
hi a1anm,
if it's a CSS property, you can always determine that without relying
on the deprecated $.browser object...
$(function() {
// Check for the property you are interested in. Will be a
Boolean value
var opera = typeof $(body)[0].style[OperaOnlyCSSProp] ===
undefined;
@Dhruva-
It should be $(this).reset();
That won't work. Note that reset() is a method that is available on
raw form elements in the DOM, but not on a jQuery-wrapped set.
// Example for Firebug
console.log(jQuery.fn.reset) // undefined
@pritisolanki -
You can't expect the selector engine (or
The change event handler can also be passed by reference, avoiding the
need for the closures
(#obj1,#obj2,#obj3).change( setupPage );
On Sep 15, 7:40 am, Mr Speaker mrspea...@gmail.com wrote:
you can select multiple objects in the selector, like: $
(#obj1,#obj2,#obj3).change(...)
On
Hi runrunforest,
To elaborate on Benn's explanation, the $.each and $().each() methods
provide two arguments inside the callback you supply. The first is the
index (either an enumerated key for arrays or a string key for
objects). The second is the value (the value associated with the
current
Hi saqib,
The live() method doesn't allow for passing custom data to the
handler.
http://docs.jquery.com/Events/live#typefn
There are possible solutions, though. Depending on what you need to
pass, you might be able to do so by using the data() method to store
your values on an element, and
You can always create a new selector, one that works *almost*
as :contains does. The issue in your case (as I understand it) is
that :contains does a global search, so text that is not at the
beginning is still matched. It sounds like what you need is a :begins-
with filter.
Extending the filter
@Rupak,
I'm not sure if this answers your question, but all wrapped sets have
a scrollTop() method that can be used to retrieve or set the scrollTop
value. For example, to determine how far down the page has been
scrolled, you can use:
var top = jQuery(window).scrollTop();
The same method can
Here's the docs:
http://docs.jquery.com/CSS/scrollTop
On Sep 1, 9:34 am, KeeganWatkins mkeeganwatk...@gmail.com wrote:
@Rupak,
I'm not sure if this answers your question, but all wrapped sets have
a scrollTop() method that can be used to retrieve or set the scrollTop
value. For example
.
On Aug 30, 7:22 pm, a1anm alanmoor...@gmail.com wrote:
Hi,
I tried this but it didn't work. It resulted in the class not being
removed at all. You can see here:
http://www.toomanydesigns.com/test/noflash/
On Aug 30, 11:20 am, KeeganWatkins mkeeganwatk...@gmail.com wrote:
The basic
The basic syntax for delaying a function using setTimeout is this:
setTimeout(function() {
// ...code here executes when the timeout is complete
}, 2000 /* Length of timeout, in milliseconds */);
so for your example, something like this should work:
$(document).ready(function(){
Jesper, in your first example, you were passing the string this, not
the keyword. The keyword this is a reference to the button (in that
case), and the string this is useless for that purpose. In your
second example, you are creating a wrapped set, accessing the first
element in that set, and
@tinker - first, as BabBna suggested, don't hijack someone else's
post! :)
second, in relation to your question, here is what you need:
var scripts = document.getElementsByTagName(script);
var thisScript = scripts[scripts.length - 1];
after running this code, the variable thisScript is now a
it does not work in every browser. the purpose of jQuery and similar
libraries is to streamline development and create a (mostly)
consistent foundation to build on, regardless of browser. if you're
interested in gaining some performance, or just using the latest JS
features, i'd suggest
...@gmail.com wrote:
IMO, it doesn't belong in the core
I think I read somewhere that a check for that usage will be in 1.3.3
core, but damned if I can find where I saw that stated
On Aug 25, 9:59 am, KeeganWatkins mkeeganwatk...@gmail.com wrote:
it does not work in every browser. the purpose
have you considered just checking for a jQuery method? seems like that
would be the cleanest, least intrusive way of doing your check, for
example:
function get_object_from_id(variable)
{
// if the param has a attr property (which jQuery
objects do,
//
i wrote a really simple plugin for this, as i frequently have the same
use case:
jQuery.fn.outerHTML = function() {
return jQuery(div/).append( jQuery(this[0]).clone() ).html();
}
so that i could call it on any element, such as:
$(#fooID).outerHTML();
On Aug 19, 9:55 am, John
Jon is correct... you are using an assignment operator in place of an
equality operator. the code you have above executes to mean:
// this isn't a test for the checkbox's state, it just sets it to true
if (document.getElementById(ownCheck).checked = true)
ownerCheck = true;
else
Can you be sure that the response isn't being cached in IE? Even if
the .cfm response is changing, you might try to bust the cache with a
semi-random query string, i.e:
var path = '../components/propertiesDisplay.cfm?' + (new
Date).getMilliseconds();
$(#hiddenResult).load(path, null,
can you post some code? it's hard to offer suggestions with nothing
more than an error code to analyze...
although I'd bet you're calling your webservice via Ajax, and that the
service is not on the same domain. if this is the case, you'll need to
either: a) move the service to the same domain
With all due respect, I think karl's solution is somewhat less than
elegant, and could be improved by refactoring to:
// test for anything but numbers
var isValid = /[^\d]/g.test(textareaValString);
if (isValid) {
// proceed with confidence
} else {
// note to user: no numbers allowed!
In general, form selections will persist when the page is refreshed.
If you add a random query string like ?foo=bar, you should see your
selections reset.
In regards to james' comments above, I think it would be far cleaner
to reset the form before the page unloads. This is a simple task:
you should be able to include all those elements in a single set, and
then apply the styles once. for example:
$(this).find(a).css(text-decoration , underline);
Note that this will grab ALL the descendant links inside
the .JQorangeHighlight element.
On Jul 10, 8:33 am, Jacques Choquette -
:
Thanks for the info, Ralph and Keegan.
I performed the ugly:
jQuery('#' + id.replace(/:/g, '\\:'))
But the other suggestions look good too (plus there is nothing to escape
- bonus.)
Cheers,
On Thu, 2009-07-09 at 16:15 -0700, KeeganWatkins wrote:
Or you can use the attribute selector
BaBna is correct, the alert is firing before the response has come
back, try adding the alert inside the callback. however, i would not
recommend removing the var keyword. as it is now, you have:
script type=text/javascript
var tb1=[];
$(document).ready(function() {
//
oops, not href attribute, as its an image. still holds true though.
On Jul 10, 1:00 pm, KeeganWatkins mkeeganwatk...@gmail.com wrote:
jQuery isn't actually changing your href attribute, the browser
is... when you use relative paths in links (and some other elements as
well) the browser
jQuery isn't actually changing your href attribute, the browser
is... when you use relative paths in links (and some other elements as
well) the browser automatically appends the domain. if you need
something else, either change your relative paths to mirror something
that works for you, or
you'll need to use a regular expression to get what it is that you are
looking for...
something like this might work:
pre
// get the full string
var filterString = $('img').css('filter');
// get the src='aa.png') piece
var filterSource = filterString.replace
Ralph is correct, as jQuery uses the colon as a prefix for selector
filters like :hidden and :last. To fix, you can just pass in the raw
node like this:
jQuery(document.getElementById( actual element ID))
which will return the wrapped set. Cheers.
On Jul 8, 3:47 pm, Ralph Whitbeck
Or you can use the attribute selector for brevity:
jQuery([id=' + actual element id + '])
which will return the same element. Hope that helps.
On Jul 9, 6:10 pm, KeeganWatkins mkeeganwatk...@gmail.com wrote:
Ralph is correct, as jQuery uses the colon as a prefix for selector
filters like
The issue is that your selector returns a jQuery object, not a raw
DOMElement, which is what swfobject and/or ExternalInterface expect.
Use this instead:
var elem = $(#someId)[0];
elem.reload();
the difference is that by using array access to get the first element
in the wrapped set, you can
not sure how/why this question keeps coming up, but the answer is no.
there was a post on this group claiming that jQueryUI was calling
home to jqueryui.com, when in fact that author was simply linking to
the script on the jqueryui.com domain, but i digress...
the jQuery library does not
51 matches
Mail list logo