Top Ten Javascript
Accidentially stumble upon this 10 common custom Javascript and from the look of it, I find it useful for some of the functionalities. Hope it serves useful to you too.
http://www.dustindiaz.com/top-ten-javascript/
Accidentially stumble upon this 10 common custom Javascript and from the look of it, I find it useful for some of the functionalities. Hope it serves useful to you too.
http://www.dustindiaz.com/top-ten-javascript/
Some good links for WebRequst on .NET
http://www.netomatix.com/HttpPostData.aspx
http://www.developerfusion.co.uk/show/4637/
http://weblogs.asp.net/jan/archive/2003/12/04/41154.aspx
http://weblogs.asp.net/wim/archive/2004/04/02/106281.aspx
Most of the common form method handling will not escape the usage of GET or POST method to submit the data. While working on a project and experimenting both the methods I found out an interesting result...
GET got priority over POST method. If you use the Request.Querystring method in ASP, it will obtain all the required parameters. But for the POST method, doing a Request.Form method will not necessary obtain all the values. It seems that there is some kind of priority on the values obtain.
This lead me to wonder if anyone knows the sequence of which overwrites the priority first? I know that in php, the php.ini file allows you to edit the global, get, post objects and method, and that you could set the priority of the objects to be used first and overwritten priority. Thus I wonder if there is any for ASP Request.Form & Request.Querystring objects?
Found a good link from Microsoft on tips to improve performance and style for ASP!
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnasp/html/asptips.asp
And now for some encoding fun :P
The most common encoding that I like to use is Base64 Encode. Over the past 1 years plus, this encoding have proved to be very useful and I shall some tricks and tips that I discover! For fun with online base64 encode or decode check this site out.
1) Base64 encoding and decoding is dependent on the language charset that you set in. For example if you are encoding in a page with iso-8859-1 and a utf-8, the result encoding is different. I believed this is due to the different byte used and the character set used in the encoding.
2) Base64 encoding is useful to hide away clear text message.
3) My most important topic here! Base64 encoding can used in email subject and content. While working with mult-lingual email. the challenge is always to get the correct character displayed with showing gibberish stuffs. For my experiments before, I found out that base64 encode subject line are more reliable than quote-text for double-byte language email.
Due to the various different sytems operating in their settings and configuration, when a double-byte mail subject is quote-text, the result maybe displayed incorrectly. On some machine, it might displayed as you wanted, but not for some especially for those web-based email viewed online!
To send out double-byte character email ,the provided CDONTS and CDOSYS system on Microsoft Windows platform needs you to set the correct Session Codepage and encode the mail subject using quote-texted. When checked the reference, both the CDONTS and CDOSYS does not allow the mail subject to be base64 encoded! So for those mail subject that I received and does not appear correctly, how do we tackle this problem? One way you can do is change the subject liner to some other content. But what if the client insisted on it?
My solution that I discovered that it worked.ie: =?gb2312?b?xxxxxSubject-base64xxxxx==?=
Example with ASP using CDONTS
<%'Create the e-mail server object
%>
Set objCDOSYSMail = Server.CreateObject("CDO.Message")
'Update the CDOSYS Configuration
Set objCDOSYSMail.Configuration = objCDOSYSCon
With objCDOSYSMail
.From = strEmail
.To = strFriendEmail
.Subject = "=?gb2312?b?" & strSubject & "==?="
End With ' objCDOSYSMail
A few days back while doing a javascript form submit status, I encountered the weird error in my javascript-ing life. The problem is with the statement below:document.form.submit();
Yes, it look very much like a normal javascript form submit statement. However, on the Mozilla Firefox javascript console, it is throwing back in my face the error message "Object doesn't support this property or method"!
After desperate testing here and there, I search and google around for an answer and found out that I have make a stupid mistake. The problem was caused by having a submit button that has the name "submit", ie:
<input type="submit" name="submit" value="Submit">
As the form submit is a reserved method, any button name or input name that is named "submit" shall encounter this problem. So folks, take note not to name any input object "submit". The error vanished when I renamed the button to "Submit", ie:
<input type="submit" name="Submit" value="Submit">
Thanks to helpful information on the net, especially from this site here: http://www.agape-love.net/?item=document-form-submit-doesn-t-work&catid=13
Stupid Javascript :P
While looking around on how to do use self-signed IIS SSL certificate using OpenSSL, I came across the below article content from the author Eric Longman on his site. Thanks for the useful contribution! Other than using a Linux system, windows user can look to using CYGWIN installed with OpenSSL which also does the same work!
=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=
Self-Signed IIS SSL Certificates using OpenSSL
This tutorial assumes that you have a Linux box with OpenSSL installed,and that you want to create a self-signed certificate for IIS5.0
openssl genrsa -des3 -out CA.key 1024(You'll need to supply a passphrase. DON'T FORGET THIS!!)
chmod 400 CA.key
openssl req -new -key CA.key -x509 -days 1095 -out CA.crt(Provide appropriate responses to the prompts...for Common Name, you might want to use something like "OurCompany CA")
chmod 400 CA.crt
openssl x509 -req -days 365 -in new.csr -CA CA.crt
-CAkey CA.key -CAcreateserial -out new.crt
First contribution on the paging recordset with ASP.
It has always been annoying to do paging recordset, especially when you have to set many options here and there. Although the ADO recordset have many properties which aids in customising paging and the records to be fetched, the confusion lies within the vast amount of customisaton and try and error for the newbie.
Based on many paging script reference from the net, I have studied the goods and designed out an object oriented class solely for paging. The class requires minimal inputs and yields friendly result on the returend page numbers and recordset.
As this is my first draft, the technical details I have yet to describe it. The source provided is as it is with minimum comments. Hopefully it shall serve useful to you.
Download the source and example here
I am lazy, yes for this fact I do admit that creating a site requires a lot of efforts from creative aspects to coding etc. Being a developer myself, it has always been my idea to generate my own script library, collecting snippets here and there for my reference for future use.
Over the past years of development I have been reusing scripts from the net, and I thanks all those great scripting genius and author out there, which make most of our developer life easier! Having said that I would also want to contribute to share out scripts and knowledge that I feel is benefical to the world out there. Even if it's not beneficial, this can be a archival of my knowledge learning online!
Blogging - a new way of authoring and yes I feel that it shall make my life easier ignoring the design factor while I just post my script and description out here!