Archive for the ‘ Javascript ’ Category

It is true, text you last copied for pasting (copy & paste) can be stolen when you visit web sites using a combination of JavaScript and ASP (or PHP, or CGI) to write your possible sensitive data to a database on another server.

Fragmentation of the installed base of browsers will only get worse. By definition, it can seldom improve unless absolutely everyone on the planet threw away their elderly browsers and upgraded to the latest gee-whiz versions. But even then, there’s lots of discrepancies between the scripting of the latest Netscape Navigator and Microsoft Net Explorer. The situation makes scripting a challenge, for newcomers who …

Since 3 and 4 are integers, these are number arithmetic, since 8 is a string, it’s concatenation, so 78 is the result.

The Confirm box displays two buttons namely OK and Cancel whereas an Alert box displays only one button which is the OK button.

You can use several different methods of placing javascript on your pages. You can directly add a script element inside the body of page. 1. For example, to add the “last updated line” to your pages, In your page text, add the following: <p>blah, blah, blah, blah, blah.</p> <script type="text/javascript" > <!– Hiding from old browsers document.write("Last Updated:" + document.lastModified); document.close(); // –> …

I/O operations like reading or writing a file is not possible with client-side JavaScript. However, this can be done by coding a Java applet that reads files for the script.

In order to detect the operating system on the client machine, the navigator.appVersion string (property) should be used.

It’s not possible to set any session variables directly from java-script as it is purely a client side technology. You can use AJAX though to asynchronous.

Here is code: <html> <head> <title>Untitled-1</title> <script language="JavaScript"> function enable_text(status) { status=!status; document.f1.other_text.disabled = status; } </script> </head> <body onload=enable_text(false);> <form name=f1 method=post> <input type="checkbox" name=others onclick="enable_text(this.checked)" >Others <input type=text name=other_text> </form> </body> </html>

Okay I assume that you have a button REFRESH, which reloads the page when you click on it. Here is the code // Use location.reload() in jquery to reload a page <input name="refreshPage" type="button" id="refreshPage" value="Refresh" onClick="location.reload();">