Tweet
I think we all know how to use XML documents. For example RSS feeds are basically XML files, as well as sitemaps. Those files may be very important when managing a web site, but those examples are just a small part of the common use of XML documents. Just to make things clear, another example: when you export a Blogger blog, the file you get is an XML file.
When I've written the article on how to create an RSS feed, I discovered a very useful JavaScript snippet that helps us to validate an XML file.
Unfortunately I don't remember where I got it, but, even if I surely rearranged it, if you know the original source, please let me know so that I can give due credit to the author.
Ok, said that, let's see how to do it.
Thursday, 29 November 2012
Tuesday, 27 November 2012
JavaScript: validate an URL
Tweet
I've already posted an article on how to validate forms with Regular Expression. But, have you ever needed to valid an URL?
We can do it quite easily using Regular Expressions and JavaScript. Specifically we are going to use the .test method.
The code
The first thing we need to do is set two variables: one is the URL to be validated, the second is the Regular Expression.
I've already posted an article on how to validate forms with Regular Expression. But, have you ever needed to valid an URL?
We can do it quite easily using Regular Expressions and JavaScript. Specifically we are going to use the .test method.
The code
The first thing we need to do is set two variables: one is the URL to be validated, the second is the Regular Expression.
<script type="text/javascript">
var url = "http://www.google.com/";
var urlCheck = /^http:\/\/(www\.)?[a-zA-Z0-9-]{3,}\.[a-zA-Z]{2,}(\/)?$/;
Thursday, 22 November 2012
JavaScript: document.lastModified with a trick
Tweet
Again another JavaScript article...
This post in fact might be interesting for some of you. We are talking about those fancy lines we sometimes find at the end of a web page where we are informed about the document last modification date. Something like:
How do we do it automatically? And... that is not an European date, is it? If so, how can we manipulate it in order to make it European?
Again another JavaScript article...
This post in fact might be interesting for some of you. We are talking about those fancy lines we sometimes find at the end of a web page where we are informed about the document last modification date. Something like:
How do we do it automatically? And... that is not an European date, is it? If so, how can we manipulate it in order to make it European?
Tuesday, 20 November 2012
JavaScript: check the mime type and charset
Tweet
I always underestimated JavaScript. I know it has been a problem for me, because I've really missed lots of interesting things until I decided to explore the programming language.
In the following article I will show one of the useful things we can do with JavaScript: discover the charset and mime type of a web page.
You might wonder what's the use of it. Well... as usual try to broaden your view and consider the fact that every visitor is visiting your beloved web site from somewhere in the wide world, sitting on a different kind of chair (if not standing or lying), with a different piece of technology or device, and finally (but I could go on forever) with a specific browser ... ... type and version (the mixture of the two is a deadly issue for any web developer).
Ok, said that, don't you think that knowing the mime type and charset of a page might be useful?
Let's see how to do the magic.
I always underestimated JavaScript. I know it has been a problem for me, because I've really missed lots of interesting things until I decided to explore the programming language.
In the following article I will show one of the useful things we can do with JavaScript: discover the charset and mime type of a web page.
You might wonder what's the use of it. Well... as usual try to broaden your view and consider the fact that every visitor is visiting your beloved web site from somewhere in the wide world, sitting on a different kind of chair (if not standing or lying), with a different piece of technology or device, and finally (but I could go on forever) with a specific browser ... ... type and version (the mixture of the two is a deadly issue for any web developer).
Ok, said that, don't you think that knowing the mime type and charset of a page might be useful?
Let's see how to do the magic.
Thursday, 15 November 2012
jQuery: cookies!
Tweet
I've already talked about cookies. We explored the way to use them with ASP, but have you ever wondered how to manage them with jQuery?
This is a very short article because I don't want re-write an already made guide...
We are talking about a jQuery plug-in called jquery-cookie which allows us to manage everything about cookies with jQuery.
We will be able to read, create and delete cookie sessions. The plug-in can manage session expiration and it can be configured in order to define a valid path for cookies.
Just go to the above page and see for yourself...
I've already talked about cookies. We explored the way to use them with ASP, but have you ever wondered how to manage them with jQuery?
This is a very short article because I don't want re-write an already made guide...
We are talking about a jQuery plug-in called jquery-cookie which allows us to manage everything about cookies with jQuery.
We will be able to read, create and delete cookie sessions. The plug-in can manage session expiration and it can be configured in order to define a valid path for cookies.
Just go to the above page and see for yourself...
loading..
Tuesday, 13 November 2012
SQL Server: import a MS Access database
Tweet
As I wrote in a past article, MS Access can be used to manage databases for a dynamic web site. However, some times, it is not enough and its features can be not enough. In those cases we really need to move to a more performing software like SQL Server.
Especially in situations were large quantities of information are managed by a dynamic web site, SQL Server can be a great solution.
If you are a reader of the web thought, you know how much I am a fan of SQL Server. so in this short post I will explain how to import an Access database to SQL Server... a few steps and we will ready to go.
As I wrote in a past article, MS Access can be used to manage databases for a dynamic web site. However, some times, it is not enough and its features can be not enough. In those cases we really need to move to a more performing software like SQL Server.
Especially in situations were large quantities of information are managed by a dynamic web site, SQL Server can be a great solution.
If you are a reader of the web thought, you know how much I am a fan of SQL Server. so in this short post I will explain how to import an Access database to SQL Server... a few steps and we will ready to go.
Thursday, 8 November 2012
jQuery and JavaScript: generate and read a QR Code
Tweet
Hello everybody!
today we are going to see something really interesting that someone in the past asked me via email.
We are going to generate a QR code using a jQuery plug in and then we are going to use a JavaScript library to read the very same QR code.
What do you think, is it interesting enough?
Hello everybody!
today we are going to see something really interesting that someone in the past asked me via email.
We are going to generate a QR code using a jQuery plug in and then we are going to use a JavaScript library to read the very same QR code.
What do you think, is it interesting enough?
Subscribe to:
Posts (Atom)