[jQuery] Syntax Question

2009-11-17 Thread heohni
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:

Re: [jQuery] Syntax Question

2009-11-17 Thread Michel Belleville
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

[jQuery] how to write the jquery syntax to select single word within an element

2009-09-27 Thread rossenbere
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

[jQuery] Re: how to write the jquery syntax to select single word within an element

2009-09-27 Thread bibby
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

[jQuery] Re: how to write the jquery syntax to select single word within an element

2009-09-27 Thread Charlie
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:

[jQuery] Re: how to write the jquery syntax to select single word within an element

2009-09-27 Thread rossenbere
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

[jQuery] syntax problems

2009-08-26 Thread holicGirl
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

[jQuery] Re: jQuery syntax question

2009-07-14 Thread Matthew
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

[jQuery] jQuery syntax question

2009-07-13 Thread Matthew
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,

[jQuery] Re: jQuery syntax question

2009-07-13 Thread Matt Zagrabelny
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

[jQuery] Re: jQuery syntax question

2009-07-13 Thread MorningZ
$(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

[jQuery] Re: jQuery syntax question

2009-07-13 Thread James
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

[jQuery] Re: jQuery syntax question

2009-07-13 Thread Matthew
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

[jQuery] Re: jQuery syntax question

2009-07-13 Thread Matthew
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){

[jQuery] Re: jQuery syntax question

2009-07-13 Thread Ricardo
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] Syntax Explanation

2009-07-02 Thread expresso
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

[jQuery] syntax error - Expr.attrHandle.href = sw_httprp_rewrite_url(function(elem){)\n

2009-06-18 Thread Angela
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

[jQuery] Re: jQuery syntax

2009-06-17 Thread cz231
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

[jQuery] jQuery syntax

2009-06-16 Thread cz231
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

[jQuery] Re: jQuery syntax

2009-06-16 Thread James
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

[jQuery] Syntax

2009-04-18 Thread Connor
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

[jQuery] 'Syntax error, unrecognized expression: [...@title^=ajax:]'

2009-03-09 Thread vinh1508
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

[jQuery] syntax issue w/ tablesorter

2009-01-27 Thread philliptackett
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

[jQuery] Syntax similar to IN in SQL

2009-01-21 Thread pixelwiz
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') ){

[jQuery] Syntax similar to IN in SQL

2009-01-21 Thread rsmolkin
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') ){

[jQuery] syntax selector problem

2009-01-14 Thread Matt caron
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

[jQuery] syntax for $(response).$('a').each()

2008-12-18 Thread Namotco
$('#divid').load(url, function( response ){ $(response).$('a').each(function(i){ // do stuff }); }); Unfortunately, that doesn't work, what's the correct syntax for that?

[jQuery] formatting splitting the response from the server using jquery syntax

2008-11-25 Thread Sean
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}

[jQuery] Re: formatting splitting the response from the server using jquery syntax

2008-11-25 Thread Charlie Griefer
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

[jQuery] Re: Js traditional to jquery syntax.... how?

2008-11-20 Thread Andrea - Aosta
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

[jQuery] Js traditional to jquery syntax.... how?

2008-11-19 Thread 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; } }

[jQuery] Re: Js traditional to jquery syntax.... how?

2008-11-19 Thread aquaone
$(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 =

[jQuery] Syntax for specifying size of new window with window.open

2008-11-05 Thread Wonder95
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

[jQuery] Syntax question regarding value of currrent element being clicked.

2008-05-12 Thread Pickledegg
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.

[jQuery] Syntax confusion

2008-05-07 Thread [EMAIL PROTECTED]
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

[jQuery] Syntax Error

2008-03-28 Thread Andreas de Reggi
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

[jQuery] Re: How do I use my functions with jQuery syntax alike?

2008-02-23 Thread Nazgulled
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

[jQuery] Re: How do I use my functions with jQuery syntax alike?

2008-02-23 Thread timothytoe
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

[jQuery] How do I use my functions with jQuery syntax alike?

2008-02-22 Thread Nazgulled
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

[jQuery] Re: How do I use my functions with jQuery syntax alike?

2008-02-22 Thread Klaus Hartl
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:

[jQuery] Re: How do I use my functions with jQuery syntax alike?

2008-02-22 Thread Nazgulled
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

[jQuery] Re: How do I use my functions with jQuery syntax alike?

2008-02-22 Thread timothytoe
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

[jQuery] Re: How do I use my functions with jQuery syntax alike?

2008-02-22 Thread Nazgulled
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

[jQuery] Re: How do I use my functions with jQuery syntax alike?

2008-02-22 Thread timothytoe
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

[jQuery] Re: How do I use my functions with jQuery syntax alike?

2008-02-22 Thread Nazgulled
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

[jQuery] Re: How do I use my functions with jQuery syntax alike?

2008-02-22 Thread timothytoe
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

[jQuery] Re: How do I use my functions with jQuery syntax alike?

2008-02-22 Thread Nazgulled
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 = {

[jQuery] Re: How do I use my functions with jQuery syntax alike?

2008-02-22 Thread timothytoe
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($) {

[jQuery] syntax question

2008-02-15 Thread Alexandre Plennevaux
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

[jQuery] Syntax for bind using a string from a variable for the callback functions name

2007-10-16 Thread Mark Lacas
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;

[jQuery] syntax errors in jquery-1.1.3.1.js

2007-07-16 Thread Rick Pasotto
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

[jQuery] Syntax for selecting a form element named 'foo[0]'?

2007-07-03 Thread sprak
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]