Showing posts with label Java Script. Show all posts
Showing posts with label Java Script. Show all posts

25/04/2015

Unable to get property 'setItem' of undefined or null reference

When using localStorage in HTML5, and try to setItem, the below error will happen:

[Unable to get property 'setItem' of undefined or null reference]

The cause of the error is running the page without use web server such us IIS.
Just add the page with site under IIS and try.

Read more...

06/04/2011

10 ways to call Javascript code using C# and ASP.NET

There 10 ways to call Javascript code using ASP.NET and C#, you can download the attached files and test all ways.
http://www.4shared.com/file/L8-tE7DV/CallJSCode.html



Read more...

23/03/2011

Close Tab Using ESC

<html>
<head>
<script>
function checkForEsc(e)
{
 if(!e)
  e = window.event;
 var key = e.keyCode;
 if(key==27)
  doCancel();
}

function doCancel()
{
 window.parent.close();
}
</script>
</head>
<BODY onkeypress=checkForEsc(event);>
</body>
</html>

Read more...

13/11/2010

Adding Client Confirmation

To add client confirmation, such us when you want delete item:



OnClientClick = '<%#Eval("FieldName", "Javascript:return confirm(\"{0}\")") %>'

Read more...