Web development small tips

Single quote in java script, may result in error

In Javascript,when using or concatenating string, use it with double quotes.
Or it may generate error.

Recommanded:
var str="Some String" + document.getElementById("txtName").value;

Should be avoid:
var str='Some String' + document.getElementById("txtName").value;


To overcome Date format related error, in .Net, with CompareValidator validation control
You can, specify culture in web config file.


Put Share Button on your website with ADD THIS

Go to http://www.addthis.com site, and it will ask you button layout you want to Choose.
And that site will display code snippet, which will contain one SCRIPT tag and HTML lines.

So you have to add script line in your page and put ‘html’ tags at place where you want to display share icons.


To set content in tinyMCE editor box by using javascript
var editorInstance = tinyMCE.getInstanceById("ctl00_cpMain_txtCampaignDesc"); //specify clientid of textarea field
editorInstance.getBody().innerHTML = "This is dynamic text set by javascript.";