[jQuery] Re: [ANNOUNCE] Machinetag plugin- initial release

2009-04-15 Thread Jean

i want to know how to structure that in sql

On Tue, Apr 14, 2009 at 10:16 PM, cldwalker gabriel.hor...@gmail.com wrote:

 Hi,
  I'm announcing the initial release of Machinetag,  a jQuery plugin
 for your machine tag needs. Machine tags (aka triple tags) are just
 tags with two levels of context. For an intro to machine tags, read
 http://tagaholic.me/2009/03/26/what-are-machine-tags.html .

 Plugin links:

 Blog post: http://tagaholic.me/2009/04/14/i-am-machine-tag-and-so-can-you.html
 Code: http://github.com/cldwalker/machinetag.js/tree/master
 Demo: http://tagaholic.me/blog.html#post:*

 My plugin provides search and display functions for machine tagged
 content. My hope with this plugin is to bring machine tagging to
 everyone. It has mainly been a flickr-only thing for some time.

 This being my first jQuery plugin, all feedback is welcome, especially
 concerning jQuery conventions.

 Enjoy!
 Gabriel




-- 
[]´s Jean a.k.a Suissa

Tecnólogo em Análise de Sistemas - UTF-PR


[jQuery] accordian div change on another button??

2009-04-15 Thread HISSAM

Hii guys,

  Tell me how to change a div of an accordian on a
click of some other button
I also want to prevent the default event of changing div on click on
header

How do I do it?
Please help in urgency!!


[jQuery] Re: how to call 1 function from many buttons by passing parameters

2009-04-15 Thread HISSAM

thanks dude!!

On Apr 15, 10:35 am, Mohd.Tareq tareq.m...@gmail.com wrote:
 Hi Hissam,
 If you have 5 div :

 $(function(){

 $('.common').click(function(e){

 $('.common').hide();

 var targetId = e.target.id;
 $('#'+targetId).show();

 });
 });

 div id=1 class=common/div
 div id=2 class=common/div
 div id=3 class=common/div
 div id=4 class=common/div
 div id=5 class=common/div

 try with this .

 cheers.

 On Mon, Apr 13, 2009 at 6:50 PM, Eric Garside gars...@gmail.com wrote:

  Take a look at the jQuery UI Accordion plugin.

 http://ui.jquery.com

  On Apr 13, 6:30 am, HISSAM hissam.sher...@gmail.com wrote:
   Hey I'm new to JQuery

   I have 5 divs
   At a time only 1 div should be expanded the others must be hidden

   I'm using the show and hide function
   But I want to function parameterised to open the respective div and
   hide the other which is open

   How do I go about ??


[jQuery] Re: [autocomplete] charset

2009-04-15 Thread borutt

Hello,

I have watched backend log of requests with fiddler. For input request
I get this:

