[jQuery] Re: value visible in ajax response, but not used in output
On Nov 25, 11:12 am, dcrunche henjohoek...@gmail.com wrote: When I check the response given in the console I see the output I want, but that is not showing on the page. Here's the JS I use:http://pastie.org/714683 I don't think you are actually using the resulting data anywhere in that code, except in the outermost success function. For each of the (three levels of!) nested .ajax calls, you ignore the returning data parameter. Perhaps you just need to copy this line to each of them: $('#productWizard fieldset').html(data); Cheers, -- Scott
[jQuery] Re: value visible in ajax response, but not used in output
Hi Scott, thanks, that was what did the trick. I didn't need this without using the actual vars - then it worked well. But it makes sense I need to actually return the new result. D. On Nov 25, 5:57 pm, Scott Sauyet scott.sau...@gmail.com wrote: On Nov 25, 11:12 am, dcrunche henjohoek...@gmail.com wrote: When I check the response given in the console I see the output I want, but that is not showing on the page. Here's the JS I use:http://pastie.org/714683 I don't think you are actually using the resulting data anywhere in that code, except in the outermost success function. For each of the (three levels of!) nested .ajax calls, you ignore the returning data parameter. Perhaps you just need to copy this line to each of them: $('#productWizard fieldset').html(data); Cheers, -- Scott
[jQuery] Re: Value adding to drop down
i have values in data same like you are using BSIT|MSIT|BSC| etc when i used alert(). to display data values then values are correct but when values appear in drop down they become |BSIT code is like this var programs=[]; alert(data); programs=data.split('|'); $('#p_course').length = 1; for(var i=0;iprograms.length-1;i++) { var objDropdown =$('#p_course').get(0); var objOption = new Option(programs[i],programs[i]);// adding option objDropdown.options[objDropdown.length] = objOption; } On Jul 18, 3:48 pm, Jules jwira...@gmail.com wrote: I tested your code with the following data var data = 'program1|program2|program3|'; and the drop down combo box displays program1 program2 program3 correctly. Again could you post the value of your data? On Jul 18, 2:07 pm, naz s.na...@gmail.com wrote: i m using internet explorar.and data value is SE,DLD etc i m getting these values from db. On Jul 16, 11:14 am, Jules jwira...@gmail.com wrote: The code looks fine to me. Could you post the data value? What is the browser you are using? On Jul 16, 2:58 pm, naz s.na...@gmail.com wrote: hi i m adding some values to drop down by usind j query by this code var programs=[]; programs=data.split('|'); $('#p_course').length = 1; for(var i=0;iprograms.length-1;i++) { var objDropdown =$('#p_course').get(0); var objOption = new Option(programs[i],programs[i]); objDropdown.options[objDropdown.length] = objOption; } but when vales appear in drop down first value look like this |BSIT any body have any idea why it look like this- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text -
[jQuery] Re: Value adding to drop down
i have values in data like BSIT|MSIT|BSC| etc when i used alert(). to display data values then values are correct but when values appear in drop down they become |BSIT code is like this var programs=[]; alert(data); programs=data.split('|'); $('#p_course').length = 1; for(var i=0;iprograms.length-1;i++) { var objDropdown =$('#p_course').get(0); var objOption = new Option(programs[i],programs[i]);// adding option objDropdown.options[objDropdown.length] = objOption; } actually i m storing these values in data from db may be thats why there is a problem bcs when i use static value then it appear correctly. If u can understand whts gng on plz tell me thnx alot On Jul 18, 12:55 pm, Theodore Ni zyl...@gmail.com wrote: Please post again your current jQuery code including the separator you are using, as well as what is inside the data variable in full. That way, we can understand exactly what's going on; right now, I'm still confused. Teddy On Sat, Jul 18, 2009 at 12:07 AM, naz s.na...@gmail.com wrote: i have changed '|' seperator still it is not working.:( On Jul 16, 10:31 am, 刘永杰 liuyongjie...@gmail.com wrote: change split character,not use '|'. 2009/7/16 naz s.na...@gmail.com hi i m adding some values to drop down by usind j query by this code var programs=[]; programs=data.split('|'); $('#p_course').length = 1; for(var i=0;iprograms.length-1;i++) { var objDropdown =$('#p_course').get(0); var objOption = new Option(programs[i],programs[i]); objDropdown.options[objDropdown.length] = objOption; } but when vales appear in drop down first value look like this |BSIT any body have any idea why it look like this- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text -
[jQuery] Re: Value adding to drop down
OK that means the values causing the problem. Are your strings stored in the database as double byte characters? Try to view your page in Firefox and use firebug to display the value instead of using alert (). On Jul 20, 2:08 pm, naz s.na...@gmail.com wrote: i have values in data like BSIT|MSIT|BSC| etc when i used alert(). to display data values then values are correct but when values appear in drop down they become |BSIT code is like this var programs=[]; alert(data); programs=data.split('|'); $('#p_course').length = 1; for(var i=0;iprograms.length-1;i++) { var objDropdown =$('#p_course').get(0); var objOption = new Option(programs[i],programs[i]);// adding option objDropdown.options[objDropdown.length] = objOption; } actually i m storing these values in data from db may be thats why there is a problem bcs when i use static value then it appear correctly. If u can understand whts gng on plz tell me thnx alot On Jul 18, 12:55 pm, Theodore Ni zyl...@gmail.com wrote: Please post again your current jQuery code including the separator you are using, as well as what is inside the data variable in full. That way, we can understand exactly what's going on; right now, I'm still confused. Teddy On Sat, Jul 18, 2009 at 12:07 AM, naz s.na...@gmail.com wrote: i have changed '|' seperator still it is not working.:( On Jul 16, 10:31 am, 刘永杰 liuyongjie...@gmail.com wrote: change split character,not use '|'. 2009/7/16 naz s.na...@gmail.com hi i m adding some values to drop down by usind j query by this code var programs=[]; programs=data.split('|'); $('#p_course').length = 1; for(var i=0;iprograms.length-1;i++) { var objDropdown =$('#p_course').get(0); var objOption = new Option(programs[i],programs[i]); objDropdown.options[objDropdown.length] = objOption; } but when vales appear in drop down first value look like this |BSIT any body have any idea why it look like this- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text -
[jQuery] Re: Value adding to drop down
Please post again your current jQuery code including the separator you are using, as well as what is inside the data variable in full. That way, we can understand exactly what's going on; right now, I'm still confused. Teddy On Sat, Jul 18, 2009 at 12:07 AM, naz s.na...@gmail.com wrote: i have changed '|' seperator still it is not working.:( On Jul 16, 10:31 am, 刘永杰 liuyongjie...@gmail.com wrote: change split character,not use '|'. 2009/7/16 naz s.na...@gmail.com hi i m adding some values to drop down by usind j query by this code var programs=[]; programs=data.split('|'); $('#p_course').length = 1; for(var i=0;iprograms.length-1;i++) { var objDropdown =$('#p_course').get(0); var objOption = new Option(programs[i],programs[i]); objDropdown.options[objDropdown.length] = objOption; } but when vales appear in drop down first value look like this |BSIT any body have any idea why it look like this- Hide quoted text - - Show quoted text -
[jQuery] Re: Value adding to drop down
I tested your code with the following data var data = 'program1|program2|program3|'; and the drop down combo box displays program1 program2 program3 correctly. Again could you post the value of your data? On Jul 18, 2:07 pm, naz s.na...@gmail.com wrote: i m using internet explorar.and data value is SE,DLD etc i m getting these values from db. On Jul 16, 11:14 am, Jules jwira...@gmail.com wrote: The code looks fine to me. Could you post the data value? What is the browser you are using? On Jul 16, 2:58 pm, naz s.na...@gmail.com wrote: hi i m adding some values to drop down by usind j query by this code var programs=[]; programs=data.split('|'); $('#p_course').length = 1; for(var i=0;iprograms.length-1;i++) { var objDropdown =$('#p_course').get(0); var objOption = new Option(programs[i],programs[i]); objDropdown.options[objDropdown.length] = objOption; } but when vales appear in drop down first value look like this |BSIT any body have any idea why it look like this- Hide quoted text - - Show quoted text -
[jQuery] Re: Value adding to drop down
i m using internet explorar.and data value is SE,DLD etc i m getting these values from db. On Jul 16, 11:14 am, Jules jwira...@gmail.com wrote: The code looks fine to me. Could you post the data value? What is the browser you are using? On Jul 16, 2:58 pm, naz s.na...@gmail.com wrote: hi i m adding some values to drop down by usind j query by this code var programs=[]; programs=data.split('|'); $('#p_course').length = 1; for(var i=0;iprograms.length-1;i++) { var objDropdown =$('#p_course').get(0); var objOption = new Option(programs[i],programs[i]); objDropdown.options[objDropdown.length] = objOption; } but when vales appear in drop down first value look like this |BSIT any body have any idea why it look like this- Hide quoted text - - Show quoted text -
[jQuery] Re: Value adding to drop down
i have changed '|' seperator still it is not working.:( On Jul 16, 10:31 am, 刘永杰 liuyongjie...@gmail.com wrote: change split character,not use '|'. 2009/7/16 naz s.na...@gmail.com hi i m adding some values to drop down by usind j query by this code var programs=[]; programs=data.split('|'); $('#p_course').length = 1; for(var i=0;iprograms.length-1;i++) { var objDropdown =$('#p_course').get(0); var objOption = new Option(programs[i],programs[i]); objDropdown.options[objDropdown.length] = objOption; } but when vales appear in drop down first value look like this |BSIT any body have any idea why it look like this- Hide quoted text - - Show quoted text -
[jQuery] Re: Value adding to drop down
The code looks fine to me. Could you post the data value? What is the browser you are using? On Jul 16, 2:58 pm, naz s.na...@gmail.com wrote: hi i m adding some values to drop down by usind j query by this code var programs=[]; programs=data.split('|'); $('#p_course').length = 1; for(var i=0;iprograms.length-1;i++) { var objDropdown =$('#p_course').get(0); var objOption = new Option(programs[i],programs[i]); objDropdown.options[objDropdown.length] = objOption; } but when vales appear in drop down first value look like this |BSIT any body have any idea why it look like this
[jQuery] Re: Value adding to drop down
change split character,not use '|'. 2009/7/16 naz s.na...@gmail.com hi i m adding some values to drop down by usind j query by this code var programs=[]; programs=data.split('|'); $('#p_course').length = 1; for(var i=0;iprograms.length-1;i++) { var objDropdown =$('#p_course').get(0); var objOption = new Option(programs[i],programs[i]); objDropdown.options[objDropdown.length] = objOption; } but when vales appear in drop down first value look like this |BSIT any body have any idea why it look like this
[jQuery] Re: value of this after many enclosures!
Sorry I see that the comments don't line up well, thought I'd re-write the code such as to simplify reading the comments: // select all the cells with class mychkbox : $(td.mychkbox).each( // apply the mousedown event to each one of these : function(){ $(this).bind( mousedown, // (and here $(this) is correctly referring to those cells // because the mousedown event is triggering correctly on all of them) function(){ if (allchecked.attr(checked)==false){ // only if allchecked is NOT checked, do such n such. // Now what I need to do here is get the checked state of the // checkbox which is a child of the table cell. // If I do: var itsme = this; // this seems to get the table cell, in fact: alert(itsme); // gives me [object HtmlTableCellElement] // But I can't seem to access any of the attributes of the table cell // let alone the children. alert(itsme.name); // gives undefined // or: var itsyou = itsme.attr(name); alert(itsyou); // gives no results, it actually stops everything from working. // or: var itsyou = eccomi.find(input:checkbox); alert(eccoti); // gives no results, it actually stops everything from working } }); }); Hmmm... I'm stumped, I can't access the child checkbox, much less the child checkboxes checked value. Anyone have any ideas?
[jQuery] Re: value of this after many enclosures!
Lwangaman wrote: alert(itsme.name); // gives undefined because a tablecell usually doesn't have a name attribute associated with it. Remember that your itsme variable is a reference to a DOM element (not a jQuery element). Which explains var itsyou = itsme.attr(name); alert(itsyou); // gives no results, it actually stops everything from working. You would need itsyou = $(itsme).attr(name); But even then, if itsme is a tablecell, the name attribute likely doesn't exist. Maybe try id instead? var itsyou = eccomi.find(input:checkbox); alert(eccoti); // gives no results, it actually stops everything from working if eccomi is a DOM element, then this would stop and likely throw an error ('find' not a property or object)... Try it as $(eccomi).find(input:checkbox); The core issue that I can see is understanding the difference between a DOM object/element and a jQuery object. They are not the same, though they are often used in a very similar manner. HTH. Shawn
[jQuery] Re: value of this after many enclosures!
Thanks a lot! That got me going again! (eccomi was supposed to be itsme, eccoti was supposed to be itsyou, I overlooked that transliteration that I was doing from italian!) On 9 Apr, 03:48, Shawn sgro...@open2space.com wrote: Lwangaman wrote: alert(itsme.name); // gives undefined because a tablecell usually doesn't have a name attribute associated with it. Remember that your itsme variable is a reference to a DOM element (not a jQuery element). Which explains var itsyou = itsme.attr(name); alert(itsyou); // gives no results, it actually stops everything from working. You would need itsyou = $(itsme).attr(name); But even then, if itsme is a tablecell, the name attribute likely doesn't exist. Maybe try id instead? var itsyou = eccomi.find(input:checkbox); alert(eccoti); // gives no results, it actually stops everything from working if eccomi is a DOM element, then this would stop and likely throw an error ('find' not a property or object)... Try it as $(eccomi).find(input:checkbox); The core issue that I can see is understanding the difference between a DOM object/element and a jQuery object. They are not the same, though they are often used in a very similar manner. HTH. Shawn
[jQuery] Re: Value of the property not valid. jquery.js, Line 12 Character 12721
Ok I reasoned out that the interpreter rendered the background color of the first cell and stopped there, so I went to see what the next css property was supposed to be and it was the border-color. All I did was capitalize lightblue to LightBlue and lo and behold, I now no longer get that error message in IE! On 1 Apr, 13:07, Lwangaman donjohn.f...@gmail.com wrote: BTW the error message, translated into english is: Value of the property not valid. jquery.js, Line 12 Character 12721 The part of code that is put into evidence is some jquery function: if(L){J[G]=K}return J[G]},trim:function(E){return(E||).replace(/^\s+| \s+$/g,)},makeArray:function(G){var E=[];if(G!=null){var F=G.length; J[G]=K is evidenced with the yellow highlighter. What error could this be? On 1 Apr, 12:58, Lwangaman donjohn.f...@gmail.com wrote: Can anyone help in deciphering this error message? I only get it in Internet Explorer, it doesn't show up either in Firefox or in Chrome. Here is the page that it occurs on:http://johnrdorazio.altervista.org/SitoFlatnukePersonale/?lang=enmod= The block that uses jquery and that is provoking the error is the one in the right column of the page News Headlines. I use jquery to control the css and the mouseover (hover to be precise, talking jquery) events in the scrollbar on the right, which controls the direction and the speed of the marquee. In IE the scrollbar (made up of 7 stacked cells in a nested table) doesn't even finish rendering. So I suppose that the conflict could be in there somewhere. Here is my jquery code: $(document).ready(function(){ // your code here $(td#upfastestbutton).css({cursor:default, height:14%, background-color:cyan, text-align:center, border-color: lightblue, border-style:inset inset none inset, border- width:2px 2px 0px 2px}); $(td.midbuttons).css({cursor:default, height:14%, background-color:cyan, text-align:center, border-color: lightblue, border-style:none inset none inset, border- width:0px 2px 0px 2px}); $(td#downfastestbutton).css({cursor:default, height:14%, background-color:cyan, text-align:center, border-color: lightblue, border-style:none inset inset inset, border- width:0px 2px 2px 2px}); $(td#upfastestbutton).hover( function(){ $(marquee#MENU).trigger(start); $(marquee#MENU).attr({ direction: down, scrollamount: 4}); }, function(){ $(marquee#MENU).attr({ direction: down, scrollamount: 4}); } ) $(td#upfasterbutton).hover( function(){ $(marquee#MENU).trigger(start); $(marquee#MENU).attr({ direction: down, scrollamount: 2}); }, function(){ $(marquee#MENU).attr({ direction: down, scrollamount: 2}); } ) $(td#upfastbutton).hover( function(){ $(marquee#MENU).trigger(start); $(marquee#MENU).attr({ direction: down, scrollamount: 1}); }, function(){ $(marquee#MENU).attr({ direction: down, scrollamount: 1}); } ) $(td#stopbutton).hover( function(){ $(marquee#MENU).trigger(stop); }, function(){ $(marquee#MENU).trigger(stop); } ) $(td#downfastbutton).hover( function(){ $(marquee#MENU).trigger(start); $(#MENU).attr({ direction: up, scrollamount: 1}); }, function(){ $(#MENU).attr({ direction: up, scrollAmount: 1}); } ) $(td#downfasterbutton).hover( function(){ $(marquee#MENU).trigger(start); $(#MENU).attr({ direction: up, scrollAmount: 2}); }, function(){ $(#MENU).attr({ direction: up, scrollAmount: 2}); } ) $(td#downfastestbutton).hover( function(){ $(marquee#MENU).trigger(start); $(#MENU).attr({ direction: up, scrollAmount: 4}); }, function(){ $(#MENU).attr({ direction: up, scrollAmount: 4}); } ) // your code ends here });
[jQuery] Re: value attribute update problem
Otomar, Little problem with value attribute I have some input element where I try to update attributes. Input element before jQuery code: input type=text name=test value= testparam= maxlength=10 size=10 / jQuery code: $(input[name='test']).attr(value,test123); $(input[name='test']).attr(size,15); $(input[name='test']).attr(testparam,test123); But it seems to me that jQuery update in DOM tree only testparam and size attribute because if I look in Firebug then I see following row: input type=text size=15 maxlength=10 testparam=test123 value= name=test/ Value is not updated can somebody tell why? First, I'd recommend using this instead: $(input[name='test']).val(test123); The val() method is designed specifically for retrieving/updating the values of form fields. When you call the attr(value, test123) on the field, does the value show up on screen or does it not change in either Firebug or onscreen? -Dan
[jQuery] Re: value of a
@Juan $(a).html() is always returning text of first a, here tata @ziz alert($(this).text()); works, thanks. Why return false? -- Sharique On Oct 10, 2:30 pm, zizi [EMAIL PROTECTED] wrote: Try this way: $(a).click( function( ) { alert($(this).text()); return false; }); zizi On 10/10/07, Juan G. Hurtado [EMAIL PROTECTED] wrote: Try with $(a).html() El 10/10/2007, a las 8:57, Sharique escribió: What I want to is :When user click on a link it will show text inside the a tag. (ie. when user click in more it will show more in alert.) I have following code : - !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01//EN http://www.w3.org/ TR/html4/strict.dtd html head meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 / titlejq test/title script type=text/javascript src=js/jquery.js/script script type=text/javascript $(function() { $(a).click( function( ) { alert($(a).val()); // shows error }); }); /script /head body a href=#tata/a a href=#test/a a href=#more/a /body /html --- When I run this code it shows following error. TypeError: this[0].value has no properties at anonymous(void) (test/jq/js/jquery.js:335) at anonymous() (test/jq/alinks.htm:13) at anonymous(Object) (test/jq/js/jquery.js:1776) at anonymous() (test/jq/js/jquery.js:1620) -- Juan G. Hurtado [EMAIL PROTECTED]
[jQuery] Re: value of a
To stop the link from executing. -- David Duymelinck Sharique schreef: @Juan $(a).html() is always returning text of first a, here tata @ziz alert($(this).text()); works, thanks. Why return false? -- Sharique On Oct 10, 2:30 pm, zizi [EMAIL PROTECTED] wrote: Try this way: $(a).click( function( ) { alert($(this).text()); return false; }); zizi On 10/10/07, Juan G. Hurtado [EMAIL PROTECTED] wrote: Try with $(a).html() El 10/10/2007, a las 8:57, Sharique escribió: What I want to is :When user click on a link it will show text inside the a tag. (ie. when user click in more it will show more in alert.) I have following code : - !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01//EN http://www.w3.org/ TR/html4/strict.dtd html head meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 / titlejq test/title script type=text/javascript src=js/jquery.js/script script type=text/javascript $(function() { $(a).click( function( ) { alert($(a).val()); // shows error }); }); /script /head body a href=#tata/a a href=#test/a a href=#more/a /body /html --- When I run this code it shows following error. TypeError: this[0].value has no properties at anonymous(void) (test/jq/js/jquery.js:335) at anonymous() (test/jq/alinks.htm:13) at anonymous(Object) (test/jq/js/jquery.js:1776) at anonymous() (test/jq/js/jquery.js:1620) -- Juan G. Hurtado [EMAIL PROTECTED] -- David Duymelinck [EMAIL PROTECTED]
[jQuery] Re: value of a
without 'return false' href executed after alert On 10/11/07, Sharique [EMAIL PROTECTED] wrote: @ziz alert($(this).text()); works, thanks. Why return false? -- Sharique On Oct 10, 2:30 pm, zizi [EMAIL PROTECTED] wrote: Try this way: $(a).click( function( ) { alert($(this).text()); return false; }); zizi On 10/10/07, Juan G. Hurtado [EMAIL PROTECTED] wrote: Try with $(a).html() El 10/10/2007, a las 8:57, Sharique escribió: What I want to is :When user click on a link it will show text inside the a tag. (ie. when user click in more it will show more in alert.) I have following code : - !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01//EN http://www.w3.org/ TR/html4/strict.dtd html head meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 / titlejq test/title script type=text/javascript src=js/jquery.js/script script type=text/javascript $(function() { $(a).click( function( ) { alert($(a).val()); // shows error }); }); /script /head body a href=#tata/a a href=#test/a a href=#more/a /body /html --- When I run this code it shows following error. TypeError: this[0].value has no properties at anonymous(void) (test/jq/js/jquery.js:335) at anonymous() (test/jq/alinks.htm:13) at anonymous(Object) (test/jq/js/jquery.js:1776) at anonymous() (test/jq/js/jquery.js:1620) -- Juan G. Hurtado [EMAIL PROTECTED] -- ---{ zizi }---
[jQuery] Re: value of a
Try with $(a).html() El 10/10/2007, a las 8:57, Sharique escribió: What I want to is :When user click on a link it will show text inside the a tag. (ie. when user click in more it will show more in alert.) I have following code : - !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01//EN http://www.w3.org/ TR/html4/strict.dtd html head meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 / titlejq test/title script type=text/javascript src=js/jquery.js/script script type=text/javascript $(function() { $(a).click( function( ) { alert($(a).val()); // shows error }); }); /script /head body a href=#tata/a a href=#test/a a href=#more/a /body /html --- When I run this code it shows following error. TypeError: this[0].value has no properties at anonymous(void) (test/jq/js/jquery.js:335) at anonymous() (test/jq/alinks.htm:13) at anonymous(Object) (test/jq/js/jquery.js:1776) at anonymous() (test/jq/js/jquery.js:1620) -- Juan G. Hurtado [EMAIL PROTECTED]
[jQuery] Re: value of a
val is used for input fields, to get the text inside a tag you have to use html or text depending on what you are after. -- David Duymelinck Sharique schreef: What I want to is :When user click on a link it will show text inside the a tag. (ie. when user click in more it will show more in alert.) I have following code : - !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01//EN http://www.w3.org/ TR/html4/strict.dtd html head meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 / titlejq test/title script type=text/javascript src=js/jquery.js/script script type=text/javascript $(function() { $(a).click( function( ) { alert($(a).val()); // shows error }); }); /script /head body a href=#tata/a a href=#test/a a href=#more/a /body /html --- When I run this code it shows following error. TypeError: this[0].value has no properties at anonymous(void) (test/jq/js/jquery.js:335) at anonymous() (test/jq/alinks.htm:13) at anonymous(Object) (test/jq/js/jquery.js:1776) at anonymous() (test/jq/js/jquery.js:1620) -- David Duymelinck [EMAIL PROTECTED]
[jQuery] Re: value of a
Try this way: $(a).click( function( ) { alert($(this).text()); return false; }); zizi On 10/10/07, Juan G. Hurtado [EMAIL PROTECTED] wrote: Try with $(a).html() El 10/10/2007, a las 8:57, Sharique escribió: What I want to is :When user click on a link it will show text inside the a tag. (ie. when user click in more it will show more in alert.) I have following code : - !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01//EN http://www.w3.org/ TR/html4/strict.dtd html head meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 / titlejq test/title script type=text/javascript src=js/jquery.js/script script type=text/javascript $(function() { $(a).click( function( ) { alert($(a).val()); // shows error }); }); /script /head body a href=#tata/a a href=#test/a a href=#more/a /body /html --- When I run this code it shows following error. TypeError: this[0].value has no properties at anonymous(void) (test/jq/js/jquery.js:335) at anonymous() (test/jq/alinks.htm:13) at anonymous(Object) (test/jq/js/jquery.js:1776) at anonymous() (test/jq/js/jquery.js:1620) -- Juan G. Hurtado [EMAIL PROTECTED]
[jQuery] Re: .value= / .val()
Why i must use the .val() function? Because value is not a property on the jQuery object. It is a property on the DOM element. // use jQuery val method: $(#city).val($(city, xml).text()); // use DOM element value property: $(#city)[0].value = $(city, xml).text(); Mike
[jQuery] Re: .value= / .val()
thank you mike, for your answer...now i understand it. best wishes, Enrico