Hi,
I have build a function like this:
var init_number_of_bikes = function(){
// Request all avail. bikes
var urlextend = findBikes();
$.ajax({
type: get,
url:
It would help if your function was ready to receive this additional
parameter wouldn't it ?
var init_number_of_bikes = function(chosen_id) { ... };
Then you could use the value. If someone calls the function and gives no
value, it'll be empty (empty is false when used as a boolean in
Hi
I'm a newbie.
I just don't know how to construct the jquery selector syntax to pick
up a single word on click from within let's say a p element and then
trigger some function in which the selected word is going to be used.
(Something like when you click a word on an HTML page and get the
Hi rossenbere,
There's something about text that you should be aware of; text is
rendered as tree nodes just like other elements, the difference being
that they are unique types. ( elm.nodeType == 1 == DOM Element ,
elm.nodeType == 3 == TextNode ).
In the example, a div with 2 paragraphs. Each
great explanation!
Rather than reinvent the wheel I've used the "highlight" plugin with
success. I'm sure there are probably other plugins for same purpose as
well
http://johannburkard.de/blog/programming/_javascript_/highlight-_javascript_-text-higlighting-jquery-plugin.html
bibby wrote:
Thank you so much bibby for trying to answer my question so
thoroughly. My call for help was in fact dictated by lack of time. I
thought the solution was somehow going to be obvious, but now it see I
was totally wrong.
On 27 sep, 16:47, bibby li...@bbby.org wrote:
Hi rossenbere,
There's
Hello,
I have a basic knowlegde of jQuery and a problem in selecting a link.
To be specific I've a problem with the syntax.
I'm using several libraries so I can't use for example the $
('a#myLink') function but I've to write jq('a...@id=myLink]').
The application don't recognize the syntax, it
Hi Ricardo, thanks for the clarification, i thought I rememberd seeing
the $( $(x)[2] ) syntax somewhere. I like that better than the eq().
My ID's are all good, I just needed the 'body#seniors #text' so only
pages in my senior section would be altered, but I guess doing a php
if/else would have
So it seems like everyday I learn a new way to code the same thing.
What I am trying to do is add some code after a paragraph depending on
how many paragraphs are in the content. I'm not to worried about logic
right now just syntax. Here is my code:
My questions is regarding this syntax: $(p,
On Mon, 2009-07-13 at 12:09 -0700, Matthew wrote:
So it seems like everyday I learn a new way to code the same thing.
What I am trying to do is add some code after a paragraph depending on
how many paragraphs are in the content. I'm not to worried about logic
right now just syntax. Here is my
$(p, body#seniors #text)[2].
does not mean third paragraph
nth-child would be what you could use
http://docs.jquery.com/Selectors/nthChild#index
On Jul 13, 3:09 pm, Matthew mvbo...@gmail.com wrote:
So it seems like everyday I learn a new way to code the same thing.
What I am trying to do
The eq() selector is one way of doing it:
http://docs.jquery.com/Selectors/eq
On Jul 13, 9:09 am, Matthew mvbo...@gmail.com wrote:
So it seems like everyday I learn a new way to code the same thing.
What I am trying to do is add some code after a paragraph depending on
how many paragraphs are
Ok, so eq() seems to work fine, I tried nth-child but im not sure if
it worked the way I wanted. When I console.log eq() for the code
snipet I provided i get [p] does that look right?
Here is a DOM example from my page:
body id=seniors
...
...
div id=text
some divs and ul navigation
h1../h1
nevermind my last reply, eq() works great, I just forgot to change my
code... here is the code snipet that works (for future reference)
jQuery.get(http://www.online-health-insurance.apollobackstage.com/
includes/seniorFreeQuoteBody.php, function(data){
Well, $( $(x)[2] ) is exactly the same as $(x).eq(2), and eq() is way
slower cause it needs to preserve the object and stuff. The point
everyone missed is that $(x)[2] gives you a DOM element, not a jQuery
object, that's why you need to rewrap it in jQuery.
Also, IDs should be unique (only one
jQuery right now is still like a foreign language to me. I have
books, etc. but can someone tell me what's going on here:
// Create shortcut for internal use
var $jc = $.jcarousel;
$jc.fn = $jc.prototype = {
jcarousel: '0.2.3'
};
what is prototype, and what is
Hi all,
I am getting the above error which is part of the jQuery library when
running my application through SonicWall reverse proxy and all the
javascript using jQuery is no longer working. Has anyone had the same
problem or if you know of any suggestions on how to fix this?
Thanks,
Angela
Hi,
Thanks for the reply. After some investigation, I found that in my xml
file it said:
?xml-stylesheet type=text/xsl media=screen href=/~d/styles/
rss2enclosuresfull.xsl?
So just for kicks I put dataType:text/xsl
And I think I made progress, but I'm not sure. Because now, it creates
the
Hi,
I've been working on a project that uses xml. But for some reason, it
does not work in internet explorer. And after hours and hours of
debugging, I cannot figure out why. I would deeply appreciate it if
you could help me. I hope this isn't asking too much, but what is
wrong from the code
IE seems to have a problem with returning the correct header for the
XML content-type. You'd have to either have the server force the
content-type text/xml for .xml files, or if generated through a script
(e.g. PHP) have the script set the header content-type when serving
the XML.
I've came upon
Hi,
I've learned jQuery javascript pretty recently. That being said, I'm
not entirely confident in my syntax. I've just recently completed some
jQuery and it works perfectly in all browsers except IE6. I'm guessing
because IE6 is more strict. Anyways, would anyone mind looking through
this
use: ajaxtooltip.js (website:
http://www.javascriptkit.com/script/script2/ajaxtooltip.shtml
)
error: [Exception... 'Syntax error, unrecognized expression:
[...@title^=ajax:]' when calling method:
[nsIDOMEventListener::handleEvent]
with jquery 1.2.6 work, but not work with jquery 1.3.x
Can any1 help me? I've just downloaded tablesorter and jquery and
included them in my cold fusion project at the root. I'm not very good
at javascript syntax.. and I'm getting an error, but I don't know why.
Here's a chunk of code from my head section:
script type=text/javascript
Hi All, I am sure this is an easy question for someone in here. Is
there a better, cleaner, shorter way to write this:
if ( ($('#price_group_lesson').attr(value) == 'B') || ($
('#price_group_lesson').attr(value) == 'C') || ($
('#price_group_lesson').attr(value) == 'D') ){
Hi All, I am sure this is an easy question for someone in here. Is
there a better, cleaner, shorter way to write this:
if ( ($('#price_group_lesson').attr(value) == 'B') || ($
('#price_group_lesson').attr(value) == 'C') || ($
('#price_group_lesson').attr(value) == 'D') ){
If I have:
$(div).click(function(){
//How do I do the following
$(this + p).show();
});
I want to select the child p of the div I clicked, and I know there's
proper syntax to it, but I am completely brainfarting on it.
Thanks!
Matt
$('#divid').load(url, function( response ){
$(response).$('a').each(function(i){
// do stuff
});
});
Unfortunately, that doesn't work, what's the correct syntax for that?
Hi There,
I'm getting a response back from a .net page. The response looks like
this and is variable in length. What is the best way to handle this on
the client using jquery syntax?
Sean
{first: slideshow/52/2.jpg,second: slideshow/52/2_2.jpg}
On Tue, Nov 25, 2008 at 2:12 PM, Sean [EMAIL PROTECTED] wrote:
Hi There,
I'm getting a response back from a .net page. The response looks like
this and is variable in length. What is the best way to handle this on
the client using jquery syntax?
Sean
{first: slideshow/52/2.jpg,second
thank you: but this only set the selected value, and not the set the
selected index
On 19 Nov, 19:19, aquaone [EMAIL PROTECTED] wrote:
$(select).val(value); // for simple select
$(select).val([value1,value2]); // for select multiple
stephen
On Wed, Nov 19, 2008 at 10:15, Andrea - Aosta
i Have this traditional style js script
function Select_Value_Set(SelectName, Value) {
eval('SelectObject = document.' + SelectName + ';');
for(index = 0; index SelectObject.length;index++) {
if(SelectObject[index].value == Value)
SelectObject.selectedIndex = index;
}
}
$(select).val(value); // for simple select
$(select).val([value1,value2]); // for select multiple
stephen
On Wed, Nov 19, 2008 at 10:15, Andrea - Aosta [EMAIL PROTECTED] wrote:
i Have this traditional style js script
function Select_Value_Set(SelectName, Value) {
eval('SelectObject =
OK, I know I'm not the first one to ask this, but I'm stumped. I'm
working on a Drupal site, and the client didn't like my nice block I
created for a little calculator, so they want a popup window instead.
So, I created a separate .htm page with the HTML for the form (four
fields plus a button
Heres my code:
This fires on any dropdown with the class 'ajaxdropdown': However, it
errors telling me that event.val() is not a function. How do I refer
to the current dropdown being changed, and get its value? I know $
('#idofdropdown').val() will work, but I need to use multiple
dropdowns.
X-no-archive:yes
Is the comma after line 1854 valid syntax or is it an error?
// Init the element's event structure
1854 var events = jQuery.data(elem, events) || jQuery.data(elem,
events, {}),
1855 handle = jQuery.data(elem, handle) || jQuery.data(elem,
handle, function(){
1856 // returned
Hy!
This is the code:
$(a.fdisplay).mousemove(function(e) {
var cssObj = {
left: e.pageX,
top: e.pageY-190,
}
$(div.fbaloon).css(cssObj);
});
Opera gives me a syntax error:
$(div.fbaloon).css(cssObj);
^
I'm trying to make a div folow my pointer on moving it
Ok, thanks for all your help...
If anyone else can provide any more insight on the differences between
those 2 pieces of code...
On Feb 23, 2:05 am, timothytoe [EMAIL PROTECTED] wrote:
I don't know if there's any practical difference. Maybe someone more
knowledgeable can chime it. Perhaps the
I bet if you asked on the jQuery development board, you'd get a good
answer. The people reading that one are more likely to understand the
internals.
On Feb 23, 4:59 am, Nazgulled [EMAIL PROTECTED] wrote:
Ok, thanks for all your help...
If anyone else can provide any more insight on the
Hi,
Let's say I have 2 different javascript files. I like to organize my
code that's why I use 2 different files so each file will only have
functions that fall into that file's category.
Anyway, here's the files layout...
file1.js:
function Fn1() { ... }
function Fn2(a, b) { ...}
file2.js
On Feb 23, 12:14 am, Nazgulled [EMAIL PROTECTED] wrote:
Hi,
Let's say I have 2 different javascript files. I like to organize my
code that's why I use 2 different files so each file will only have
functions that fall into that file's category.
Anyway, here's the files layout...
file1.js:
Thanks...
And what's up with the:
(function($) {
// CODE
})(jQuery);
This was the thing that got me most confused when reading the
documentation. Can someone explain me this, what it does, what is for
and the best scenarios where would I need to use something like this?
If possible, explain
JavaScript has really expressive ways to call functions. The first
parentheses hide the function (make it anonymous) and the second
executes the code immediately with the parameter listed. I'm a newbie
myself, but I think that means right now, pass the variable jQuery in
as $ to the function and
And what exactly it means to hide a function, making it anonymous?
timothytoe wrote:
JavaScript has really expressive ways to call functions. The first
parentheses hide the function (make it anonymous) and the second
executes the code immediately with the parameter listed. I'm a newbie
The function doesn't have a name, so it doesn't pollute the namespace,
and it's great for making functions inline for handlers and
setTimeout() without the burden of having to make up a name that won't
even be referenced.
It's an outgrowth of everything being an object in JavaScript, and
being
timothytoe wrote:
The function doesn't have a name, so it doesn't pollute the namespace,
and it's great for making functions inline for handlers and
setTimeout() without the burden of having to make up a name that won't
even be referenced.
Can you give me an example of what you mean? I'm
Any time you create a function without a name it's anonymous. Example:
window.setTimeout(function() { alert('Hello world!') }, 60);
On Feb 22, 4:56 pm, Nazgulled [EMAIL PROTECTED] wrote:
timothytoe wrote:
The function doesn't have a name, so it doesn't pollute the namespace,
and it's great
I see, but...
How is this:
(function($) {
$.something = function() { alert('something'); }
$.test = {
abc: function() { alert('test'); }
}
})(jQuery);
Different from this:
jQuery.something = function() { alert('something'); }
jQuery.test = {
I don't know if there's any practical difference. Maybe someone more
knowledgeable can chime it. Perhaps the former ends up being a savings
in file size if you have a lot of functions.
On Feb 22, 5:44 pm, Nazgulled [EMAIL PROTECTED] wrote:
I see, but...
How is this:
(function($) {
hey mates,
I didn't find an answer to my week-old question so i'll rephrase to
simplify and focus on just the little bit of knowledge i need from you
guys:
say i want to create a function that performs some jquery methods on an element.
function doThis(){
$(this).text('i've been
Hello,
I'm stuck on a silly detail.
I want to bind a click to a function whose name is a simple string in
a variable from a database
I've tried a number of different syntactical combinations but none
seem to work.
Here is my code:
$( .object ).each( function() {
var element = this;
I'm fairly new to javascript so this may or may not be important.
One of the posts today led me to the jslint.js program. Running it with
rhino on jquery-1.1.3.1.js reports many, many errors. It quit at line
275 complaining of 'too many errors'. Most of the errors were (caused
by) missing
Greetings; I have a form on my page that contains two select fields.
They are
setup like this:
form id=myForm
select onchange=_hs_swapOptions(this.form, 'categoryID', 0);
name=categoryID[0]
option value=12hello/option
option value=11world/option
/select
select name=categoryID[1]
52 matches
Mail list logo