GET /PHP/data.php?sid=0.179863580913668q=
%C4%8Duklimit=10timestamp=1239779442412 HTTP/1.1
x-requested-with: XMLHttpRequest
Accept-Language: sl
Referer: http://172.21.6.1/PHP/data.php
Accept: */*
UA-CPU: x86
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET
CLR 1.1.4322; .NET CLR 2.0.50727; InfoPath.2; .NET CLR
3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR
3.0.4506.2152; .NET CLR 3.5.30729)
Host: 172.21.6.1
Connection: Keep-Alive
Cookie: PHPSESSID=tmsfhiblj5it0a46m8fo62laf5

My input was čuk but like it's seen from GET params, q param has
strange chars.
But in QueryString it is ok.

But when I check param q at the end of request (when it passes value
to sql) I get value äťk.
For now I have replace characters äť with č and is ok. But that is
not the solution.

I have set all the header for character set to windows-1250. I think
that the problem is with ajax request in your script. But I might be
wrong.

Does this help you any more?

Thanks

On Apr 14, 6:37 pm, Tom Worster f...@thefsb.org wrote:
 On 4/14/09 11:54 AM, borutt borut.toma...@gmail.com wrote:



  was the page with the form containing the input element explicitly served
  with header Content-Type: text/html; charset=Windows-1250? (i check
  headers sent in WebKit Inspector, i'm sure there are other ways.)

  I have included in the html header this line:
  meta HTTP-EQUIV='Content-Type' Content='text-html;
  charset=windows-1250'

 that's not necessarily sufficient. if the the server sends, for example,
 charset=ISO-8859-1 in the headers then the user agent should ignore the meta
 HTTP-EQUIV. read this:

 http://www.w3.org/TR/1999/REC-html401-19991224/charset.html#h-5.2.2

  have you set the accept-charset attribute in the form?

  I have not I never did. Will try this tomorrow.

 this has even lower priority than the meta HTTP-EQUIV. if the http header
 explicitly sets anything other than windows-1250 then that's what will take
 effect in the user agent.

  A assumed that goes something wrong with value after it is submited by
  ajax.
  Because when I receive value from q argument it's already scrambled.

  Have any idea?

 make sure the header of the form page specifies windows-1250.

 check in your server logs to see exactly what the query string was in the
 ajax request. compare that with what you receive in the script. if the query
 string is correct but the input value in your script is wrong then it's
 probably to do with configuration of your script interpreter. if the query
 string received in the http server GET request is wrong then the user agent
 is probably using the wrong charset.


[jQuery] Re: Final Four: Grabbing Keys, Styling Columns, Pop Up Forms, Edit Select Lists?

2009-04-15 Thread Tony

Hello,
#1) Yes you are right and I agree that the id should be configurable
from the developer.
This of course requiere a lot of work, but I think I will implemet
this.

#2) Check to see if you have loaded all the needed css and js files.
This is mostley caused that jqModal.css is not loaded.

#3) Definitley I will aplly this to the new 3.5 version.

#4) It is better to send me the configuration.

#5) Little stange. Which version do you use.
Also check your server response what you have in total records

Regards
Tony

On Apr 14, 7:50 pm, briandus bri...@virtual-essentials.com wrote:
 Hi Tony -

 #1) thanks so much for the hint on the readonly field. I must have
 missed that one in the documentation; works perfectly! Howover, the
 row placement being the value of the id that is being sent is
 obviously a problem as I can't use that to manipulate my database
 records. Unfortunately, I can't change the field name in the database
 which is named ID and I'm using VB.NET on the backend which isn't
 case sensitive. So, I'm having a conflict between the id and the
 ID. But, I have ID defined like this in the colModel:

 { name: ID, width: 3, hidden: true, key: true, sorttype: 'int',
 editable: true, editrules: { searchhidden: true, index: 'ID', jsonmap:
 'ID' }, editoptions: { readonly: true} }

  I was thinking maybe I could just send this field as an extra
 parameter or something. But, isn't the key attribute what should
 make it the id ?

 #2) I am using FF primarily, but am testing along in IE 6 and 7 as I
 move forward. Yesterday, it was the Add record form that was always
 popped open when I opened the page, but since then I added a show/hide
 column window and now it's the one that's showing up on each page
 request. I'm assuming it has something to do with the way I am trying
 to implement the method. I just have it tacked on at the end, instead
 of being inside an event. I guess I need to attach it to a click event
 instead.
   }).$(#searchFields).filterGrid(#mygrid, { gridModel: true,
 gridNames: true, formtype: vertical, enableSearch: true,
 enableClear: true, autosearch: true });

 #3) Sorry to hear about the column styling, but I'll be looking
 forward to seeing your new features for that in the future.

 #4)  I have a large grid (about 165 lines)  so I'm not sure how you
 want me to send it. Do you want me to send all of the grid
 configuration or just a piece of it? Here is an example of how I have
 defined one column that needed a select list on the edit form:

 { name: InterchangeVersion, width: 25, resizable: true, sortable:
 true, sorttype: 'text', editable: true, edittype: 'select',
 editoptions: { value: 004010X098A1:4010 Prof A1;004010X097A1:4010
 Dental A1;004010X096A1:4010 Inst A1;004010X098A:4010 Prof;004010X097A:
 4010 Dental;004010X096A:4010 Inst }, editrules: { required: true,
 index: 'InterchangeVersion', jsonmap: 'InterchangeVersion', label:
 'InterchangeVersion', resizable: true, search: true} },

 The value held in the database (and displayed in the grid) is the
 value on the left of the colon. The text to show in the dropdown is
 the right side. Is this correct?

 #5 ) The other thing I was going to ask also is that on my pager, I
 have 7 total records, but it shows 14. Yesterday it was doing the same
 thing. I had the records per page set to 3 and there were a total of 5
 records, but the pager showed 8. And, it always shows page 1 of 0. I
 was using alert's after the json string was read and it alerts the
 correct number of pages, so I was just curious what I may be doing
 wrong there and what I could look for.

 Thanks so much!!

 On Apr 14, 2:44 am, Tony t...@trirand.com wrote:

  Hello,

  #1)
  colModel : [
  { name:ID, hidden:true, editable:true, editrules:{edithidden:true},
  editoptions:{readonly:true} },
  ..
  ]
  Look into the docs for more details.

  #2) In wich browser is this?

  #3) Currently not possible. It is hardcoded in the source. Will try to
  put this in the css
  in order to be customisable.

  #4) Could youi plese the grid configuration and piece of data that is
  populated
  in the grid.

  Regards
  Tony

  On Apr 14, 2:01 am, briandus bri...@virtual-essentials.com wrote:

   Hi there -  I am usingjqGridwith ASP.NET and while it has really
   taken me quite some time to get this integration playing nicely, now
   that I've finally got things moving, I am so pleased. But, I have four
   things that I am still having some trouble with...

   #1)
   I have a table with some hidden fields...the key field is hidden and
   named (ID). In order to get the field to send along with the rest of
   the edit parameters, I had to show the field, but then it shows up as
   editable on the form. When I set 'editable' to false, it no longer
   exists on the field. More importantly, however, is that there is a
   lower case id being sent along with the oper parameter. The id
   field being passed is the row id in the table, not the key field. How
   can I grab and 

[jQuery] Handling html with javascript in .html()

2009-04-15 Thread Snef

When using $.ajax() i encounter some problems.

With the ajax I'm calling a script that will return some html. When
echoing the returned data, I can see that everything is returned
including the javascript tags.

When 'inserting' the returned data into a div on the screen, the
javascript seems to be executed but i can't see it in the generated
source!

I cut it all down to some simple insertion of html into a div like
this:

$(#freediv).html('h1 id=testtest/h1script
language=javascript type=text/javascriptalert(Bla);/
scriptpBla bla/p');

The html is inserted in #freediv but i can't see the script tags
(although alert(Bla) did get executed).

The real problem is when i try to use some jQuery in the html:

$(#freediv).html('h1 id=testtest/h1script
language=javascript type=text/javascript$(#test).click(function
(){ alert(Bla});/scriptpBla bla/p');

Isn't this possible at all?

I'm using this to create some 'popup' forms (maybe with SimpleModal)
and I want to include some javascript into the response that is
specific for that form (like validation and other actions). I know i
can use liveQuery or even jQuery's live() but then i need to have all
the javascript for every used form already in the main document.

I hope you understand my problem ;)



[jQuery] datepicker

2009-04-15 Thread HISSAM

guys

I have 2 datepickers 1)arrivalDate 2)DepartDate

The mindate of Depart must be the mindate of ArrivalDate

I'm able to get the arrival date but
I'm unable to set that in depart mindate attribute

 //arrivaldate.value=14/04/2009//which is erroneous when set to depart
date


The snippet of code is here below

function getStartDate() {
$(#arrivalDate).datepicker({minDate: 0, maxDate: '+1M +10D'});
}

function getEndDate() {
var s=document.getElementById(arrivalDate).value;
alert(s);
if(s==)
{
alert(Please select start date first);
}
else{

$(#depart).datepicker({minDate: s, maxDate: '+1M +10D'});  //
s=14/04/2009//which is erroneous
}
}


[jQuery] Re: datepicker

2009-04-15 Thread HISSAM

I did it

By using the Date class

function getEndDate() {
   var s=document.getElementById(arrivalDate).value;
 alert(s);
 if(s==)
 {
 alert(Please select start date first);
 }
 else{
   var d=new Date(s);
 $(#depart).datepicker({minDate: d, maxDate: '+1M
+10D'});  //

 }
 }

On Apr 15, 1:18 pm, HISSAM hissam.sher...@gmail.com wrote:
 guys

                 I have 2 datepickers 1)arrivalDate 2)DepartDate

 The mindate of Depart must be the mindate of ArrivalDate

 I'm able to get the arrival date but
 I'm unable to set that in depart mindate attribute

  //arrivaldate.value=14/04/2009//which is erroneous when set to depart
 date

 The snippet of code is here below

 function getStartDate() {
                 $(#arrivalDate).datepicker({minDate: 0, maxDate: '+1M 
 +10D'});

 }

 function getEndDate() {
         var s=document.getElementById(arrivalDate).value;
         alert(s);
         if(s==)
         {
         alert(Please select start date first);
         }
         else{

                 $(#depart).datepicker({minDate: s, maxDate: '+1M +10D'});  
 //
 s=14/04/2009//which is erroneous
                 }
         }


[jQuery] Re: Handling html with javascript in .html()

2009-04-15 Thread Jake

I'd suggest .live() still. Or maybe you could try eval() those
JavaScript code after Ajax fetch and DOM manipulation complete
manually? btw, do you check the page source using `view page source'
or firebug's dom inspector? latter recommended.

On Apr 15, 3:56 pm, Snef sne...@gmail.com wrote:
 When using $.ajax() i encounter some problems.

 With the ajax I'm calling a script that will return some html. When
 echoing the returned data, I can see that everything is returned
 including the javascript tags.

 When 'inserting' the returned data into a div on the screen, the
 javascript seems to be executed but i can't see it in the generated
 source!

 I cut it all down to some simple insertion of html into a div like
 this:

 $(#freediv).html('h1 id=testtest/h1script
 language=javascript type=text/javascriptalert(Bla);/
 scriptpBla bla/p');

 The html is inserted in #freediv but i can't see the script tags
 (although alert(Bla) did get executed).

 The real problem is when i try to use some jQuery in the html:

 $(#freediv).html('h1 id=testtest/h1script
 language=javascript type=text/javascript$(#test).click(function
 (){ alert(Bla});/scriptpBla bla/p');

 Isn't this possible at all?

 I'm using this to create some 'popup' forms (maybe with SimpleModal)
 and I want to include some javascript into the response that is
 specific for that form (like validation and other actions). I know i
 can use liveQuery or even jQuery's live() but then i need to have all
 the javascript for every used form already in the main document.

 I hope you understand my problem ;)


[jQuery] how can I add to different elements inside a jQuery object?

2009-04-15 Thread hybris77

ponder something like this:

var elements = $( '#template_elements' ).html();

$( elements .mol_row ).append( td+ molname +/td);

is that the correct way to add to a particular element inside a
cached
jQuery object?

many thanks

/pär


[jQuery] Re: Handling html with javascript in .html()

2009-04-15 Thread András Csányi

2009/4/15 Snef sne...@gmail.com:

 When using $.ajax() i encounter some problems.

 With the ajax I'm calling a script that will return some html. When
 echoing the returned data, I can see that everything is returned
 including the javascript tags.

 When 'inserting' the returned data into a div on the screen, the
 javascript seems to be executed but i can't see it in the generated
 source!

 I cut it all down to some simple insertion of html into a div like
 this:

 $(#freediv).html('h1 id=testtest/h1script
 language=javascript type=text/javascriptalert(Bla);/
 scriptpBla bla/p');

 The html is inserted in #freediv but i can't see the script tags
 (although alert(Bla) did get executed).

 The real problem is when i try to use some jQuery in the html:

 $(#freediv).html('h1 id=testtest/h1script
 language=javascript type=text/javascript$(#test).click(function
 (){ alert(Bla});/scriptpBla bla/p');

 Isn't this possible at all?

 I'm using this to create some 'popup' forms (maybe with SimpleModal)
 and I want to include some javascript into the response that is
 specific for that form (like validation and other actions). I know i
 can use liveQuery or even jQuery's live() but then i need to have all
 the javascript for every used form already in the main document.

 I hope you understand my problem ;)

I understand because my application works fine and use this way (I
hope this is the right expression at this case :$)
So, in my application the html code with jquery source looks like this
(I refactored your code upper):

$(#freediv).html('h1 id=testtest/h1script
language=javascript type=text/javascript
-- this line! $(document).ready(function() {
$(#test).click(function
(){ alert(Bla});
-- this line! })
/scriptpBla bla/p');

Note that I'm using every case the $(document).ready(function(){--my
code--}) part.
Not so beaty but works! :D
I suggest you try it this way.

András

-- 
- -
--  Csanyi Andras  -- http://sayusi.hu -- Sayusi Ando
--  Bízzál Istenben és tartsd szárazon a puskaport!.-- Cromwell


[jQuery] Re: Handling html with javascript in .html()

2009-04-15 Thread András Csányi

2009/4/15 Snef sne...@gmail.com:

 I already tried it with the $(document).ready(function(){.}). No
 success. :(

And through $.getJSON()?
At night I can send you an string what is go through json into $(#foo).html();

András

-- 
- -
--  Csanyi Andras  -- http://sayusi.hu -- Sayusi Ando
--  Bízzál Istenben és tartsd szárazon a puskaport!.-- Cromwell


[jQuery] Re: Handling html with javascript in .html()

2009-04-15 Thread Snef

The 'problem' using .live() is that i need to have all the scripts
loaded even when they are not used. I just wanted to have only the
scripts related to that form.

The check is either in 'view generated source' in FF and the dom
inspector.

I'm not sure about eval, sounds like evil ;)
A simple alert is executed, but can not be seen in the source (and i
think that;s why jQuery code doesn;t work).

Also tried it to use the $(document).ready, without success.

Jake schreef:
 I'd suggest .live() still. Or maybe you could try eval() those
 JavaScript code after Ajax fetch and DOM manipulation complete
 manually? btw, do you check the page source using `view page source'
 or firebug's dom inspector? latter recommended.

 On Apr 15, 3:56 pm, Snef sne...@gmail.com wrote:
  When using $.ajax() i encounter some problems.
 
  With the ajax I'm calling a script that will return some html. When
  echoing the returned data, I can see that everything is returned
  including the javascript tags.
 
  When 'inserting' the returned data into a div on the screen, the
  javascript seems to be executed but i can't see it in the generated
  source!
 
  I cut it all down to some simple insertion of html into a div like
  this:
 
  $(#freediv).html('h1 id=testtest/h1script
  language=javascript type=text/javascriptalert(Bla);/
  scriptpBla bla/p');
 
  The html is inserted in #freediv but i can't see the script tags
  (although alert(Bla) did get executed).
 
  The real problem is when i try to use some jQuery in the html:
 
  $(#freediv).html('h1 id=testtest/h1script
  language=javascript type=text/javascript$(#test).click(function
  (){ alert(Bla});/scriptpBla bla/p');
 
  Isn't this possible at all?
 
  I'm using this to create some 'popup' forms (maybe with SimpleModal)
  and I want to include some javascript into the response that is
  specific for that form (like validation and other actions). I know i
  can use liveQuery or even jQuery's live() but then i need to have all
  the javascript for every used form already in the main document.
 
  I hope you understand my problem ;)


[jQuery] grabbing html and putting it back

2009-04-15 Thread hybris77

anyone. Please look at the following example, useless code since it's
just
grabbing, html and putting it back again but I need to do this and
more inbetween

my problem is that it's just not working, my browser kindof crashing,
not
completely but nearly


var mol_elements = $( '#molecules_holder' ).html();

$( #molecules_holder ).empty();

$( #molecules_holder ).append( mol_elements );


/pär


[jQuery] Re: Handling html with javascript in .html()

2009-04-15 Thread Snef



Donny Kurnia schreef:
 Snef wrote:
  When using $.ajax() i encounter some problems.
 
  With the ajax I'm calling a script that will return some html. When
  echoing the returned data, I can see that everything is returned
  including the javascript tags.
 
  When 'inserting' the returned data into a div on the screen, the
  javascript seems to be executed but i can't see it in the generated
  source!
 
  I cut it all down to some simple insertion of html into a div like
  this:
 
  $(#freediv).html('h1 id=testtest/h1script
  language=javascript type=text/javascriptalert(Bla);/
  scriptpBla bla/p');
 
  The html is inserted in #freediv but i can't see the script tags
  (although alert(Bla) did get executed).

 What are you use for debugging? In Firebug, inserted javascript tag is
 not appear in the html tab, but it's executed. See the XMLHttpRequest in
 Console tab to verify the returned response is what you intended (html
 and the javascript code)

  The real problem is when i try to use some jQuery in the html:
 
  $(#freediv).html('h1 id=testtest/h1script
  language=javascript type=text/javascript$(#test).click(function
  (){ alert(Bla});/scriptpBla bla/p');
 
  Isn't this possible at all?

 It's possible. Just don't forget to wait the DOM loaded:

 $(#freediv).html('h1 id=testtest/h1'+
 'script type=text/javascript'+
 'jQuery(function($){'+
 '  $(#test).click(function(){'+
 '   alert(Bla);'+
 '  });'+
 '});'+
 '/script');

 Watch out for parentheses balance. Write it in indented to easily spot
 the missing parentheses. You code above missing  ')' after alert;

  I'm using this to create some 'popup' forms (maybe with SimpleModal)
  and I want to include some javascript into the response that is
  specific for that form (like validation and other actions). I know i
  can use liveQuery or even jQuery's live() but then i need to have all
  the javascript for every used form already in the main document.
 
  I hope you understand my problem ;)
 
 

 I always use technique like this. My XMLHttpRequest to server will
 return html code and javascript code. It's working well.

 --
 Donny Kurnia
 http://hantulab.blogspot.com
 http://www.plurk.com/user/donnykurnia

Donny,

I have correct { } in my code locally ;) was just a typo.

The problem is that when i use ajax I DO see the correct html in the
response (even when outputting it to firebug with console.debug), but
when inserting it with .html(data) (where data is the actual html/
javascript), the javascript tags are gone!

That's why I just tried it with a clean .html(.) and there is my
problem!


[jQuery] Re: Handling html with javascript in .html()

2009-04-15 Thread Snef

Well a tip to all. When having problems, first give your pc a nice
reboot ;)

Suddenly it is working :S Don;t know why, but it is.

Thanx for all support!

Snef schreef:
 Donny Kurnia schreef:
  Snef wrote:
   When using $.ajax() i encounter some problems.
  
   With the ajax I'm calling a script that will return some html. When
   echoing the returned data, I can see that everything is returned
   including the javascript tags.
  
   When 'inserting' the returned data into a div on the screen, the
   javascript seems to be executed but i can't see it in the generated
   source!
  
   I cut it all down to some simple insertion of html into a div like
   this:
  
   $(#freediv).html('h1 id=testtest/h1script
   language=javascript type=text/javascriptalert(Bla);/
   scriptpBla bla/p');
  
   The html is inserted in #freediv but i can't see the script tags
   (although alert(Bla) did get executed).
 
  What are you use for debugging? In Firebug, inserted javascript tag is
  not appear in the html tab, but it's executed. See the XMLHttpRequest in
  Console tab to verify the returned response is what you intended (html
  and the javascript code)
 
   The real problem is when i try to use some jQuery in the html:
  
   $(#freediv).html('h1 id=testtest/h1script
   language=javascript type=text/javascript$(#test).click(function
   (){ alert(Bla});/scriptpBla bla/p');
  
   Isn't this possible at all?
 
  It's possible. Just don't forget to wait the DOM loaded:
 
  $(#freediv).html('h1 id=testtest/h1'+
  'script type=text/javascript'+
  'jQuery(function($){'+
  '  $(#test).click(function(){'+
  '   alert(Bla);'+
  '  });'+
  '});'+
  '/script');
 
  Watch out for parentheses balance. Write it in indented to easily spot
  the missing parentheses. You code above missing  ')' after alert;
 
   I'm using this to create some 'popup' forms (maybe with SimpleModal)
   and I want to include some javascript into the response that is
   specific for that form (like validation and other actions). I know i
   can use liveQuery or even jQuery's live() but then i need to have all
   the javascript for every used form already in the main document.
  
   I hope you understand my problem ;)
  
  
 
  I always use technique like this. My XMLHttpRequest to server will
  return html code and javascript code. It's working well.
 
  --
  Donny Kurnia
  http://hantulab.blogspot.com
  http://www.plurk.com/user/donnykurnia

 Donny,

 I have correct { } in my code locally ;) was just a typo.

 The problem is that when i use ajax I DO see the correct html in the
 response (even when outputting it to firebug with console.debug), but
 when inserting it with .html(data) (where data is the actual html/
 javascript), the javascript tags are gone!

 That's why I just tried it with a clean .html(.) and there is my
 problem!


[jQuery] Re: Handling html with javascript in .html()

2009-04-15 Thread András Csányi

2009/4/15 Snef sne...@gmail.com:

 Well a tip to all. When having problems, first give your pc a nice
 reboot ;)

Are you serious? :)
Which OS do you have?

 Suddenly it is working :S Don;t know why, but it is.

O_o

-- 
- -
--  Csanyi Andras  -- http://sayusi.hu -- Sayusi Ando
--  Bízzál Istenben és tartsd szárazon a puskaport!.-- Cromwell


[jQuery] Re: grabbing html and putting it back

2009-04-15 Thread hybris77

thanks Chandan

Im using FF but I have a feeling im doing something else that is not
correct,
it's all connected to the other threads Im posting on the forum today

I need some personal assistence, here, too much code to post on the
forum,
not too likely anyone's got time to look at it

many thanks

/pär



On 15 Apr, 12:03, Chandan Luthra chandan.lut...@gmail.com wrote:
 Which browser are you using?

 This code is working *Completely* on FF

 With Regards,
 Chandan Luthra
 Intelligrape Software Pvt. Ltd.
 Henny 
 Youngmanhttp://www.brainyquote.com/quotes/authors/h/henny_youngman.html
 - I told the doctor I broke my leg in two places. He told me to quit
 going
 to those places.

 On Wed, Apr 15, 2009 at 15:06, hybris77 dist...@yahoo.com wrote:

  anyone. Please look at the following example, useless code since it's
  just
  grabbing, html and putting it back again but I need to do this and
  more inbetween

  my problem is that it's just not working, my browser kindof crashing,
  not
  completely but nearly

         var mol_elements = $( '#molecules_holder' ).html();

         $( #molecules_holder ).empty();

         $( #molecules_holder ).append( mol_elements );

  /pär


[jQuery] Re: how can I add to different elements inside a jQuery object?

2009-04-15 Thread hybris77

thanks for the advice

sometimes thought it seems all things possible is not to
be found SO easily on the jQuery documentation pages

nice one



On 15 Apr, 11:32, Donny Kurnia donnykur...@gmail.com wrote:
 hybris77 wrote:
  ponder something like this:

  var elements = $( '#template_elements' ).html();

  $( elements .mol_row ).append( td+ molname +/td);

  is that the correct way to add to a particular element inside a
  cached
  jQuery object?

  many thanks

  /pär

 You must swap the selector:

 $(.mol_row, elements).append(td+ molname +/td);

 Read again the documentation about selector, there are second parameter
 to define the search scope.

 --
 Donny Kurniahttp://hantulab.blogspot.comhttp://www.plurk.com/user/donnykurnia


[jQuery] Re: Handling html with javascript in .html()

2009-04-15 Thread Snef

I do not think it is due to $.ajax function. Even when using plain $
(#freediv).html(.) it won't work.

(and I don't need json yet).


András Csányi schreef:
 2009/4/15 Snef sne...@gmail.com:
 
  I already tried it with the $(document).ready(function(){.}). No
  success. :(

 And through $.getJSON()?
 At night I can send you an string what is go through json into 
 $(#foo).html();

 András

 --
 - -
 --  Csanyi Andras  -- http://sayusi.hu -- Sayusi Ando
 --  Bízzál Istenben és tartsd szárazon a puskaport!.-- Cromwell


[jQuery] Re: [ANNOUNCE] Machinetag plugin- initial release

2009-04-15 Thread cldwalker

I've built a similar sql-version as a rails plugin:
http://github.com/cldwalker/has_machine_tags/tree/master
Since you're interested in the sql, you should look here for the
schema: http://github.com/cldwalker/has_machine_tags/blob/master/test/schema.rb
.
The jquery plugin, though simpler and slower on a large scale, has its
advantages: no database required.

Gabriel

On Apr 15, 2:30 am, Jean jnascime...@gmail.com wrote:
 i want to know how to structure that in sql



 On Tue, Apr 14, 2009 at 10:16 PM, cldwalker gabriel.hor...@gmail.com wrote:

  Hi,
   I'm announcing the initial release of Machinetag,  a jQuery plugin
  for your machine tag needs. Machine tags (aka triple tags) are just
  tags with two levels of context. For an intro to machine tags, read
 http://tagaholic.me/2009/03/26/what-are-machine-tags.html.

  Plugin links:

  Blog 
  post:http://tagaholic.me/2009/04/14/i-am-machine-tag-and-so-can-you.html
  Code:http://github.com/cldwalker/machinetag.js/tree/master
  Demo:http://tagaholic.me/blog.html#post:*

  My plugin provides search and display functions for machine tagged
  content. My hope with this plugin is to bring machine tagging to
  everyone. It has mainly been a flickr-only thing for some time.

  This being my first jQuery plugin, all feedback is welcome, especially
  concerning jQuery conventions.

  Enjoy!
  Gabriel

 --
 []´s Jean a.k.a Suissa

 Tecnólogo em Análise de Sistemas - UTF-PR


[jQuery] Re: grabbing html and putting it back

2009-04-15 Thread Chandan Luthra
Which browser are you using?

This code is working *Completely* on FF

With Regards,
Chandan Luthra
Intelligrape Software Pvt. Ltd.
Henny Youngmanhttp://www.brainyquote.com/quotes/authors/h/henny_youngman.html
- I told the doctor I broke my leg in two places. He told me to quit
going
to those places.

On Wed, Apr 15, 2009 at 15:06, hybris77 dist...@yahoo.com wrote:


 anyone. Please look at the following example, useless code since it's
 just
 grabbing, html and putting it back again but I need to do this and
 more inbetween

 my problem is that it's just not working, my browser kindof crashing,
 not
 completely but nearly


var mol_elements = $( '#molecules_holder' ).html();

$( #molecules_holder ).empty();

$( #molecules_holder ).append( mol_elements );


 /pär


[jQuery] Re: Handling html with javascript in .html()

2009-04-15 Thread Snef

András Csányi schreef:
 2009/4/15 Snef sne...@gmail.com:
 
  When using $.ajax() i encounter some problems.
 
  With the ajax I'm calling a script that will return some html. When
  echoing the returned data, I can see that everything is returned
  including the javascript tags.
 
  When 'inserting' the returned data into a div on the screen, the
  javascript seems to be executed but i can't see it in the generated
  source!
 
  I cut it all down to some simple insertion of html into a div like
  this:
 
  $(#freediv).html('h1 id=testtest/h1script
  language=javascript type=text/javascriptalert(Bla);/
  scriptpBla bla/p');
 
  The html is inserted in #freediv but i can't see the script tags
  (although alert(Bla) did get executed).
 
  The real problem is when i try to use some jQuery in the html:
 
  $(#freediv).html('h1 id=testtest/h1script
  language=javascript type=text/javascript$(#test).click(function
  (){ alert(Bla});/scriptpBla bla/p');
 
  Isn't this possible at all?
 
  I'm using this to create some 'popup' forms (maybe with SimpleModal)
  and I want to include some javascript into the response that is
  specific for that form (like validation and other actions). I know i
  can use liveQuery or even jQuery's live() but then i need to have all
  the javascript for every used form already in the main document.
 
  I hope you understand my problem ;)

 I understand because my application works fine and use this way (I
 hope this is the right expression at this case :$)
 So, in my application the html code with jquery source looks like this
 (I refactored your code upper):

 $(#freediv).html('h1 id=testtest/h1script
 language=javascript type=text/javascript
 -- this line! $(document).ready(function() {
 $(#test).click(function
 (){ alert(Bla});
 -- this line! })
 /scriptpBla bla/p');

 Note that I'm using every case the $(document).ready(function(){--my
 code--}) part.
 Not so beaty but works! :D
 I suggest you try it this way.

 András

 --
 - -
 --  Csanyi Andras  -- http://sayusi.hu -- Sayusi Ando
 --  Bízzál Istenben és tartsd szárazon a puskaport!.-- Cromwell

I already tried it with the $(document).ready(function(){.}). No
success. :(



[jQuery] Re: Handling html with javascript in .html()

2009-04-15 Thread Donny Kurnia

Snef wrote:
 When using $.ajax() i encounter some problems.
 
 With the ajax I'm calling a script that will return some html. When
 echoing the returned data, I can see that everything is returned
 including the javascript tags.
 
 When 'inserting' the returned data into a div on the screen, the
 javascript seems to be executed but i can't see it in the generated
 source!
 
 I cut it all down to some simple insertion of html into a div like
 this:
 
 $(#freediv).html('h1 id=testtest/h1script
 language=javascript type=text/javascriptalert(Bla);/
 scriptpBla bla/p');
 
 The html is inserted in #freediv but i can't see the script tags
 (although alert(Bla) did get executed).

What are you use for debugging? In Firebug, inserted javascript tag is
not appear in the html tab, but it's executed. See the XMLHttpRequest in
Console tab to verify the returned response is what you intended (html
and the javascript code)

 The real problem is when i try to use some jQuery in the html:
 
 $(#freediv).html('h1 id=testtest/h1script
 language=javascript type=text/javascript$(#test).click(function
 (){ alert(Bla});/scriptpBla bla/p');
 
 Isn't this possible at all?

It's possible. Just don't forget to wait the DOM loaded:

$(#freediv).html('h1 id=testtest/h1'+
'script type=text/javascript'+
'jQuery(function($){'+
'  $(#test).click(function(){'+
'   alert(Bla);'+
'  });'+
'});'+
'/script');

Watch out for parentheses balance. Write it in indented to easily spot
the missing parentheses. You code above missing  ')' after alert;

 I'm using this to create some 'popup' forms (maybe with SimpleModal)
 and I want to include some javascript into the response that is
 specific for that form (like validation and other actions). I know i
 can use liveQuery or even jQuery's live() but then i need to have all
 the javascript for every used form already in the main document.
 
 I hope you understand my problem ;)
 
 

I always use technique like this. My XMLHttpRequest to server will
return html code and javascript code. It's working well.

--
Donny Kurnia
http://hantulab.blogspot.com
http://www.plurk.com/user/donnykurnia



[jQuery] Re: how can I add to different elements inside a jQuery object?

2009-04-15 Thread Donny Kurnia

hybris77 wrote:
 ponder something like this:
 
 var elements = $( '#template_elements' ).html();
 
 $( elements .mol_row ).append( td+ molname +/td);
 
 is that the correct way to add to a particular element inside a
 cached
 jQuery object?
 
 many thanks
 
 /pär
 

You must swap the selector:

$(.mol_row, elements).append(td+ molname +/td);

Read again the documentation about selector, there are second parameter
to define the search scope.

--
Donny Kurnia
http://hantulab.blogspot.com
http://www.plurk.com/user/donnykurnia



[jQuery] Re: Selecting radio buttons within different RadioGroups via a click

2009-04-15 Thread madrid440-goo...@yahoo.co.uk

I should have added some clearer HTML.  I've added tables to break it
up a bit:

input type=submit name=button1 id=button1 value=Selection1 /
input type=submit name=button2 id=button2 value=Selection2 /


table
tr
td
labelinput type=radio name=RadioGroup1 value=0
id=RadioGroup1_0 /0/label
labelinput type=radio name=RadioGroup1 value=1
id=RadioGroup1_1 /1/label
labelinput type=radio name=RadioGroup1 value=2
id=RadioGroup1_2 /2/label/td
/tr
/table

table
tr
td
labelinput type=radio name=RadioGroup2 value=0
id=RadioGroup2_0 /0/label
labelinput type=radio name=RadioGroup2 value=1
id=RadioGroup2_1 /1/label
labelinput type=radio name=RadioGroup2 value=2
id=RadioGroup2_2 /2/label
/td
/tr
/table




On Apr 15, 2:08 am, madrid440-goo...@yahoo.co.uk madrid440-
goo...@yahoo.co.uk wrote:
 I'm getting lost in selectors...

 I am trying to achieve the following:
 A button click needs to select certain radio buttons within different
 radio groups. e.g RadioGroup1_0 and RadioGroup2_1

 A click on another button resets the radio buttons to blank, and then
 selects different radio buttons within those radio groups. e.g.
 RadioGroup1_1 and RadioGroup2_2

 input type=submit name=button1 id=button1 value=Selection1 /
 input type=submit name=button2 id=button2 value=Selection2 /

 labelinput type=radio name=RadioGroup1 value=0
 id=RadioGroup1_0 /0/label
 labelinput type=radio name=RadioGroup1 value=1
 id=RadioGroup1_1 /1/label
 labelinput type=radio name=RadioGroup1 value=2
 id=RadioGroup1_2 /2/label

 labelinput type=radio name=RadioGroup2 value=0
 id=RadioGroup2_0 /0/label
 labelinput type=radio name=RadioGroup2 value=1
 id=RadioGroup2_1 /1/label
 labelinput type=radio name=RadioGroup2 value=2
 id=RadioGroup2_2 /2/label


[jQuery] Re: Calling a function from a non-jQuery .JS file

2009-04-15 Thread Klaus Hartl

On 14 Apr., 19:15, dhtml dhtmlkitc...@gmail.com wrote:
  problem is that that Dreamweaver method is using document.write which
  can cause a problem depending on where the function is being called
  and which is usually avoided in jQuery land.

 Calling document.write in a jQuery ready callback won't work
 consistently.

Didn't I say just that?


 If you want to format a local date, what is wrong with just having:-

 var todayEl = document.getElementById(today);
 todayEl.innerHTML = formatDate(new Date);

I believe the question was not about how to properly localize a date.


--Klaus


[jQuery] Re: Help Me Optimize My First JQuery Script (Extinguish The Early Flames of Bad Practices)

2009-04-15 Thread MorningZ

I don't know if this falls under bad practice or not, but time and
time again here on the group, people post code like yours where they
use an a tag to do something that has nothing to do with an a tag

If you don't want to go somewhere, why not just use a span or a
div and hang the click event on that?  then propagation is a non-
issue

On Apr 14, 10:49 pm, Dante danh...@gmail.com wrote:
 Hello,

 I'm just starting to delve into JQuery, and I'd like to extinguish as
 many bad practices as possible.

 I wrote my first script from scratch a few days ago, and here is an
 outline of what I wanted the script to do:

 Generate the category links/controls onload for graceful degradation
 Display all list items or subsets of a list (grouped by classes on the li) 
 when a user clicks on a category link
 Set selected class on current category link.

 For example, my page has three links View all, Foo1, and Foo2,
 and View all is the selected value by default, showing all the items
 in the unordered list below it.

 Clicking Foo1 will display only those list items with a class of
 Foo1, hiding every other list item. Clicking Foo2 will display
 only those list items with a class of Foo2, ect...

 I was able to hack together a Jquery script that does exactly what I
 want, but I feel like it is terribly inefficient. I'd appreciate a
 tear-down of the code with suggestions for improvement. There may be
 discrepancies/typos in the classes or IDs during their conversion to
 fooism.

 Thanks!

 script type=text/javascript
 $(document).ready(function(){
      $(#selector ul)
        .prepend(lia href=''All/a/lili class='Foo1-button'a
 href=''Foo1/a/lili class='Foo2-button'a href=''Foo2/a/
 li);
          $(#selector a).click(function(event){
        $(a.selected).removeClass(selected);
            $(this).addClass(selected);
         return false;
         });
          $(li.Foo1-button a).click(function(event){
        $(#list li.foo1).css('display', 'block');
            $(#list li:not(li.foo1)).hide();
         return false;
         });
          $(li.Foo2-butt a).click(function(event){
            $(#list li.foo2).css('display', 'block');
            $(#list li:not(li.foo2)).hide();
         return false;
         });
    });
 /script

 ==

 div id=selector
 ul
 /ul
 /div
 ul id=list
 li class=foo1Item 1/li
 li class=foo2Item 2/li
 /ul


[jQuery] jQuery plugin scope

2009-04-15 Thread hugo

if(jQuery) (function($) {

// plugin definition
$.fn.hilight = function (options) {
debug(this);

// build main options before element iteration
var options = $.extend({}, $.fn.hilight.defaults, options);

// iterate and reformat each matched element
return this.each(function () {
var $this = $(this);

// build element specific options
var opts = $.meta ? $.extend({}, options, $this.data()) 
:
options;

// update element styles
$this.css({
backgroundColor: opts.background,
color: opts.foreground
});
var markup = $this.html();

// call our format function
markup = $.fn.hilight.format(markup);
$this.html(markup);
});
};

// private function for debugging
function debug ($obj) {
if (window.console  window.console.log) window.console.log
('hilight selection count: ' + $obj.size());
};

// define and expose our format function
$.fn.hilight.format = function (txt) {
return 'strong' + txt + '/strong';
};

// plugin defaults
$.fn.hilight.defaults = {
foreground: 'red',
background: 'yellow'
};

})(jQuery);

this is the code from the the article 
http://www.learningjquery.com/2007/10/a-plugin-development-pattern

now my questions are how do I invoke the format and debug functions
from within the several parts of the code and specially how can I
invoke the options var inside the format and debug functions?

been trying all I can think of and still I cant seem to figure it out.
Can anyone point me in the right direction?

Thanks


[jQuery] Basic Selector expression only work on Chrome, no other browsers

2009-04-15 Thread Tao

Hi,

I have the follow simple html code:

div style=FILTER: progid:DXImageTransform.Microsoft.Gradient
(GradientType=1, StartColorStr=#, EndColorStr=#7E003366);
WIDTH: 794px; HEIGHT: 685px
Hello
/div

And I try to use follow code to get the div element:

alert($('div[style*=FILTER]').length);

In Google Chorme, it return 1, but on other browsers IE8, FF3, Opera9,
all return 0.

Any suggestion?

Cheers,


[jQuery] [autocomplete] ExtraParam

2009-04-15 Thread Dreamer

Would like to suggest to change the code from

extraParams[key] = typeof param == function ? param() : param;

to

extraParams[key] = typeof param == function ? param.apply(input) :
param;

Then the extraParam function is able to use 'this' to locate the DOM
node, similar as result event handler.


[jQuery] jQuery.autocomplete skipping GET calls...

2009-04-15 Thread jquery at technicalbloke.com

Hi,

This is the version of jQuery.autocomplete I'm using...

 * Revision: $Id: jquery.autocomplete.js 5747 2008-06-25 18:30:55Z
joern.zaefferer $


I'm having a problem with autocomplete skipping GET calls. I have a
thread already open over at stack overflow (
http://stackoverflow.com/questions/750670/bypass-all-cacheing-on-jquery-autocomplete1-02
) so I won't go into too much more detail...

Basically I'm monitoring the server side and as I type say 'arse' it
is receiving:

http://localhost/dynamic_seach?q=a
http://localhost/dynamic_seach?q=ars
http://localhost/dynamic_seach?q=arse

Notice how it is missing: http://localhost/dynamic_seach?q=ar

I have manually fed this to the server an it happily spits out the
correct result for 'ar' it just never gets called by autocomplete,
which implies to me something's getting cached somewhere and I think
I've eliminated everything but autocomplete. As I type it finds and
displays suggestions for 'ar' but without issuing a GET request to the
server so these suggestions are inaccurate :-( Interestingly it does
issue GETs for most other two letter combinations.

Here's my javascript.

$(document).ready(function(){ $(#input_box).autocomplete('/
localhost/dynamic_search',
 
cacheLength=1
  ); })

None of the other options like: matchContains=true, matchSubset=false
seem to make the blindest bit of difference. I wondered if flushCache
() might help but I'm not sure how to make sure that gets called
before autocomplete with every keystroke :-/ Is there a way to do
this, or a way to force autocomplete to hit my server up for some
fresh data every time?

Regards,

Roger.

I'll try and keep an eye on this group for answers but if you use
stackoverflow.com that would be even better, thanks! ;-)



Would


[jQuery] please help

2009-04-15 Thread Gabi

i've interrated jquery treeview in one of my webpages and it works
well in firefox. however, it doesn't work at all in internet explorer
if i set $(#browser).treeview collapsed: true, because branches
simply don't open.
if i use the defaults (collapsed: false), it is ok, but i would like
it to be closed when the page loads. animation is ok in both browsers.
can anybody suggest a solution? thanks.  :)


[jQuery] Re: Error with BlockUI: 'parentNode' is null or not an object

2009-04-15 Thread Mike Alsup

 http://www.malsup.com/jquery/block/#page

Thanks, Jonathan!  :-)


[jQuery] How to use Autocomplete in POST ajax method ?

2009-04-15 Thread zeojex

Hi,

This is my question : How can i change the default GET method of
autocomplete function in POST method ?

Thx a lot


[jQuery] Re: IE7 returning 0 for attr(width) on an img with width set

2009-04-15 Thread rudders

Just out of interest how did you work around that? I have been
battling this problem for a couple of days now!

On Mar 26, 2:30 am, nabrown78 nabrow...@gmail.com wrote:
 Aha! The problem was that the li elements which contained the images
 were set to display:none in the CSS. I guess I can work around that.

 On Mar 25, 10:47 am, nabrown78 nabrow...@gmail.com wrote:

  Hi All, I have the following code:

  $('#slides img').each(function(i){//calculate margins and wrap
                  var this_img = $(this);
                  var imgMargin = Math.round((550 - (this_img.attr(width) + 
  35))/2)
  + 5;
                  this_img.wrap('div class=wrap0 style=margin-left:' + 
  imgMargin +
  'pxdiv class=wrap1div class=wrap2div class=wrap3/div/
  div/div/div');
                  $('#content').append('p'+imgMargin+'/p');
          });

  On this page:http://www.colleenkiely.com/testLayout2003-2006.htm

  In Firefox and Safari the margin is correctly set. In IE7, the margin
  is calculated as if this_img.attr(width) were 0. The html markup has
  the height and width of each img set explicitly:

  img src=http://www.colleenkiely.com/site_images/2.jpg; height=510
  width=507 alt=Dog with Egg Hat (#2) /

  I am using the latest JQuery - 1.3.2.

  Any insight into this mystery sincerely appreciated.


[jQuery] Code Slider problem

2009-04-15 Thread sato.ph...@gmail.com

I am trying to implement the coda slider javascript as seen on the
jqueryfordesigners page:

http://jqueryfordesigners.com/coda-slider-effect/

I have it working on FF/Safari for Mac, as well as IE for Windows.
However, strangely, it will not work properly on FF for Windows.
Though it loads and scrolls, all of the elements are visible in a line
across the page, instead of hidden except for the one panel between
the arrows.  Any ideas?

www.danielsato.com/test


[jQuery] Re: Highlight table row

2009-04-15 Thread spstieng

Nope, that didn't help :(


Steven


On 15 Apr, 00:18, James james.gp@gmail.com wrote:
 This does ahighlighton mouseover and removehighlighton mouseout.
 Is this what you want?

 // untested
 $(#storeListTable tbody tr).hover(
      function() {  // mouseover
           $(this).addClass('highlight');
      },
      function() {  // mouseout
           $(this).removeClass('highlight');
      }
 );

 On Apr 14, 11:51 am, spstieng spsti...@hotmail.com wrote:





[jQuery] Re: IE8 BlockUI incompatible

2009-04-15 Thread Anand

Hi All,

I have it! The solution to the problem where the blockUI plugin
doesn't working in IE8 is as follows:

on line 151 simply change:

var ie6 = $.browser.msie  /MSIE 6.0/.test(navigator.userAgent);

to

var ie6 = $.browser.msie  /MSIE 6.0/.test(navigator.userAgent)  !(/
MSIE 8.0/.test(navigator.userAgent));

And then everything works fine and dandy! My test environment was IE8
on Vista. Al

Hope this helps...certainly helped me in my project.

Cheers, Anand
www.digitalpath.co.nz

On Mar 23, 10:53 pm, Mike Alsup mal...@gmail.com wrote:
  Mike,

  your page fails for me with not implemented Nicht implementiert 
  jquery.blockUI.js?v2.16, line 227 character 17

  on Win XP Pro w/ SP3 andIE8

  Regards, Frank

 Thanks, Frank.  What browser mode and compatibility mode did it fail
 in?


[jQuery] $.get callback function fails - but only in IE

2009-04-15 Thread Bjaergager

I have a function that uses $.get to retrieve xml and in the callback
function it will update a form.
The function works fine in FF3 - but not in IE7, in IE7 I can see that
the $.get DO request the xml with correct parameters - but the
callback function never is called.

Here's my function - please help me get this right :-)

function editPosting(val)
{
var f = new Array
(korseldato,fragtbrevdato,vognnr,chauffor,fragtbrevnr,postnr,vaegt,bemaerkninger);
var c = new Array
(indbaering,ventetid,tidslevering,genkorsel,lufthavnsgebyr,forgaevesafh,udenkvittering,forgaeves,toldoplag);
$.get(ajax/ajax.php, { action: getfragtbrev, id: val,
rnd:Math.random } ,function(xml){
  setDivVal(#fbid, $(id,xml).text() );
  for(i=0;if.length;i++)
  {
setDivVal( #+f[i], $(f[i],xml).text() );
}
  for(i=0;ic.length;i++)
  {
if( $(c[i],xml).text() == '1')
{
$(#+c[i]).attr('checked', true);
} else {
$(#+c[i]).attr('checked', false);
}
}
});
}

function setDivVal(div,val)
{
$(div).val(val);
}


[jQuery] [Q] How to : Creating IFrame

2009-04-15 Thread Osman Ü .

Hi,
Im using two different sized iframe in one page
How can i create iframes with jquery

Sample iframe code

iframe src=someUrl name=someName width = 570px height = 500px
align=left scrolling=No frameborder=no id=SomeID/iframe


[jQuery] Re: Code Slider problem

2009-04-15 Thread Jonathan Vanherpe (T T NV)


sato.ph...@gmail.com wrote:

I am trying to implement the coda slider javascript as seen on the
jqueryfordesigners page:

http://jqueryfordesigners.com/coda-slider-effect/

I have it working on FF/Safari for Mac, as well as IE for Windows.
However, strangely, it will not work properly on FF for Windows.
Though it loads and scrolls, all of the elements are visible in a line
across the page, instead of hidden except for the one panel between
the arrows.  Any ideas?

www.danielsato.com/test



The first flash movie works properly because it has wmode set to 
transparant (both in the object and the embed tag. Just change this 
for the other flash movies.


Jonathan

--
Jonathan Vanherpe - Tallieu  Tallieu NV - jonat...@tnt.be


[jQuery] Re: assign event handler to multiple events

2009-04-15 Thread Tom Worster

On 4/14/09 6:21 PM, James james.gp@gmail.com wrote:

 
 $('.things').bind('focus change click', function() {
  // your code here
 });

ah ha! thanks. that is tidy.
tom




[jQuery] Re: Handling html with javascript in .html()

2009-04-15 Thread Charlie Tomlinson





simple solution using your example that works 

Create a js file "test.js" containing :

$('#freediv').html('h1 id="test"test/h1');
   $("#test").click(function(){
alert("Bla");
   
});

I used an a tag in html to click to call the test.js file as
follows:

script type="text/_javascript_"
$(document).ready(function() {
$('a').click(function(){
   $.getScript("test.js");
  });

});
/script
/head
body
a href=""Click Here/a
div id="freediv"/div
/body
/html









Snef wrote:

  The 'problem' using .live() is that i need to have all the scripts
loaded even when they are not used. I just wanted to have only the
scripts related to that form.

The check is either in 'view generated source' in FF and the dom
inspector.

I'm not sure about eval, sounds like evil ;)
A simple alert is executed, but can not be seen in the source (and i
think that;s why jQuery code doesn;t work).

Also tried it to use the $(document).ready, without success.

Jake schreef:
  
  
I'd suggest .live() still. Or maybe you could try eval() those
_javascript_ code after Ajax fetch and DOM manipulation complete
manually? btw, do you check the page source using `view page source'
or firebug's dom inspector? latter recommended.

On Apr 15, 3:56pm, Snef sne...@gmail.com wrote:


  When using $.ajax() i encounter some problems.

With the ajax I'm calling a script that will return some html. When
echoing the returned data, I can see that everything is returned
including the _javascript_ tags.

When 'inserting' the returned data into a div on the screen, the
_javascript_ seems to be executed but i can't see it in the generated
source!

I cut it all down to some simple insertion of html into a div like
this:

$("#freediv").html('h1 id="test"test/h1script
language="_javascript_" type="text/_javascript_"alert("Bla");/
scriptpBla bla/p');

The html is inserted in #freediv but i can't see the script tags
(although alert("Bla") did get executed).

The real problem is when i try to use some jQuery in the html:

$("#freediv").html('h1 id="test"test/h1script
language="_javascript_" type="text/_javascript_"$("#test").click(function
(){ alert("Bla"});/scriptpBla bla/p');

Isn't this possible at all?

I'm using this to create some 'popup' forms (maybe with SimpleModal)
and I want to include some _javascript_ into the response that is
specific for that form (like validation and other actions). I know i
can use liveQuery or even jQuery's live() but then i need to have all
the _javascript_ for every used form already in the main document.

I hope you understand my problem ;)
  

  
  
  






[jQuery] Re: Form validator - cross field validation

2009-04-15 Thread AndyCramb

Hi Jörn,

Yes I will get a test page up and running
Interestingly enough it works fine in IE6 but is not working in
FF3.0.7

Thanks
Andy

On Apr 14, 9:42 pm, Jörn Zaefferer joern.zaeffe...@googlemail.com
wrote:
 Okay, then its something else. Could you provide a testpage?

 Jörn

 On Tue, Apr 14, 2009 at 10:08 PM,AndyCrambandycr...@googlemail.com wrote:

  Thanks for getting back to me
  I have the id specified

  input type=text value= name=source
  id=source/

  It just had wrapped on to the new line
  Sorry I could not find away of formatting the code I pasted in so it
  looks a bit of a mess

  On Apr 14, 7:06 pm, Jörn Zaefferer joern.zaeffe...@googlemail.com
  wrote:
  There is no field with the id source? Add id=source to that input...

  Jörn

  On Tue, Apr 14, 2009 at 6:33 PM,AndyCrambandycr...@googlemail.com wrote:

   Hi,

   I am trying the forms validation plugin and cannot figure out where I
   am going wrong with it
   I can get cross validation working aginst a checkbox but I am unable
   to get it working against an input box
   HTML is supplied below
   The rules metadata is below the HTML
   Any help is much appreciated
   Andy

   fieldset
              legendTest JQuery validation/legend
              ol
                  li
                      label for=cboxLast Months Bank Statement: /
   label
                      input type=checkbox value=true name=cbox
   id=cbox/input type=hidden value=false name=cbox/

                  /li
                  li
                      label for=sourceSource: /label
                      input type=text value= name=source
   id=source/
                  /li
                  li
                      label for=dateDate: /label
                      input type=text value= name=date id=date/

                  /li
                  li
                      label for=amntPaidInAmount Paid In: /label
                      input type=text value= name=amntPaidIn
   id=amntPaidIn/
                  /li
              /ol
              input type=submit value=validate/

          /fieldset

      rules: {
          source: {
            required: #cbox:checked,//works
            minlength: 2
        }
        , date: {
            required: #source:filled,//not working
            minlength: 2
        }
        , amntPaidIn: {
            required: true,
            email: true
        }
      }, debug: true


[jQuery] Re: Animation Issue

2009-04-15 Thread Leonardo K
Your page didn't work in Opera, IE7 and IE6. :(

Instead of using display:inline-block on span.projects, change to
float:left; Another thing, when using the animation, i dont know why, but
the jquery use overflow:hidden and your left image (border) disappear in the
animation. So this css should solve the issue:

.projects{
float:left;
overflow:visible !important;
}

Instead of using the important in the css to solve the overflow issue u can
put this on js (not tested): $(this).parent().animate({width: 514px,
overflow: visible}, 500);

On Tue, Apr 14, 2009 at 19:30, Connor con...@letsbeglobal.com wrote:


 Hi,

 I've had this issue when animating before, but have always found a
 hack around it. But for this project I can't think of any work around.
 What happens is some elements inside the animated element and near the
 animated element disappear during animation. To view it in action go
 to http://www.cyberantix.org/demo/portfolio/projects.html

 Click on any of the projects to expand them. See how parts disappear?
 Does anyone know how to fix this?

 One other note: I haven't debugged this for Internet Explorer yet, so
 if you would, try it in any other browser.

 Thanks,


 Connor

 Let me know if you would prefer me to paste the code here instead of
 looking at the source code.



[jQuery] Jorn's Autocomplete, how to reference textbox in result event

2009-04-15 Thread MorningZ

In this snippit of code, where i pass the jQuery object that is the
textbox into:

function WireUpAutocomplete($txt) {
$txt.autocomplete(
/services/Autocomplete.ashx
).result(function(e, d, f) {
//  How do i know what textbox the user is on here? 
});
}


I could wire many textboxes up through that and would like to know
which textbox i am in

I see that a is an [object Object], but i have no idea what it's
comprised of


[jQuery] Re: Animation Issue

2009-04-15 Thread Connor

Thanks! Your advice worked like a charm.

On Apr 15, 7:58 am, Leonardo K leo...@gmail.com wrote:
 Your page didn't work in Opera, IE7 and IE6. :(

 Instead of using display:inline-block on span.projects, change to
 float:left; Another thing, when using the animation, i dont know why, but
 the jquery use overflow:hidden and your left image (border) disappear in the
 animation. So this css should solve the issue:

 .projects{
     float:left;
     overflow:visible !important;

 }

 Instead of using the important in the css to solve the overflow issue u can
 put this on js (not tested): $(this).parent().animate({width: 514px,
 overflow: visible}, 500);

 On Tue, Apr 14, 2009 at 19:30, Connor con...@letsbeglobal.com wrote:

  Hi,

  I've had this issue when animating before, but have always found a
  hack around it. But for this project I can't think of any work around.
  What happens is some elements inside the animated element and near the
  animated element disappear during animation. To view it in action go
  tohttp://www.cyberantix.org/demo/portfolio/projects.html

  Click on any of the projects to expand them. See how parts disappear?
  Does anyone know how to fix this?

  One other note: I haven't debugged this for Internet Explorer yet, so
  if you would, try it in any other browser.

  Thanks,

  Connor

  Let me know if you would prefer me to paste the code here instead of
  looking at the source code.


[jQuery] Re: Superfish menus in nav-bar style require subnavs to behave correctly?

2009-04-15 Thread TenzoChris

I got feedback privately complaining about my example.

I'd chosen to just use the plugin page (with a minor edit) to
demonstrate the problem without wasting people's time on potential CSS
causes, since the problem also manifests using the demonstration page.
I should have done a better job explaining my rationale.

Since that approach has proven confusing for some folks, I've created
a stripped-down version, visible at 
http://sandbox.skulljackpot.com/superfish-stripped.html

The second menu item begins highlighted. If you inspect it, you can
see that the sfHover class has been added by superfish (which is
great, and what we want). Notice that if you mouse over any of the
other menu items which have submenus, the sfHover class is removed
from the original item, and added to the menu item you've hovered
over. This is also desired / expected behavior.

Now hover over the rightmost menu item. Notice that the sfHover class
is not removed from the originally-selected menu item, and two top-
level menu items appear highlighted simultaneously.

The desired behavior is for sfHover to be removed from all top-level
menu items when mousing over *any* sibling (regardless of whether
there's a child ul element), while preserving how the current item
is treated (namely, that the top-level menu item in that chain gets
sfHover added upon initialization, as well as when no menu items are
being moused over).

Chris

On Apr 14, 7:38 pm, dimmerswitch dimmerswi...@gmail.com wrote:
 Hey there-

 I'm working on integratingSuperfishmenus and have run into an odd  
 problem. It's *looking* like the deselection  hover behavior is  
 predicated on all the top-level li elements having nested ul,  
 which makes me think I've missed something obvious.

 In an attempt to rule out any CSS silliness, I've used the sample page  
 (fromhttp://users.tpg.com.au/j_birch/plugins/superfish/#sample4) for  
 my test case.

 To see the issue, compare the behavior for examples  nav-bar style  
 from the original sample with my test 
 athttp://sandbox.skulljackpot.com/superfish-local.html#sample4
   - mousing over the rightmost menu item doesn't cause the current  
 element to be deselected.

 Is there a reasonable way to get consistent results for mouseover  
 behavior, regardless of whether or not a given element has a nested  
 ul?

 Chris


[jQuery] Re: Handling html with javascript in .html()

2009-04-15 Thread Donny Kurnia

Snef wrote:
 
 
 Donny Kurnia schreef:
 Snef wrote:
 When using $.ajax() i encounter some problems.

 With the ajax I'm calling a script that will return some html. When
 echoing the returned data, I can see that everything is returned
 including the javascript tags.

 When 'inserting' the returned data into a div on the screen, the
 javascript seems to be executed but i can't see it in the generated
 source!

 I cut it all down to some simple insertion of html into a div like
 this:

 $(#freediv).html('h1 id=testtest/h1script
 language=javascript type=text/javascriptalert(Bla);/
 scriptpBla bla/p');

 The html is inserted in #freediv but i can't see the script tags
 (although alert(Bla) did get executed).
 What are you use for debugging? In Firebug, inserted javascript tag is
 not appear in the html tab, but it's executed. See the XMLHttpRequest in
 Console tab to verify the returned response is what you intended (html
 and the javascript code)

 The real problem is when i try to use some jQuery in the html:

 $(#freediv).html('h1 id=testtest/h1script
 language=javascript type=text/javascript$(#test).click(function
 (){ alert(Bla});/scriptpBla bla/p');

 Isn't this possible at all?
 It's possible. Just don't forget to wait the DOM loaded:

 $(#freediv).html('h1 id=testtest/h1'+
 'script type=text/javascript'+
 'jQuery(function($){'+
 '  $(#test).click(function(){'+
 '   alert(Bla);'+
 '  });'+
 '});'+
 '/script');

 Watch out for parentheses balance. Write it in indented to easily spot
 the missing parentheses. You code above missing  ')' after alert;

 I'm using this to create some 'popup' forms (maybe with SimpleModal)
 and I want to include some javascript into the response that is
 specific for that form (like validation and other actions). I know i
 can use liveQuery or even jQuery's live() but then i need to have all
 the javascript for every used form already in the main document.

 I hope you understand my problem ;)


 I always use technique like this. My XMLHttpRequest to server will
 return html code and javascript code. It's working well.
 
 Donny,
 
 I have correct { } in my code locally ;) was just a typo.
 
 The problem is that when i use ajax I DO see the correct html in the
 response (even when outputting it to firebug with console.debug), but
 when inserting it with .html(data) (where data is the actual html/
 javascript), the javascript tags are gone!
 
 That's why I just tried it with a clean .html(.) and there is my
 problem!
 

Yes Snef, it also happened to me. The javascript tag will be gone when
injected to existing DOM. But I got the effect, and I can see that it is
the correct response in Firebug's Console tab, so it is not a problem
for me. As long everything working like I want, I'm satisfied.


--
Donny Kurnia
http://hantulab.blogspot.com
http://www.plurk.com/user/donnykurnia



[jQuery] Re: grabbing html and putting it back

2009-04-15 Thread Donny Kurnia

hybris77 wrote:
 anyone. Please look at the following example, useless code since it's
 just
 grabbing, html and putting it back again but I need to do this and
 more inbetween
 
 my problem is that it's just not working, my browser kindof crashing,
 not
 completely but nearly
 
 
 var mol_elements = $( '#molecules_holder' ).html();
 
   $( #molecules_holder ).empty();
 
   $( #molecules_holder ).append( mol_elements );
 
 
 /pär
 

That's should working. Try to do it in Firebug Console tab. It is a good
debugging environment.

--
Donny Kurnia
http://hantulab.blogspot.com
http://www.plurk.com/user/donnykurnia



[jQuery] Assigning variable on click

2009-04-15 Thread Connor

Hi,

One other quick question: I'm trying to assign a value to a variable
when a certain element is clicked. Here is my code (wrapped in the
normal jquery ready function)

 $(span.yellow).click(function(){
var color = '#f8e226';

});



  $(.color-changer span).click(function(){
  $(.title b).animate( { color: color }, 1000);
  $(.thick).animate( { backgroundColor: color }, 1000);
  $(a.link).animate( { color: color }, 1000);

});

I am using the color plugin to allow me to animate color values. As
you can see, I'm referencing the variable color in the next function.
Am I missing something, because this doesn't work.


[jQuery] Re: [autocomplete] charset

2009-04-15 Thread Tom Worster

On 4/15/09 3:19 AM, borutt borut.toma...@gmail.com wrote:


 GET /PHP/data.php?sid=0.179863580913668q=%C4%8Duk

%C4%8D is the urlencoding of the utf-8 codepoint for 'č'.


 My input was čuk but like it's seen from GET params, q param has
 strange chars.
 But in QueryString it is ok.

i don't know what 'QueryString'. if that's an input variable from the query
in your back end script then all is well.


 But when I check param q at the end of request (when it passes value
 to sql) I get value äťk.

in which case, you have located the problem as being outside of anything to
do with jquery. study your code between input and sql query and/or
reconfigure your interpreter.


 I have set all the header for character set to windows-1250. I think
 that the problem is with ajax request in your script.

it's not my script.


 But I might be wrong.

possibly so.

i use jquery.autocomplete 1.0.2 in a utf-8 environment and it has no problem
handling č or any other character i've tried including hebrew, greek,
arabic, kana, cyrillic and others.

windows-1250 is obsolescent. why not try using utf-8 instead?


 Does this help you any more?

i thought you were the one looking for help.

maybe specify the charset of your javascript as windows-1250:
http://www.capitolacomputing.com/intl_js_charset.htm




[jQuery] [autocomplete] Sorry...

2009-04-15 Thread jquery at technicalbloke.com

Jorn wants autocomplete posts tagged [autocomplete] in the Subject
line so I'm just reposting a link to my last question (and
coincidentally bumping my post ;-) so he might spot it!

http://groups.google.com/group/jquery-en/browse_thread/thread/d07cc74a05342b7a

or on Stackoverflow.com...

http://stackoverflow.com/questions/750670/bypass-all-cacheing-on-jquery-autocomplete1-02

Thanks!

Roger.



[jQuery] dialog drag problem in firefox

2009-04-15 Thread Edmar

The dialog works fine in Safari and Chrome but not in Firefox even in
the Demos of Jquery UI page, if you start drag the dialog sometimes
the cursor escapes the drag helper  of  the dialog.


[jQuery] Re: Assigning variable on click

2009-04-15 Thread Josch


You initialize the variable within your function (var color).
This means the variable works only within the function.
You have to initialize it outside your function (Before $
(span.yellow).click()).

Josch


On 15 Apr., 15:26, Connor con...@letsbeglobal.com wrote:
 Hi,

 One other quick question: I'm trying to assign a value to a variable
 when a certain element is clicked. Here is my code (wrapped in the
 normal jquery ready function)

  $(span.yellow).click(function(){
                                         var color = '#f8e226';

                                                 });

   $(.color-changer span).click(function(){
   $(.title b).animate( { color: color }, 1000);
   $(.thick).animate( { backgroundColor: color }, 1000);
   $(a.link).animate( { color: color }, 1000);

     });

 I am using the color plugin to allow me to animate color values. As
 you can see, I'm referencing the variable color in the next function.
 Am I missing something, because this doesn't work.


[jQuery] jQuery sessions (persisting data across pages)

2009-04-15 Thread gibble


Personally, I find the .data() function in jQuery very useful. I can keep my
html clean, and just attach data to the elements.

What I'm finding myself needing though, is a way to persist some data client
side across pages.

Unfortunately, it wasn't as simple as $(window).data('key', 'value')

Aside from cookies and appending to the url, is there a way to accomplish
this client side?

I couldn't find a plugin while searching yesterday that would accomplish
this, and was hoping someone here had an idea.

Thanks
-c 
-- 
View this message in context: 
http://www.nabble.com/jQuery-sessions-%28persisting-data-across-pages%29-tp23060638s27240p23060638.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: Assigning variable on click

2009-04-15 Thread Connor

Really? So then how would I assign the variable so it would work
anywhere when a certain element is clicked?

On Apr 15, 9:16 am, Josch jluelsd...@googlemail.com wrote:
 You initialize the variable within your function (var color).
 This means the variable works only within the function.
 You have to initialize it outside your function (Before $
 (span.yellow).click()).

 Josch

 On 15 Apr., 15:26, Connor con...@letsbeglobal.com wrote:

  Hi,

  One other quick question: I'm trying to assign a value to a variable
  when a certain element is clicked. Here is my code (wrapped in the
  normal jquery ready function)

   $(span.yellow).click(function(){
                                          var color = '#f8e226';

                                                  });

    $(.color-changer span).click(function(){
    $(.title b).animate( { color: color }, 1000);
    $(.thick).animate( { backgroundColor: color }, 1000);
    $(a.link).animate( { color: color }, 1000);

      });

  I am using the color plugin to allow me to animate color values. As
  you can see, I'm referencing the variable color in the next function.
  Am I missing something, because this doesn't work.


[jQuery] Re: question about dealing with JSON callback

2009-04-15 Thread Scott Sauyet


sneaks wrote:

i have tried to iterate through the JSON using the jQuery.each():

but it is iterating character by character rather than by each pair


It looks like your JSON response is seen as a String.  What jQuery call 
are you using to load it?


  -- Scptt


[jQuery] question about approaching an interactive image gallery

2009-04-15 Thread roryreiff

Hi there,

I want to start developing a simple interactive image gallery for a
home page. My goal is for it to behave similar to SlideViewer (http://
www.gcmingati.net/wordpress/wp-content/lab/jquery/imagestrip/imageslide-plugin.html)
in it's functionality, except that instead of clicking on a list of
numbers, there will be navigation controls( arrow left, arrow right)
to go forwards or backwards in the images. I also want to have
accompanying text that appears in a div overlay.

I am thinking that best way to do this is to have jQuery interacting
with an XML file that contains the image urls and the accompanying
text? I also want the behavior that on page load I prefetch all the
images and text so that the navigation between images is seamless (at
least prefetch a certain number ahead). Does anyone have input on how
to approach this?

Thanks,



[jQuery] Re: Final Four: Grabbing Keys, Styling Columns, Pop Up Forms, Edit Select Lists?

2009-04-15 Thread briandus

HI Tony, now that you were able to show me how to make the (my) ID
field readonly, it is now being sent to the server like this:   id:
(21,7)   - Where 21 is my database key field and 7 is the row
placement. I can work with this because I can just parse it. BUT, the
delete method is still only sending the row placement. Is there a way
that I can add additional data to the parameters being sent with the
delete request?

Sorry if it's in the documentation and I've missed it. Believe me I
haven't closed this PDF file in days and I am pretty sure I've read
the whole thing a couple times over trying to learn everything for
this great tool.

Also, I have the jqModal.css file linked to the page, but maybe there
is something else missing. I checked in my grid configuration and I
have closeAfterAdd: true, closeAfterEdit: true,  . . . but, it is not
closing after successful action. Does this solidify to you that this
is definitely a CSS issue??

Thanks again for the help!



On Apr 15, 12:53 am, Tony t...@trirand.com wrote:
 Hello,
 #1) Yes you are right and I agree that the id should be configurable
 from the developer.
 This of course requiere a lot of work, but I think I will implemet
 this.

 #2) Check to see if you have loaded all the needed css and js files.
 This is mostley caused that jqModal.css is not loaded.

 #3) Definitley I will aplly this to the new 3.5 version.

 #4) It is better to send me the configuration.

 #5) Little stange. Which version do you use.
 Also check your server response what you have in total records

 Regards
 Tony

 On Apr 14, 7:50 pm, briandus bri...@virtual-essentials.com wrote:

  Hi Tony -

  #1) thanks so much for the hint on the readonly field. I must have
  missed that one in the documentation; works perfectly! Howover, the
  row placement being the value of the id that is being sent is
  obviously a problem as I can't use that to manipulate my database
  records. Unfortunately, I can't change the field name in the database
  which is named ID and I'm using VB.NET on the backend which isn't
  case sensitive. So, I'm having a conflict between the id and the
  ID. But, I have ID defined like this in the colModel:

  { name: ID, width: 3, hidden: true, key: true, sorttype: 'int',
  editable: true, editrules: { searchhidden: true, index: 'ID', jsonmap:
  'ID' }, editoptions: { readonly: true} }

   I was thinking maybe I could just send this field as an extra
  parameter or something. But, isn't the key attribute what should
  make it the id ?

  #2) I am using FF primarily, but am testing along in IE 6 and 7 as I
  move forward. Yesterday, it was the Add record form that was always
  popped open when I opened the page, but since then I added a show/hide
  column window and now it's the one that's showing up on each page
  request. I'm assuming it has something to do with the way I am trying
  to implement the method. I just have it tacked on at the end, instead
  of being inside an event. I guess I need to attach it to a click event
  instead.
    }).$(#searchFields).filterGrid(#mygrid, { gridModel: true,
  gridNames: true, formtype: vertical, enableSearch: true,
  enableClear: true, autosearch: true });

  #3) Sorry to hear about the column styling, but I'll be looking
  forward to seeing your new features for that in the future.

  #4)  I have a large grid (about 165 lines)  so I'm not sure how you
  want me to send it. Do you want me to send all of the grid
  configuration or just a piece of it? Here is an example of how I have
  defined one column that needed a select list on the edit form:

  { name: InterchangeVersion, width: 25, resizable: true, sortable:
  true, sorttype: 'text', editable: true, edittype: 'select',
  editoptions: { value: 004010X098A1:4010 Prof A1;004010X097A1:4010
  Dental A1;004010X096A1:4010 Inst A1;004010X098A:4010 Prof;004010X097A:
  4010 Dental;004010X096A:4010 Inst }, editrules: { required: true,
  index: 'InterchangeVersion', jsonmap: 'InterchangeVersion', label:
  'InterchangeVersion', resizable: true, search: true} },

  The value held in the database (and displayed in the grid) is the
  value on the left of the colon. The text to show in the dropdown is
  the right side. Is this correct?

  #5 ) The other thing I was going to ask also is that on my pager, I
  have 7 total records, but it shows 14. Yesterday it was doing the same
  thing. I had the records per page set to 3 and there were a total of 5
  records, but the pager showed 8. And, it always shows page 1 of 0. I
  was using alert's after the json string was read and it alerts the
  correct number of pages, so I was just curious what I may be doing
  wrong there and what I could look for.

  Thanks so much!!

  On Apr 14, 2:44 am, Tony t...@trirand.com wrote:

   Hello,

   #1)
   colModel : [
   { name:ID, hidden:true, editable:true, editrules:{edithidden:true},
   editoptions:{readonly:true} },
   ..
   ]
   Look into the docs for more details.

   #2) In wich browser is this?

   

[jQuery] Re: Assigning variable on click

2009-04-15 Thread Connor

Nevermind. I realized that I just needed to assign a global variable
instead. ie taking out the var.

On Apr 15, 10:25 am, Connor con...@letsbeglobal.com wrote:
 Really? So then how would I assign the variable so it would work
 anywhere when a certain element is clicked?

 On Apr 15, 9:16 am, Josch jluelsd...@googlemail.com wrote:

  You initialize the variable within your function (var color).
  This means the variable works only within the function.
  You have to initialize it outside your function (Before $
  (span.yellow).click()).

  Josch

  On 15 Apr., 15:26, Connor con...@letsbeglobal.com wrote:

   Hi,

   One other quick question: I'm trying to assign a value to a variable
   when a certain element is clicked. Here is my code (wrapped in the
   normal jquery ready function)

    $(span.yellow).click(function(){
                                           var color = '#f8e226';

                                                   });

     $(.color-changer span).click(function(){
     $(.title b).animate( { color: color }, 1000);
     $(.thick).animate( { backgroundColor: color }, 1000);
     $(a.link).animate( { color: color }, 1000);

       });

   I am using the color plugin to allow me to animate color values. As
   you can see, I'm referencing the variable color in the next function.
   Am I missing something, because this doesn't work.


[jQuery] Re: Creating custom attributes in html

2009-04-15 Thread Karl Swedberg

On Apr 14, 2009, at 6:34 PM, Ricardo wrote:



If you insert these attributes server-side, the page will not validate
and might trigger quirks mode in the browser. If you are adding them
after load, there's no harm in it, but I bet using data() would be
faster for lots of elements.




I was under the impression that adding DOM expandos with JavaScript  
could cause memory leaks in IE unless you scrupulously clean up after  
yourself (setting the property to null or some such). Using data()  
avoids this problem.


--Karl


Karl Swedberg
www.englishrules.com
www.learningjquery.com





[jQuery] Re: IE problem with each function

2009-04-15 Thread Karl Swedberg


On Apr 14, 2009, at 10:47 PM, Zhx wrote:



here is my code, it works fine in FF, but in IE, the index message
did not popup. Anyone could give me a suggestion to figure out this?
  jQuery(#demoform dt).each(function(index,domEle){
   if (jQuery(domEle).text() == ISSN:)
 {
 alert(index);
 exit;
 }
   })


you're probably getting a javascript error in IE that is terminating  
the script. Try replacing exit; with return false;



--Karl


Karl Swedberg
www.englishrules.com
www.learningjquery.com



[jQuery] Re: How to block control + plus/minus key?

2009-04-15 Thread Gordon

If you can find a reason why she doesn't want people to zoom I'd
appreciate it.  Other than having a personal vendetta against the
visually-impaired I can't think of a single good reason.

It's pretty much moot anyway as there's just no way to do it.  In the
bad old days of IE6 specifying font sizes in px would prevent text
zooming but that was basically due to bug that has now been fixed in
IE7.

On Apr 3, 3:25 pm, Filipe fil...@ideologic.com.br wrote:
 Indeed it is perverse but, unfortunately, that's what my client asked me to 
 do. She wants to block zooming in and zooming out. I told her that it can't 
 be done, so she asked me to find a way to block the control key combination. 
 ;/

 - Original Message -
 From: Filipe
 To: jquery-en@googlegroups.com
 Sent: Friday, April 03, 2009 1:05 AM
 Subject: How to block control + plus/minus key?

 hey folks,

 how can i block control + plus/minus key on the whole page? i've tried a few 
 scripts but none of them seem to work.

 thanks in advance!

 filipe.


[jQuery] Re: question about dealing with JSON callback

2009-04-15 Thread dhtml



On Apr 14, 9:34 pm, sneaks deroacheee...@gmail.com wrote:
 hi! i am trying to use jQuery.post() to send name/value to a php
 function which then retreives data from mysql and responds with JSON
 which looks like this when i append it directly to my debug output
 div:


[...]

 i have tried to iterate through the JSON using the jQuery.each():

You should provide a reduced testcase so that we can see the problem.
This should be a live example on your webhost, ideally (so we don't
have to copy all of your files to our own webserver).

When posting code, you should also format that code to wrap at = 72
chars. Use spaces, not tabs. This makes it easier for us humans to
read.

Plain enumeration is simple. For example:-

var json = eval( responseText ),
 key, value;

for( key in json ) {
  value = json[key];
}

But you are using jQuery. So we'll try and figure out what is going
on.


 Query.each(obj, function(i, val) {
 etc...

Why don't you post up the whole function?

Garrett


[jQuery] Superfish - text aliased until fade-in completes

2009-04-15 Thread Dave Novelli

Hi all,

I was wondering if anyone has run into a problem with the text in a
superfish menu looking like crap until the animation is done, and then
it correcting itself. It's not a problem in FF3 (not sure about FF2)
and it's a problem in IE6, 7, and 8. Any ideas on where to start
debugging this one?

Thanks,
Dave


[jQuery] alert wont fire from page to page

2009-04-15 Thread Bob O

I have a very simple piece of code.

$(document).ready(function() {
  // var url = location.pathname;
  alert(url);
});

When im on my home page it alerts the pathname like it should. but
when i navigate to the next page the alert does not fire

the firebug dom shows the new pathname..but the alert does not fire.

the js files are across all of my views and the js file that contains
this piece of code is in the source when viewed

any guidance would be great.

thanks


[jQuery] Re: alert wont fire from page to page

2009-04-15 Thread Bob O

also in my code the line is not commented out...

I accidentally pasted that in there..

On Apr 15, 10:45 am, Bob O sngndn...@gmail.com wrote:
 I have a very simple piece of code.

 $(document).ready(function() {
   // var url = location.pathname;
   alert(url);

 });

 When im on my home page it alerts the pathname like it should. but
 when i navigate to the next page the alert does not fire

 the firebug dom shows the new pathname..but the alert does not fire.

 the js files are across all of my views and the js file that contains
 this piece of code is in the source when viewed

 any guidance would be great.

 thanks


[jQuery] Re: Final Four: Grabbing Keys, Styling Columns, Pop Up Forms, Edit Select Lists?

2009-04-15 Thread briandus

Ok..had a brain cramp...I found the delete options..Alright!

Still having trouble with the jqModal forms though...but, things are
definitely moving forward and I'm excited. This is really an amazing
plug in Tony. Thanks so much for your contributions and ALL the help!

Briana

On Apr 15, 9:02 am, briandus bri...@virtual-essentials.com wrote:
 HI Tony, now that you were able to show me how to make the (my) ID
 field readonly, it is now being sent to the server like this:   id:
 (21,7)   - Where 21 is my database key field and 7 is the row
 placement. I can work with this because I can just parse it. BUT, the
 delete method is still only sending the row placement. Is there a way
 that I can add additional data to the parameters being sent with the
 delete request?

 Sorry if it's in the documentation and I've missed it. Believe me I
 haven't closed this PDF file in days and I am pretty sure I've read
 the whole thing a couple times over trying to learn everything for
 this great tool.

 Also, I have the jqModal.css file linked to the page, but maybe there
 is something else missing. I checked in my grid configuration and I
 have closeAfterAdd: true, closeAfterEdit: true,  . . . but, it is not
 closing after successful action. Does this solidify to you that this
 is definitely a CSS issue??

 Thanks again for the help!

 On Apr 15, 12:53 am, Tony t...@trirand.com wrote:

  Hello,
  #1) Yes you are right and I agree that the id should be configurable
  from the developer.
  This of course requiere a lot of work, but I think I will implemet
  this.

  #2) Check to see if you have loaded all the needed css and js files.
  This is mostley caused that jqModal.css is not loaded.

  #3) Definitley I will aplly this to the new 3.5 version.

  #4) It is better to send me the configuration.

  #5) Little stange. Which version do you use.
  Also check your server response what you have in total records

  Regards
  Tony

  On Apr 14, 7:50 pm, briandus bri...@virtual-essentials.com wrote:

   Hi Tony -

   #1) thanks so much for the hint on the readonly field. I must have
   missed that one in the documentation; works perfectly! Howover, the
   row placement being the value of the id that is being sent is
   obviously a problem as I can't use that to manipulate my database
   records. Unfortunately, I can't change the field name in the database
   which is named ID and I'm using VB.NET on the backend which isn't
   case sensitive. So, I'm having a conflict between the id and the
   ID. But, I have ID defined like this in the colModel:

   { name: ID, width: 3, hidden: true, key: true, sorttype: 'int',
   editable: true, editrules: { searchhidden: true, index: 'ID', jsonmap:
   'ID' }, editoptions: { readonly: true} }

    I was thinking maybe I could just send this field as an extra
   parameter or something. But, isn't the key attribute what should
   make it the id ?

   #2) I am using FF primarily, but am testing along in IE 6 and 7 as I
   move forward. Yesterday, it was the Add record form that was always
   popped open when I opened the page, but since then I added a show/hide
   column window and now it's the one that's showing up on each page
   request. I'm assuming it has something to do with the way I am trying
   to implement the method. I just have it tacked on at the end, instead
   of being inside an event. I guess I need to attach it to a click event
   instead.
     }).$(#searchFields).filterGrid(#mygrid, { gridModel: true,
   gridNames: true, formtype: vertical, enableSearch: true,
   enableClear: true, autosearch: true });

   #3) Sorry to hear about the column styling, but I'll be looking
   forward to seeing your new features for that in the future.

   #4)  I have a large grid (about 165 lines)  so I'm not sure how you
   want me to send it. Do you want me to send all of the grid
   configuration or just a piece of it? Here is an example of how I have
   defined one column that needed a select list on the edit form:

   { name: InterchangeVersion, width: 25, resizable: true, sortable:
   true, sorttype: 'text', editable: true, edittype: 'select',
   editoptions: { value: 004010X098A1:4010 Prof A1;004010X097A1:4010
   Dental A1;004010X096A1:4010 Inst A1;004010X098A:4010 Prof;004010X097A:
   4010 Dental;004010X096A:4010 Inst }, editrules: { required: true,
   index: 'InterchangeVersion', jsonmap: 'InterchangeVersion', label:
   'InterchangeVersion', resizable: true, search: true} },

   The value held in the database (and displayed in the grid) is the
   value on the left of the colon. The text to show in the dropdown is
   the right side. Is this correct?

   #5 ) The other thing I was going to ask also is that on my pager, I
   have 7 total records, but it shows 14. Yesterday it was doing the same
   thing. I had the records per page set to 3 and there were a total of 5
   records, but the pager showed 8. And, it always shows page 1 of 0. I
   was using alert's after the json string was read and 

[jQuery] Re: Basic Selector expression only work on Chrome, no other browsers

2009-04-15 Thread Karl Swedberg

Maybe try a filter function:

var filters = $('div').filter(function() {
   return this.style.filter;
}).length;

alert(filters);

It won't work in FF because filter is IE-proprietary. Has nothing to  
do with jQuery. To test, try this:


  var divs = document.getElementsByTagName('div');
  for (var i=0; i  divs.length; i++) {
(window.console  console.log) ?
  console.log(divs[i].style.filter + ' ' +  
divs[i].style.width) :

  alert(divs[i].style.filter + ' ' + divs[i].style.width);
  }

...and look in the Firebug console if you have it.


--Karl


Karl Swedberg
www.englishrules.com
www.learningjquery.com




On Apr 15, 2009, at 5:57 AM, Tao wrote:



Hi,

I have the follow simple html code:

div style=FILTER: progid:DXImageTransform.Microsoft.Gradient
(GradientType=1, StartColorStr=#, EndColorStr=#7E003366);
WIDTH: 794px; HEIGHT: 685px
Hello
/div

And I try to use follow code to get the div element:

alert($('div[style*=FILTER]').length);

In Google Chorme, it return 1, but on other browsers IE8, FF3, Opera9,
all return 0.

Any suggestion?

Cheers,




[jQuery] Re: alert wont fire from page to page

2009-04-15 Thread Bob O

nevermind...i found the problem.

On Apr 15, 10:46 am, Bob O sngndn...@gmail.com wrote:
 also in my code the line is not commented out...

 I accidentally pasted that in there..

 On Apr 15, 10:45 am, Bob O sngndn...@gmail.com wrote:

  I have a very simple piece of code.

  $(document).ready(function() {
    // var url = location.pathname;
    alert(url);

  });

  When im on my home page it alerts the pathname like it should. but
  when i navigate to the next page the alert does not fire

  the firebug dom shows the new pathname..but the alert does not fire.

  the js files are across all of my views and the js file that contains
  this piece of code is in the source when viewed

  any guidance would be great.

  thanks


[jQuery] Re: Check value when adding to array

2009-04-15 Thread mkmanning

$.map creates a new array based on the return value of the function,
using the format
newarray = $.map( array, function );

The array in the sample is the jQuery selector (which is array-like).
The function iterates through the members of the array, with the index
passed in as i and the member element as n.

The function returns n.name + = + n.value if n.name doesn't have
_test in it. If it does have _test in the name, then it returns
some_value that has been predefined. Its just a simple ternary
statement:

value  = condition?true:false;

HTH :)

On Apr 13, 6:38 pm, Nic Hubbard nnhubb...@gmail.com wrote:
 Could you explain this one a little more?  How you coded it is a
 little confusing to me.

 On Apr 13, 6:34 pm, mkmanning michaell...@gmail.com wrote:

  If I understand you code, you're trying to create an array of
  name=value, with value being specifically set if the name has _test in
  it?

  var arr = $.map($('input'),function(n,i){
          return 
  n.name+'='+(n.name.indexOf('_test')!=-1?'some_value':n.value);

  });

  On Apr 13, 5:27 pm, Nic Hubbard nnhubb...@gmail.com wrote:

   I have input values that I am adding to a array.  I would like to be
   able to check if any of them end in _test and if so, I need to set a
   specific value.  Is there any, in an if statement, to check if an
   attribute of one of the input fields ends with _test?

   main_form.find('input').each(function() {
     arr_current_item2.push($(this).attr('name') + '=' + $(this).val());

   });// End each


[jQuery] Re: Creating custom attributes in html

2009-04-15 Thread JBeckton

I was using custom attributes, I just discovered that when using live
() to bind events to HTML elements coming in via AJAX would
mysteriously stop working. I searched around the bugs DB and found
that it was the custom attributes I was using to select the elements
to bind to that was causing things to stop working. I removed the
custom attributes and use a class instead and it started working
again.

So now I will be removing all the custom attributes.


On Apr 14, 1:56 pm, seasoup seas...@gmail.com wrote:
 I was wondering what jquery developers opinion of adding custom
 attributes to html tags is, and what your basis is for these
 opinions?  Why is it a good idea, or why is it a bad idea?  What I
 mean is this:

 div href= myType=foocontent/div

 where 'myType' isn't in any specifications.  I've run into developers
 who think this is a good idea, and those who think this is a bad idea
 and I'd like to get a better sense of both sides of the argument.
 Personally, I use them all of the time.  They are a great way to
 preserve information for use with .live() in jQuery, among other
 things, and since I append a long string to the DOM instead of
 creating lots of little DOM nodes, I generally cannot use .data() to
 save information on the individual nodes.

 Example of a usage:

 div name=foo myType=barclick/div
 ...
 $('div[name=foo]').live('click', function () {
    console.log($(this).attr('myType'));

 });

 Example of why I cannot use .data():

 var htmlString = 'table';
 for (var a = 0; a  100; a++) {
     htmlString += 'trtd name=clickme nodeId=filter'+ a
 +'click/td/tr';}

 htmlString += '/table';
 $('div[name=foo]').append(htmlString);
 $('td[name=clickme]').live('click', function() {
     console.log($(this).attr('nodeId'));

 });

 To debate the merits of using this kind of append, please go 
 to:http://www.learningjquery.com/2009/03/43439-reasons-to-use-append-cor...

 What I'm looking for instead is a discussion of using custom
 attributes in html.

 Thanks,
 Josh Powell


[jQuery] Re: $.get callback function fails - but only in IE

2009-04-15 Thread James

This is probably related to the issue in this thread:
http://groups.google.com/group/jquery-en/browse_thread/thread/036d49aead899d68

You can use the text2xml function at the bottom of the thread provided
by Diego A.

I don't remember the issue specifically, but I think the issue seems
to be that IE is not recognizing the XML via jQuery because it does
not have a content-type text/xml (I believe that's what it's suppose
to be) so the AJAX falling into the error callback. If possible, such
as if you're generating the XML server-side dynamically, forcing the
header content-type to text/xml for the response should probably solve
your issue directly.

On Apr 15, 1:39 am, Bjaergager onepr...@gmail.com wrote:
 I have a function that uses $.get to retrieve xml and in the callback
 function it will update a form.
 The function works fine in FF3 - but not in IE7, in IE7 I can see that
 the $.get DO request the xml with correct parameters - but the
 callback function never is called.

 Here's my function - please help me get this right :-)

 function editPosting(val)
     {
         var f = new Array
 (korseldato,fragtbrevdato,vognnr,chauffor,fragtbrevnr,postnr,vaegt,bemaerkninger);
         var c = new Array
 (indbaering,ventetid,tidslevering,genkorsel,lufthavnsgebyr,forgaevesafh,udenkvittering,forgaeves,toldoplag);
         $.get(ajax/ajax.php, { action: getfragtbrev, id: val,
 rnd:Math.random } ,function(xml){
               setDivVal(#fbid, $(id,xml).text() );
               for(i=0;if.length;i++)
                   {
                     setDivVal( #+f[i], $(f[i],xml).text() );
                 }
               for(i=0;ic.length;i++)
                   {
                 if( $(c[i],xml).text() == '1')
                     {
                         $(#+c[i]).attr('checked', true);
                     } else {
                         $(#+c[i]).attr('checked', false);
                     }
                 }
             });
     }

     function setDivVal(div,val)
     {
         $(div).val(val);
     }


[jQuery] A little help needed with form processing and page redirects

2009-04-15 Thread poundcommapo...@gmail.com

Hi. I have what I feel like should be a simple problem, but I'm having
a hard time sorting it out. The page is located here: 
http://staging.pixelluxe.com/tbs/
I apologize in advance that all the code is on one line - client
request (also, the inline styles are their requirement).

Anyway, this is a simple quiz. There are 8 multiple-choice questions
in sets of radio groups. Each radio group has four possible answers
with values of 1, 2, 3, or 4.

On submit, I need a script to add up the user's selections and
redirect the user to 1 of 4 pages depending on the total score. I'm
currently doing it with a simple PHP script and meta-refresh, but the
client wants a client-side solution, with the PHP only as a backup if
JavaScript is disabled.

Anyone know how to make that happen? Thanks so much.


[jQuery] Count how many checkboxes are checked

2009-04-15 Thread Dragon-Fly999

Hi, I'm new to JQuery and I have a question about checkboxes.  I have
5 checkboxes on my page and they are passed into my plug-in.  I'd like
to find out how many of them are checked in my plug-in.  The following
code works but I'm sure there is a better way to do it (especially the
part of the code that figures out the number of checkboxes checked).
Any suggestions would be appreciated.  Thank you.

=

In my aspx page:

// $('.category-list') returns a list of 5 checkboxes.
$(function() {
  $('#info-heading').createCategoryGroup($('.category-list'));
});

=

In my plug-in:

// categoryList is a list of checkboxes.
(function($) {
  $.fn.createCategoryGroup = function(categoryList) {

var heading = this; // This is an anchor.

// Figure out how many checkboxes are checked when the user clicks
// on any one of the checkboxes.
categoryList.click(function() {

  // Figure out the number of checkboxes that are checked.
  var checkedCount = 0;
  categoryList.each(function() {
if (this.checked) {
  checkedCount++;
}
  }); // End of each.

  // Set the heading to a different color based on how
  // many checkboxes are checked.
  heading.css('color', checkedCount == 0 ? 'black' : 'red');
}); // End of click.

return this;
  }
})(jQuery);


[jQuery] Re: jQuery.autocomplete skipping GET calls...

2009-04-15 Thread James

Autocomplete does have a 'delay' option (in milliseconds) such that if
you typed a character immediately after another character, and the
time difference is less than the time set in 'delay', then your
previous call will not be executed. In your case, you probably typed
'r' then 's' too quickly. By default, it's 400ms, or a little less
than half a second.

If you want it to call with just about nearly every keystroke, set
delay to a very low number (I'm not sure if 0 is a valid value or not.
Just put 10 to be safe.) Provided you don't type at 10,000 WPM speeds
(un-educated guess) then you probably won't have a problem.

On Apr 15, 12:56 am, jquery at technicalbloke.com
technicalbl...@googlemail.com wrote:
 Hi,

 This is the version of jQuery.autocomplete I'm using...

  * Revision: $Id: jquery.autocomplete.js 5747 2008-06-25 18:30:55Z
 joern.zaefferer $

 I'm having a problem with autocomplete skipping GET calls. I have a
 thread already open over at stack overflow 
 (http://stackoverflow.com/questions/750670/bypass-all-cacheing-on-jque...
 ) so I won't go into too much more detail...

 Basically I'm monitoring the server side and as I type say 'arse' it
 is receiving:

 http://localhost/dynamic_seach?q=ahttp://localhost/dynamic_seach?q=arshttp://localhost/dynamic_seach?q=arse

 Notice how it is missing:http://localhost/dynamic_seach?q=ar

 I have manually fed this to the server an it happily spits out the
 correct result for 'ar' it just never gets called by autocomplete,
 which implies to me something's getting cached somewhere and I think
 I've eliminated everything but autocomplete. As I type it finds and
 displays suggestions for 'ar' but without issuing a GET request to the
 server so these suggestions are inaccurate :-( Interestingly it does
 issue GETs for most other two letter combinations.

 Here's my javascript.

     $(document).ready(function(){ $(#input_box).autocomplete('/
 localhost/dynamic_search',

 cacheLength=1
                                                               ); })

 None of the other options like: matchContains=true, matchSubset=false
 seem to make the blindest bit of difference. I wondered if flushCache
 () might help but I'm not sure how to make sure that gets called
 before autocomplete with every keystroke :-/ Is there a way to do
 this, or a way to force autocomplete to hit my server up for some
 fresh data every time?

 Regards,

 Roger.

 I'll try and keep an eye on this group for answers but if you use
 stackoverflow.com that would be even better, thanks! ;-)

 Would


[jQuery] Re: Count how many checkboxes are checked

2009-04-15 Thread Erik Beeson
categoryList.is(':checked') will return false if none are checked, so you
could do:

heading.css('color', categoryList.is(':checked') ? 'red' : 'black');

--Erik

On Wed, Apr 15, 2009 at 8:33 AM, Dragon-Fly999 dragon-fly...@hotmail.comwrote:


 Hi, I'm new to JQuery and I have a question about checkboxes.  I have
 5 checkboxes on my page and they are passed into my plug-in.  I'd like
 to find out how many of them are checked in my plug-in.  The following
 code works but I'm sure there is a better way to do it (especially the
 part of the code that figures out the number of checkboxes checked).
 Any suggestions would be appreciated.  Thank you.

 =

 In my aspx page:

// $('.category-list') returns a list of 5 checkboxes.
$(function() {
  $('#info-heading').createCategoryGroup($('.category-list'));
});

 =

 In my plug-in:

 // categoryList is a list of checkboxes.
 (function($) {
  $.fn.createCategoryGroup = function(categoryList) {

var heading = this; // This is an anchor.

// Figure out how many checkboxes are checked when the user clicks
// on any one of the checkboxes.
categoryList.click(function() {

  // Figure out the number of checkboxes that are checked.
  var checkedCount = 0;
  categoryList.each(function() {
if (this.checked) {
  checkedCount++;
}
  }); // End of each.

  // Set the heading to a different color based on how
  // many checkboxes are checked.
  heading.css('color', checkedCount == 0 ? 'black' : 'red');
}); // End of click.

return this;
  }
 })(jQuery);



[jQuery] Re: jQuery sessions (persisting data across pages)

2009-04-15 Thread James

There really is no such thing, since each HTTP request is generally
stateless without any relations between each call. Without using
cookies and through the URL (GET method), the other only common way is
through the POST method. That would mean every page change requires
some kind of form submission with POST data, which is very hackish and
not recommended.

This all depends on what your application is doing. The recommended
method is to create a session id for the user, use cookies to store
that id if available, and if not, pass that id along the url.

I think I've read of another hackish method of being able to set a
window name via the DOM to pass info, but I don't have any specifics
on it and whether it works on all browsers or not.

On Apr 15, 5:01 am, gibble gib...@gmail.com wrote:
 Personally, I find the .data() function in jQuery very useful. I can keep my
 html clean, and just attach data to the elements.

 What I'm finding myself needing though, is a way to persist some data client
 side across pages.

 Unfortunately, it wasn't as simple as $(window).data('key', 'value')

 Aside from cookies and appending to the url, is there a way to accomplish
 this client side?

 I couldn't find a plugin while searching yesterday that would accomplish
 this, and was hoping someone here had an idea.

 Thanks
 -c
 --
 View this message in 
 context:http://www.nabble.com/jQuery-sessions-%28persisting-data-across-pages...
 Sent from the jQuery General Discussion mailing list archive at Nabble.com.


[jQuery] passing elem id to a JS function...

2009-04-15 Thread kali

hi, am trying to do image-hide/img-show with jQuery (now use 'regular'
JavaScript DOM-scripting..  want to switch to jQuery..  but am having
some difficulties:

I have this function-call in interface:

  get_img('photo1','nav1','navAll1','photo2','nav2','navAll2')

in function -- old way:

function get_img
(curr_img,curr_nav,curr_navAll,new_img,new_nav,new_navAll)  {
var img_top= document.getElementById(curr_img);
var img_new= document.getElementById(new_img);//  etc..

how do I do this in jQuery?  I tried:

var img_top= $(#curr_img);
var img_top= $(curr_img);

neither one of these is working..  and worst problem is I don't get
errors in Firefox Error Console (jQuery syntax errors don't show in FF
Error Console...  is there a place where you can check your jQuery
syntax??)

the element id's are passed to the function as string values..  so how
do I add this string value to a wrapper like this

$('# id passed to function')

thank you...




thank you very much...





[jQuery] grid layout plugin?

2009-04-15 Thread bobh

Hi,

I've been on the lookout for a jquery plugin that fits divs together
into a nicely fitting layout. For example:

http://spacecollective.org/gallery/

more:
http://www.corneer.se/nolegacy/?p=528

Does it exist?


[jQuery] Autocomplete plugin for multiple form fields from a JSON source [autocomplete]

2009-04-15 Thread tatlar

Hi there,

I have a nicely formatted JSON file that looks like:

{
   stations : {
  F07A : {
 calibration : 1212797922,
 construction : 1152736320,
 calibrationplot : 158922,
 service : [
1186011098,
1209718352,
1213577558,
1214081337,
1220576523
 ],
 installation : 1157069307
  },
 snip
  S08C : {
 dlevent : 1196697107,
 removal : 1192723069,
 service : [
1127293181,
1154632570,
1157479149
 ],
 installation : 1123277295
  }
   }
}

It consists of the 'stations' object, with keys that are station
names, then an object that has station visit type and an associated
timestamp. If there is more than one visit, then an array is created
(such as 'service' in my snippet above).

I am using Jorn's awesome autocomplete plugin in one form field to
allow a user to quickly narrow down which station they wish to view
visit times for. However, it would be really cool to extend this so
that when the selection is narrowed to one station, there is another
form input field listing all the available visit types that is
populated from the JSON file as well. I have seen this with simple
javascript arrays  from way back (eg: 
http://www.plus2net.com/php_tutorial/dd3.php)
but I was wondering if anyone has implemented such as setup using the
autocomplete plugin (or another plugin).

I see in the plugin API there is a 'multiple' option, but that appears
to be for the same text field. I guess I will have to write a call-
back function when autocomplete narrows the search to one in the first
input field, but I am not sure how to bind them. Any ideas?

Thanks in advance.


[jQuery] Re: Creating custom attributes in html

2009-04-15 Thread mkmanning

This is not quite to the point of discussing the merits per se, but
still germane I think. RobG pointed out that you're using the name
attribute in a div, which isn't valid. It's also not valid in a td,
but obviously that only matters if validation is important to you
(which is a totally separate discussion). Using classes is reasonable
depending upon the type of data you want to store, but for the example
you're giving, why wouldn't an ID attribute work for you?

You could also rethink your approach; there's really no reason to
store the kind of data you are in the element, just to figure out what
was clicked—that can be done on the fly (at least with the example
markup you give):

$('td.clickme').live('click', function() {
console.log('filter'+$('td.clickme').index(this));
});

If you aren't going to add more rows, you could use this (saves having
to run the selector for each click--you also wouldn't need live):

var tds = $('td.clickme').live('click', function() {
console.log('filter'+tds.index(this));
});

You can also use plain old event delegation and set the click on the
table:

$('table').click(function(e) {
console.log('filter'+$(this).find('td.clickme').index($(e.target)));
});




On Apr 14, 10:56 am, seasoup seas...@gmail.com wrote:
 I was wondering what jquery developers opinion of adding custom
 attributes to html tags is, and what your basis is for these
 opinions?  Why is it a good idea, or why is it a bad idea?  What I
 mean is this:

 div href= myType=foocontent/div

 where 'myType' isn't in any specifications.  I've run into developers
 who think this is a good idea, and those who think this is a bad idea
 and I'd like to get a better sense of both sides of the argument.
 Personally, I use them all of the time.  They are a great way to
 preserve information for use with .live() in jQuery, among other
 things, and since I append a long string to the DOM instead of
 creating lots of little DOM nodes, I generally cannot use .data() to
 save information on the individual nodes.

 Example of a usage:

 div name=foo myType=barclick/div
 ...
 $('div[name=foo]').live('click', function () {
    console.log($(this).attr('myType'));

 });

 Example of why I cannot use .data():

 var htmlString = 'table';
 for (var a = 0; a  100; a++) {
     htmlString += 'trtd name=clickme nodeId=filter'+ a
 +'click/td/tr';}

 htmlString += '/table';
 $('div[name=foo]').append(htmlString);
 $('td[name=clickme]').live('click', function() {
     console.log($(this).attr('nodeId'));

 });

 To debate the merits of using this kind of append, please go 
 to:http://www.learningjquery.com/2009/03/43439-reasons-to-use-append-cor...

 What I'm looking for instead is a discussion of using custom
 attributes in html.

 Thanks,
 Josh Powell


[jQuery] Re: passing elem id to a JS function...

2009-04-15 Thread mkmanning

 var img_top  = $(#+curr_img);

On Apr 15, 8:57 am, kali maya778...@yahoo.com wrote:
 hi, am trying to do image-hide/img-show with jQuery (now use 'regular'
 JavaScript DOM-scripting..  want to switch to jQuery..  but am having
 some difficulties:

 I have this function-call in interface:

   get_img('photo1','nav1','navAll1','photo2','nav2','navAll2')

 in function -- old way:

 function get_img
 (curr_img,curr_nav,curr_navAll,new_img,new_nav,new_navAll)  {
         var img_top    = document.getElementById(curr_img);
         var img_new    = document.getElementById(new_img);    //  etc..

 how do I do this in jQuery?  I tried:

         var img_top    = $(#curr_img);
         var img_top    = $(curr_img);

 neither one of these is working..  and worst problem is I don't get
 errors in Firefox Error Console (jQuery syntax errors don't show in FF
 Error Console...  is there a place where you can check your jQuery
 syntax??)

 the element id's are passed to the function as string values..  so how
 do I add this string value to a wrapper like this

     $('# id passed to function')

 thank you...

 thank you very much...


[jQuery] Re: jQuery sessions (persisting data across pages)

2009-04-15 Thread gibble


That's what I figured, I think I'm going to work out a generic json/xml data
store web service and write a jQuery plugin to access it.


James-279 wrote:
 
 
 There really is no such thing, since each HTTP request is generally
 stateless without any relations between each call. Without using
 cookies and through the URL (GET method), the other only common way is
 through the POST method. That would mean every page change requires
 some kind of form submission with POST data, which is very hackish and
 not recommended.
 
 This all depends on what your application is doing. The recommended
 method is to create a session id for the user, use cookies to store
 that id if available, and if not, pass that id along the url.
 
 I think I've read of another hackish method of being able to set a
 window name via the DOM to pass info, but I don't have any specifics
 on it and whether it works on all browsers or not.
 
 On Apr 15, 5:01 am, gibble gib...@gmail.com wrote:
 Personally, I find the .data() function in jQuery very useful. I can keep
 my
 html clean, and just attach data to the elements.

 What I'm finding myself needing though, is a way to persist some data
 client
 side across pages.

 Unfortunately, it wasn't as simple as $(window).data('key', 'value')

 Aside from cookies and appending to the url, is there a way to accomplish
 this client side?

 I couldn't find a plugin while searching yesterday that would accomplish
 this, and was hoping someone here had an idea.

 Thanks
 -c
 --
 View this message in
 context:http://www.nabble.com/jQuery-sessions-%28persisting-data-across-pages...
 Sent from the jQuery General Discussion mailing list archive at
 Nabble.com.
 
 

-- 
View this message in context: 
http://www.nabble.com/jQuery-sessions-%28persisting-data-across-pages%29-tp23060638s27240p23065242.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: Code Slider problem

2009-04-15 Thread sato.ph...@gmail.com

Thank you very much.  That fixed the problem

On Apr 15, 5:26 am, Jonathan Vanherpe (T  T NV) jonat...@tnt.be
wrote:
 sato.ph...@gmail.com wrote:
  I am trying to implement the coda slider javascript as seen on the
  jqueryfordesigners page:

 http://jqueryfordesigners.com/coda-slider-effect/

  I have it working on FF/Safari for Mac, as well as IE for Windows.
  However, strangely, it will not work properly on FF for Windows.
  Though it loads and scrolls, all of the elements are visible in a line
  across the page, instead of hidden except for the one panel between
  the arrows.  Any ideas?

 www.danielsato.com/test

 The first flash movie works properly because it has wmode set to
 transparant (both in the object and the embed tag. Just change this
 for the other flash movies.

 Jonathan

 --
 Jonathan Vanherpe - Tallieu  Tallieu NV - jonat...@tnt.be


[jQuery] Re: jQuery Form Validation

2009-04-15 Thread NobitaNobi79

Hi Jörn and others jquery forum readers,

So, is there anything wrong with the script? It still doesn't work
when email field is empty; fine with both validating the field when
there is input. onblur=alert($(#field).valid()) gives me 0 when
empty.

  $(document).ready(function(){
$(#myform).validate({
  rules: {
field: {
  email: true
}
  }
});
  });


form id=myform
  label for=fieldRequired, email: /label
  input class=left id=field name=field onblur=alert($
(#field).valid()) /
  br/

  input type=submit value=Validate! /
/form



On Apr 12, 8:33 pm, NobitaNobi79 frankcheun...@gmail.com wrote:
 It still doesn't validate when the field is empty. Yes, I removed  
 required: true,  in

 $(#myform).validate({
   rules: {
     field: {
       required: true,
       email: true
     }
   }

 });

 The code is exactly the same just without the required: true, line as
 belows.
 And if I modified the input id=field name=field / to  input
 class=left id=field name=field onblur=alert($(#field).valid
 ()) / It alerts 0 when it's empty, 0 when it's invalid email, and 1
 when it's valid email address. I'm expecting 1 when field is empty.

 !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN
                     http://www.w3.org/TR/html4/loose.dtd;
 html
 head
   script src=http://code.jquery.com/jquery-latest.js;/script
   script type=text/javascript src=http://dev.jquery.com/view/trunk/
 plugins/validate/lib/jquery.delegate.js/script
 script type=text/javascript src=http://dev.jquery.com/view/trunk/
 plugins/validate/jquery.validate.js/script
 script type=text/javascript
 jQuery.validator.setDefaults({
         debug: true,
         success: valid});;

 /script

   script
   $(document).ready(function(){
     $(#myform).validate({
   rules: {
     field: {
       email: true
     }
   }});

   });
   /script
   style#field { margin-left: .5em; float: left; }
         #field, label { float: left; font-family: Arial, Helvetica, sans-
 serif; font-size: small; }
         br { clear: both; }
         input { border: 1px solid black; margin-bottom: .5em;  }
         input.error { border: 1px solid red; }
         label.error {
                 background: 
 url('http://dev.jquery.com/view/trunk/plugins/validate/
 demo/images/unchecked.gif') no-repeat;
                 padding-left: 16px;
                 margin-left: .3em;
         }
         label.valid {
                 background: 
 url('http://dev.jquery.com/view/trunk/plugins/validate/
 demo/images/checked.gif') no-repeat;
                 display: block;
                 width: 16px;
                 height: 16px;
         }
 /style
 /head
 body

 form id=myform
   label for=fieldRequired, email: /label
   input class=left id=field name=field /
   br/
   input type=submit value=Validate! /
 /form

 /body
 /html

 On Apr 12, 3:36 am, Jörn Zaefferer joern.zaeffe...@googlemail.com
 wrote:

  Just remove the required-rule. All other methods include a check to
  make a field optional when empty.

  Jörn

  On Sat, Apr 11, 2009 at 7:16 PM, NobitaNobi79 frankcheun...@gmail.com 
  wrote:

   Hi, I am new to jQuery. I follow the example on
  http://docs.jquery.com/Plugins/Validation/Methods/emailtoadd rules
   to a form validator. When I modified the rules to email: true
   (required: false), the script seems to stall there, no error message
   nor a check. Can someone tell me if I am doing anything wrong here?
   What I want is to let the validation pass if the optional fields are
   valid when they are filled or they are left out empty.

   I can, of course add an extra script like...
   if (($(#field).val() == ) || $(#field).valid()) {
                          optionalValid = true;
                  }
   But it seems very redundant considering the rules: { field: {email:
   true, required: false}}, with or without the default required: false
   option.

   Thanks


[jQuery] Re: jQuery sessions (persisting data across pages)

2009-04-15 Thread Eric Garside

Depending on the user's browser version, you could use some of the new
client-side storage. I've got a plugin called jStore which was
designed to do just this. Maybe it'll get you where you're going?

http://eric.garside.name/docs.html?p=jstore

On Apr 15, 3:10 pm, gibble gib...@gmail.com wrote:
 That's what I figured, I think I'm going to work out a generic json/xml data
 store web service and write a jQuery plugin to access it.



 James-279 wrote:

  There really is no such thing, since each HTTP request is generally
  stateless without any relations between each call. Without using
  cookies and through the URL (GET method), the other only common way is
  through the POST method. That would mean every page change requires
  some kind of form submission with POST data, which is very hackish and
  not recommended.

  This all depends on what your application is doing. The recommended
  method is to create a session id for the user, use cookies to store
  that id if available, and if not, pass that id along the url.

  I think I've read of another hackish method of being able to set a
  window name via the DOM to pass info, but I don't have any specifics
  on it and whether it works on all browsers or not.

  On Apr 15, 5:01 am, gibble gib...@gmail.com wrote:
  Personally, I find the .data() function in jQuery very useful. I can keep
  my
  html clean, and just attach data to the elements.

  What I'm finding myself needing though, is a way to persist some data
  client
  side across pages.

  Unfortunately, it wasn't as simple as $(window).data('key', 'value')

  Aside from cookies and appending to the url, is there a way to accomplish
  this client side?

  I couldn't find a plugin while searching yesterday that would accomplish
  this, and was hoping someone here had an idea.

  Thanks
  -c
  --
  View this message in
  context:http://www.nabble.com/jQuery-sessions-%28persisting-data-across-pages...
  Sent from the jQuery General Discussion mailing list archive at
  Nabble.com.

 --
 View this message in 
 context:http://www.nabble.com/jQuery-sessions-%28persisting-data-across-pages...
 Sent from the jQuery General Discussion mailing list archive at Nabble.com.


[jQuery] Plugin does not bind to jQuery object

2009-04-15 Thread Thomas Allen

These two pages do the exact same thing: Apply some basic validation
rules to a form. The only difference is that the first one includes
the scripts in body, not head.

1. http://www.asce.org/freemembership/
2. 
http://content.asce.org/conferences/texasstudentdays/company_registration.html

The second one works, and the first doesn't. For some reason, the
first site doesn't bind the validate method to jQuery.

$.fn.validate()

throws an exception in the console.

What's going on, and how can I fix this problem? The file itself is
definitely being loaded.

Thanks,
Thomas


[jQuery] selecting li - beginner learning jquery

2009-04-15 Thread soni2926

Hi,
I'm trying to learn Jquery (reading Manning Jquery in Action)
in the book there is this sample:

ul class=myList
li
a href=http://jquery.com;jQuery supports/a
ul
li
a href=css1CSS1/a
/li
li
a href=css2CSS2/a
/li
li
a href=css3CSS3/a
/li
li
Basic XPath
/li
/ul
/li
li
jQuery also supports
ul
li
Custom selectors
/li
li
Form selectors
/li
/ul
/li
/ul

how would i be able to select just the li that has the JQuery also
Supports in it? i got this to grab it:
ul.myList li:eq(5)
just wondering if there is another way?

thanks.


[jQuery] Re: Plugin does not bind to jQuery object

2009-04-15 Thread Eric Garside

It's the order of your includes. In the first page, you're including
the validation plugin before you're including jQuery. The result is
that, when validation attempts to enter itself into the jQuery
namespace, jQuery is undefined, so it just dies within it's
enclosure.

On Apr 15, 4:30 pm, Thomas Allen thomasmal...@gmail.com wrote:
 These two pages do the exact same thing: Apply some basic validation
 rules to a form. The only difference is that the first one includes
 the scripts in body, not head.

 1.http://www.asce.org/freemembership/
 2.http://content.asce.org/conferences/texasstudentdays/company_registra...

 The second one works, and the first doesn't. For some reason, the
 first site doesn't bind the validate method to jQuery.

 $.fn.validate()

 throws an exception in the console.

 What's going on, and how can I fix this problem? The file itself is
 definitely being loaded.

 Thanks,
 Thomas


[jQuery] Re: selecting li - beginner learning jquery

2009-04-15 Thread Karl Swedberg

On Apr 15, 2009, at 4:31 PM, soni2926 wrote:



Hi,
I'm trying to learn Jquery (reading Manning Jquery in Action)
in the book there is this sample:

ul class=myList
li
a href=http://jquery.com;jQuery supports/a
ul
li
a href=css1CSS1/a
/li
li
a href=css2CSS2/a
/li
li
a href=css3CSS3/a
/li
li
Basic XPath
/li
/ul
/li
li
jQuery also supports
ul
li
Custom selectors
/li
li
Form selectors
/li
/ul
/li
/ul

how would i be able to select just the li that has the JQuery also
Supports in it? i got this to grab it:
ul.myList li:eq(5)
just wondering if there is another way?

thanks.



There are many other ways. Here are a few:

$('.myList  li:last')

$('.myList').children(':last')

$('.myList  li:eq(1)')

$('.myList li:has(li):eq(1)')

$('li:contains(jQuery also supports)')

$('.myList li:last').parents('li')

$('.myList li:last').parent().parent()

It really depends on what you're looking for.


--Karl


Karl Swedberg
www.englishrules.com
www.learningjquery.com



[jQuery] Re: Plugin does not bind to jQuery object

2009-04-15 Thread Thomas Allen

No, that's not it. The scripts are ordered:

script src=/lib/javascript/jquery-1.3.2.js type=text/javascript/
script
script src=/lib/javascript/jquery.validate.min.js type=text/
javascript/script

Which is why only one exception is thrown. If I flip the order of
those two, two exceptions are thrown, one for the missing jQuery
object, and another for the validate method.

Ignore the reference to validate.js in the head, that's not being
used here.

Thomas

On Apr 15, 4:39 pm, Eric Garside gars...@gmail.com wrote:
 It's the order of your includes. In the first page, you're including
 the validation plugin before you're including jQuery. The result is
 that, when validation attempts to enter itself into the jQuery
 namespace, jQuery is undefined, so it just dies within it's
 enclosure.

 On Apr 15, 4:30 pm, Thomas Allen thomasmal...@gmail.com wrote:

  These two pages do the exact same thing: Apply some basic validation
  rules to a form. The only difference is that the first one includes
  the scripts in body, not head.

  1.http://www.asce.org/freemembership/
  2.http://content.asce.org/conferences/texasstudentdays/company_registra...

  The second one works, and the first doesn't. For some reason, the
  first site doesn't bind the validate method to jQuery.

  $.fn.validate()

  throws an exception in the console.

  What's going on, and how can I fix this problem? The file itself is
  definitely being loaded.

  Thanks,
  Thomas




[jQuery] Re: Ajax request -- passing additional paramters to success method

2009-04-15 Thread Nic Hubbard

I am interested in this as well.  How could I send a string to the
success GotNewData function?

On Feb 26, 9:50 am, P Burrows pburr...@gmail.com wrote:
 Is anyone aware of a way to pass some additional context information to the
 success function of an ajax request?
 For instance, here is my code which works fine:

 $.ajax({
         type: GET,
         dataType: json,
         url: tUrl,
         success: GotNewData,
         error: GetDataError,
         complete: AjaxRequestComplete
     });

 To the GotNewData function, I would also like to pass some other
 information. The url would be nice, but some other context info would be
 fine too. A unique ID. Some random string. ...anything.

 Any ideas?

 --
 Patrick Burrowshttp://www.CleverHumans.com


[jQuery] Re: Help Me Optimize My First JQuery Script (Extinguish The Early Flames of Bad Practices)

2009-04-15 Thread Karl Swedberg


On Apr 15, 2009, at 6:50 AM, MorningZ wrote:



I don't know if this falls under bad practice or not, but time and
time again here on the group, people post code like yours where they
use an a tag to do something that has nothing to do with an a tag

If you don't want to go somewhere, why not just use a span or a
div and hang the click event on that?  then propagation is a non-
issue



One reason to use a link rather than a span or a div is for (keyboard)  
accessibility. Links can have focus and can be tabbed to and triggered  
by pressing enter/return.


--Karl


Karl Swedberg
www.englishrules.com
www.learningjquery.com




[jQuery] Re: Plugin does not bind to jQuery object

2009-04-15 Thread mkmanning

You also have a reference to jQuery 1.2.6 as well as 1.3.2; near the
bottom of the page:

script type=text/javascript src=/lib/javascript/jquery-1.2.6.js/
script


On Apr 15, 1:44 pm, Thomas Allen thomasmal...@gmail.com wrote:
 No, that's not it. The scripts are ordered:

 script src=/lib/javascript/jquery-1.3.2.js type=text/javascript/
 script
 script src=/lib/javascript/jquery.validate.min.js type=text/
 javascript/script

 Which is why only one exception is thrown. If I flip the order of
 those two, two exceptions are thrown, one for the missing jQuery
 object, and another for the validate method.

 Ignore the reference to validate.js in the head, that's not being
 used here.

 Thomas

 On Apr 15, 4:39 pm, Eric Garside gars...@gmail.com wrote:

  It's the order of your includes. In the first page, you're including
  the validation plugin before you're including jQuery. The result is
  that, when validation attempts to enter itself into the jQuery
  namespace, jQuery is undefined, so it just dies within it's
  enclosure.

  On Apr 15, 4:30 pm, Thomas Allen thomasmal...@gmail.com wrote:

   These two pages do the exact same thing: Apply some basic validation
   rules to a form. The only difference is that the first one includes
   the scripts in body, not head.

   1.http://www.asce.org/freemembership/
   2.http://content.asce.org/conferences/texasstudentdays/company_registra...

   The second one works, and the first doesn't. For some reason, the
   first site doesn't bind the validate method to jQuery.

   $.fn.validate()

   throws an exception in the console.

   What's going on, and how can I fix this problem? The file itself is
   definitely being loaded.

   Thanks,
   Thomas


[jQuery] Re: Plugin does not bind to jQuery object

2009-04-15 Thread Eric Garside

Upon further inspection, I'm not quite sure what to make of your page.
Firebug's Net console reported the following includes in the following
order:

1. jquery-1.3.2.js
2. jquery.validate.min.js
3. validate-common.js
4. asce03.js
5. validate.js
6. jquery-1.2.6.js
7. jquery-dropdown-menus.js

So, for one reason or another, you're including 2 different versions
of jQuery on the same page. I'm not sure if that's causing the issue,
but I can't imagine it's useful or efficient. I'd check into that as a
first-line of defense. Removing the older jQuery version might fix it?

On Apr 15, 4:44 pm, Thomas Allen thomasmal...@gmail.com wrote:
 No, that's not it. The scripts are ordered:

 script src=/lib/javascript/jquery-1.3.2.js type=text/javascript/
 script
 script src=/lib/javascript/jquery.validate.min.js type=text/
 javascript/script

 Which is why only one exception is thrown. If I flip the order of
 those two, two exceptions are thrown, one for the missing jQuery
 object, and another for the validate method.

 Ignore the reference to validate.js in the head, that's not being
 used here.

 Thomas

 On Apr 15, 4:39 pm, Eric Garside gars...@gmail.com wrote:

  It's the order of your includes. In the first page, you're including
  the validation plugin before you're including jQuery. The result is
  that, when validation attempts to enter itself into the jQuery
  namespace, jQuery is undefined, so it just dies within it's
  enclosure.

  On Apr 15, 4:30 pm, Thomas Allen thomasmal...@gmail.com wrote:

   These two pages do the exact same thing: Apply some basic validation
   rules to a form. The only difference is that the first one includes
   the scripts in body, not head.

   1.http://www.asce.org/freemembership/
   2.http://content.asce.org/conferences/texasstudentdays/company_registra...

   The second one works, and the first doesn't. For some reason, the
   first site doesn't bind the validate method to jQuery.

   $.fn.validate()

   throws an exception in the console.

   What's going on, and how can I fix this problem? The file itself is
   definitely being loaded.

   Thanks,
   Thomas


[jQuery] Re: Ajax request -- passing additional paramters to success method

2009-04-15 Thread Eric Garside

$.ajax({
type: GET,
dataType: json,
url: tUrl,
success: function(data){ GotNewData(data, 'custom string'); },
error: GetDataError,
complete: AjaxRequestComplete
});

On Apr 15, 4:53 pm, Nic Hubbard nnhubb...@gmail.com wrote:
 I am interested in this as well.  How could I send a string to the
 success GotNewData function?

 On Feb 26, 9:50 am, P Burrows pburr...@gmail.com wrote:

  Is anyone aware of a way to pass some additional context information to the
  success function of an ajax request?
  For instance, here is my code which works fine:

  $.ajax({
          type: GET,
          dataType: json,
          url: tUrl,
          success: GotNewData,
          error: GetDataError,
          complete: AjaxRequestComplete
      });

  To the GotNewData function, I would also like to pass some other
  information. The url would be nice, but some other context info would be
  fine too. A unique ID. Some random string. ...anything.

  Any ideas?

  --
  Patrick Burrowshttp://www.CleverHumans.com


[jQuery] Has anyone used these jQuery books?

2009-04-15 Thread Calvin

Hi everybody,

Has anyone here read/ used these books:

jQuery UI 1.6 by Dan Wellman

jQuery Reference Guide by Chaffer  Swedberg

I am wondering which one is better for learning how to make front-end
interfaces for applications.


p.s- Learning jQuery 1.3 is a awesome book!


  1   2   >