Site menu:

Links:

RSS .NET RSS

RSS Engadget

Site search

Categories

March 2010
M T W T F S S
« Jan    
1234567
891011121314
15161718192021
22232425262728
293031  

Tags

Blogroll

Archive for 'Javascript'

an activex control on this page might be unsafe to interact with other parts of the page. do you want to allow this interaction?

I keep getting this message “an activex control on this page might be unsafe to interact with other parts of the page. do you want to allow this interaction” when I try to access a page that use Javascript to access ActiveX Code. I’ve spent quite sometime to get rid of this error message and [...]

key event handler that compatible with all browsers using javascript

This might be useful for web developer which wants to have one key event handler that compatible with all browsers.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<script language=JavaScript>
document.onkeyup = KeyCheck;
 
function KeyCheck(e)
{
//this is used for cross browser
var KeyID = (window.event) ? event.keyCode : e.keyCode;
 
switch(KeyID)
{
 
case 13:
[...]

AJAX Update Panel Timeout Issue

I have an asp.net page where the page will query the report from the database. To query the report itself might cause timeout exception on the page itself before the report result is being returned from database.
You need to do it in two steps, first you need to override the script timeout only for [...]

Set Default value with clear text for input type=”password”

Normally we have two text boxes which is user name and password. On the first load of the page we want to set the default value of user name text box becoming ‘username’ and set the default value of password text box becoming ‘password’ not ‘*******’.
Well what most of us think that we can [...]

XML http object cross browser

I believe this will be useful for everyone who wants to implement AJAX manually and make it compatible cross browser.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<script type="text/javascript">
 
// cross-browser method to retrieve an XMLHttp object for asynchronous requests & responses
[...]

Querystring in Javascript

This is a function to capture querystring in javascript. I used this javascript to control my menu dynamically.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<script type="text/javascript">
function getQueryString(strParamName){
var strReturn = "";
var strHref = window.location.href;
if ( strHref.indexOf("?") > -1 ){
var strQueryString = strHref.substr(strHref.indexOf("?")).toLowerCase();
var aQueryString = strQueryString.split("&");
for ( var iParam = 0; iParam &lt; aQueryString.length; iParam++ ){
if (
aQueryString[iParam].indexOf(strParamName.toLowerCase() + "=") > -1 ){
var aParam = [...]

Register Javascript to hide Div

Sometimes people add javascript into the aspx page instead of using code behind but there is a case when we need to add javascript in the runtime using code behind. This is the example where javascript is used to provide switching of visibility based on the table visibility status. I used this technique to hide [...]