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.

Jquery body replacement when flash is messing around -


hello stackoverflow friends,

i'm trying replace contents in website using following code:

var newbody = $('body').html().replace(oldvalue, newvalue); $('body').html(newbody); 

the problem have flash embedded on dom , whenever try replacement browser crashes. should thing prepend or append in right place should better method achieve this, elements i'm trying locate , replace html comments , append prepend methods not seem work kind of nodes have treated literal strings.

any light on this?

thanks in advance!

you using replace on body. may accidentally destroying of document elements or element attributes. example:

<html> <head> <script type="text/javascript" src="http://code.jquery.com/jquery-1.5.1.min.js"></script> <script> jquery(document).ready(function(){     var newbody = jquery("body").html().replace("div", "input");     jquery("body").html(newbody); }); </script> </head> <body> <div>div content</div> </body> </html> 

a better approach add class text wish change , use jquery change text in elements class.

as comment traversal, need use dom types so:

    $(function() {         $("body").contents().filter(function(){             return this.nodetype == 8;         }).each(function(i, e){             alert(e.nodevalue);         });     }); 

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 -