Wednesday, March 21, 2012

JQuery body append html

I wanted to append the html to body like below and the html control will be accessed in a JavaScript function.

$("body").append('<div id="vedioControl">VEDIO CONTROL</div >');

When I accessed the html control in a JavaScript function, I got an operation aborted error.
I have double checked the above statement, nothing is wrong.

Later I found that that, html will not be added to body unless the DOM is loaded.
To make sure the DOM is loaded, added the statement within the .ready function.

      $("body").append('<div id=" vedioControl "> VEDIO CONTROL</div>');

SharePoint/.Net Openings for Experience Professionals

We (Applied Information Sciences) have openings for SharePoint/.Net developers with 3+ years experience in the following technologies.

SharePoint – 2010/2007, Infopath Forms, Publishing..
.Net – ASP.Net, C#, WCF, MVC, Linq, Entity Framework.
.Net – ASP.Net, C#, Jquery, HTML/HTML5, CSS

Let me know if you are interested and need more details...