Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

text - jQuery contents() causing problems in IE -


i'm using contents() function in jquery in order obtain text within li can't target directly span or other selector.

the code i've written follows:

$('#tierarray_' + tierid).contents().each(function(i, node) {   if (node.nodename == "#text") {     node.textcontent = name;   } }); 

this works fine in firefox , changes target text set in 'name'. in ie following errors:

"object doesn't support property or method"

this seems relate line "node.textcontent = name" when comment out error disappears.

in nutshell i'm trying replace text newly created text, html markup follows:

<li class="ui-state-default" id="tierarray_105">   <span style="display: block;" id="revoke_105">     <a class="tierstatus" title="revoke" href="#">revoke</a> |      <a class="tieredit" id="edit_tier_105" title="bla 3aaa11" href="#">edit</a>   </span>   <span style="display: none;" id="active_105">     <a class="tierstatus" title="activate" href="#">activate</a> |      <a class="tieredit" id="edit_tier_105" title="bla 3aaa11" href="#">edit</a>   </span>   bla 3aaa11 </li> 

so text after last span (bla 4aaa11) need replaced newly generated text.

internet explorer not support textcontent property.

however, since want replace contents of text node, should able use nodevalue instead:

$("#tierarray_" + tierid).contents().each(function(i, node) {     if (node.nodename == "#text") {         node.nodevalue = name;     } }); 

Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -