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 - Using prototype in javascript -


i have defined couple of functions inside javascript work perfectly, when put inside prototype doesn't seem work.

wall.html:

<script type="text/javascript" src="jquery/jquery-1.4.4.js"> </script> <script type="text/javascript" src="src/commentmanager.js"> </script> <script type="text/javascript" src="src/reply.js"> </script> <script type="text/javascript" src="src/comment.js"> </script> <script type="text/javascript">     $(document).ready(function(){         commentmanager();         $("form#newmessage").submit(function(){             var message = $("input#newmessagetxt").val();             var newcomment = new comment(message);         });     }); </script> </head>  <body>     <div class="message">         <form id="newmessage"&gt;>             <input type="text" id="newmessagetxt" height="200px" value="write message" onfocus="if(this.value==this.defaultvalue) this.value='';" onblur="if(this.value=='') this.value=this.defaultvalue;" />             <input type="submit" value="submit" ></button>         </form>     </div> </body> 

but weird part when run debugging tool in googlechrome, $("form#newmessage").submit doesn't call @ all. comment(message) never created (which have set prototype functions)

comment.js:

function comment(message){     var self = this;     var message = message;      var comment = document.createelement("li");     comment.id = "comment";     comment.textcontent = message;     //empty reply field     var replyfield = document.createelement("ul");     replyfield.id = "replyfield";     //create appropriate buttons     createbuttons(comment);     //append replyfield     comment.appendchild(replyfield);     //insert wall     addcomment(comment);     //effect after insertion     effect(comment);     $(comment).mouseleave(function() {mouseout(comment);});     $(comment).mouseenter(function() {mouseover(comment);});     return comment; } comment.prototype={     deletecomment : function (comment){         $(comment).fadeout();         settimeout(function() {comment.parentnode.removechild(comment);},500);     }, //there more methods here } 

commentmanager.js:

function commentmanager(){     var owner = null;       var wall = document.createelement("ul");     wall.id = "wall";      document.body.appendchild(wall);     return wall; }  function addcomment(comment){     var wall = document.getelementbyid("wall");     wall.appendchild(comment); } 

where createbuttons defined? (in comment.js)?

also, you titled last file commentmanager.js, wall.html has commentmanager.js (notice capital m in wall.js). i'm assuming that's typo here in question, make sure filenames on server match html script tags.


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 -