Chapter 1: JavaScript – A Client-Side Scripting Language

Its been long since my last post. After a long time I have got this day a little free time myself so does for you. Many a time peoples ask me of teaching them JavaScript, well then I thought why not write a tutorial for them! Well here we go. If any of you find anything wrong let me know. I am not the inventor of JavaScript, so I don’t know all. Okay, enough with the chatting, lets start …

JavaScript is probably the most sophisticated client-side scripting language I have ever seen. We have VBScript, we have C#, we have PHP, but none of them can match the functionality, features and dynamism that JavaScript possesses.

If you are intermediate to JavaScript, you can skip this post and go forward, but if you need to know about what is a client-side scripting language, read it. A client-side scripting language is different from a programming language in so many ways –

  • Firstly, unlike a programming language, a scripting language is never ever compiled to build an output binary file, instead they are executed one statement at a time and execution breaks if any errors occur or the code finishes.
  • Secondly, a client-side scripting language run in a specific environment, in other words, inside a browser and is fully dependent on the browser to give it all kinds of supports. Whereas, a programming language output runs on an operating system.

You might have notice the fact that I am saying client-side scripting language not simply scripting language. Thats because a scripting language normally runs in a script host on the server machine. All the codes of the scripting language is run and the output is sent back as mere HTML markup to the client side. But JavaScript is never run in the server, instead it is sent as it is to the client side with the HTML markup. Then it is the client’s responsibility to run the code and show the output to the user and by clients I mean, your browser –  Internet Explorer, FireFox, Opera, Chrome, Safari; whatever that might be.
But beware of that fact that, not all these browsers user the same JavaScript engine, and thus you might need to check if the browser support your specific JavaScript codes. But don’t be alarmed, almost all the browser support almost all kinds of functionalities, there are few exceptions, but they are not so frequently used.

Advertisements
Posted in Learn JavaScript | 5 Comments

Windows XP Browser not opening Microsoft or Antivirus Sites

Hi,

If you are using windows xp and you face the problem that whenever you open microsoft or some specific antivirus site, the browser just doesn’t open it. Well, thats probably because of the windows cd that you used or downloaded is pirated and they do not want you to go into that sites.

There is a solution for this problem, but its not permanent. To be able to browse those sites, just go to services and restart the service named ‘DNS Client’ and voila! you are in.

Actually when your system boots, DNS Client is called automatically with some parameters to stop you from browsing those sites. Restarting it resets them and you are free to visit any site.

Now, if you are smarter than more of us, then use an auto executable batch to run after each boot, but make sure it is the last batch ran.

Posted in Operating System, Windows XP | 1 Comment

WCF Web Service – Enabling JSON – Solution 1

Hello!

The main reason I am posting this really simple post only because, even though it is simple, it wasted a lot of time for me. There are several ways to enable JSON request and response for WCF web service. But the easiest I think is this one

1. Just select AJAX Enabled Web Service from the add new item window if you are using Visual Studio ( I used VS2010). By default this will talk to the clients with JSON. There you go.

2. But, If you really want to know whats the difference between AJAX Enabled Web Service and WCF Web Service, open the new added AJAX Enabled Web Service. Just over the class declaration you will notice a line that says –

[ServiceContract]
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]

The second line is the main reason. It enabled the service to allow JSON type messaging from a client.

Now, I know this is not the only solution, you can also enable JSON response/request in a WCF Service, but I have not really tested that case, will post as soon I am done…

If this is found helpful, don’t forget to leave a comment, thanks.

Posted in Web Service | Tagged , , | 5 Comments