Home  Client Side Scripting  Scripting

“Client side Scripting frequently Asked Questions in various Scripting job Interviews by interviewer. The set of Scripting interview questions here ensures that you offer a perfect answer to the interview questions posed to you. Get preparation of Scripting job interview”

9 Scripting Questions And Answers

2⟩ Explain how to validate website address using JavaScript? User should not be allowed to enter special characters except hyphen(-)?

function ValidateWebAddress(field,alerttext)




var companyUrl =value;

var RegExp = /^(([w]+:)?//)?(([dw]|%[a-fA-fd]{2,2})+(:([dw]|%[a-fA-fd]{2,2})+)?@)?([dw][-dw]{0,253}[dw].)+[w]{2,4}(:[d]+)?(/([-+_~.dw]|%[a-fA-fd]{2,2})*)*(?(&?([-+_~.dw]|%[a-fA-fd]{2,2})=?)*)?(#([-+_~.dw]|%[a-fA-fd]{2,2})*)?$/;

i f(RegExp.test(companyUrl)) {

return true;





return false;




Call this fuction in an if else structure

Pass the field name and an alert string

if(validate_r(website,"Need to specify your site")==false)


return false;



3⟩ How to disable back button in Mozilla?



<script type="text/javascript">

function noBack(){window.history.forward();}



<body onload="noBack();" onpageshow="if(event.persisted)noBack();" onunload="">




4⟩ Explain how to load .so (in linux), DLL in windows in PERL?

[root@atmlab05 bin]# ldd ns => not found => not found => not found => /usr/X11R6/lib/ (0x4001b000) => /usr/X11R6/lib/ (0x40026000) => /lib/ (0x400c3000) => /lib/ (0x400d8000) => /usr/lib/


0) => /lib/ (0x4011d000) => /lib/ (0x4013a000)

/lib/ => /lib/ (0x40000000)


7⟩ How to disconnect the vpn client in VB Script?

My users have found this helpful. When a user has a drive mapped (especially in XP) on a laptop, it can sometimes slow the system down looking for the drive when not connected to the network. This solution allows them to connect to the Network drives only when they want to if in the local office or through VPN.

'Although DirectConnect works welll, not all of us have the resources for that.

This script will look up a set of network drive, and if connected, disconect them, or if not connected, connect them.

additional code could be added to connect printers, or even test the network before attempting connection.


9⟩ Explain how to execute WScript & WSH object? How will i create WSH objects?

The WScript object is directly available to all scripts being executed by wscript or cscript and represents the currently running instance of the scripting host executable (wscript or cscript). The WScript object cannot be instantiated directly using CreateObject, however scripts running under WSH can obtain a reference to it via the Application property.

Through the WScript object one can gain access to WSH version information, the paths to the host executable and the script currently being executed, any arguments passed to the script, and the standard input, output and error streams. In addition, the WScript object can be used to instantiate, obtain references to, and bind to COM components. Methods and properties are also available to alter the script timeout values, and to cause the script to sleep for a specified period of time.