Home     |      Learn AJAX     |      Forum     |      Register     |      Submit Resource     |      Submit Article      |      Contact Us

Home Security
 

SetInterval and SetTimeOut Strings

 

SetInterval and SetTimeOut are two functions in JavaScript and Ajax that will allow developers to execute a certain function that will be triggered by time. SetInterval specifically delays the function so that other functions will be executed first or to create a delay effect on the function.


SetTimeOut on the other hand, will allow developer to pause a certain function if no reaction was extracted from the user or the application. These functions will basically prevent resources from being used on functions that might not work and provides enough flexibility of the implemented functions.

While these set of functions for JavaScript and Ajax provides a distinct advantage, these functions should not be used on strings. Strings are practically the lifeline of the JavaScript and Ajax based applications since they contain data as well as essential functions that will allow the functions to be implemented on the client side.


While manual coding could easily implement certain functions without strings, strings will hasten the execution of functions. Strings that contain various functions will be read by JavaScript as one – making it very easy to implement.

Strings could be implemented with various functions – including SetInterval and SetTimeOut, pairing them could be dangerous. Strings are active functions that contain very important data or they provide codes that can access important data. SetInterval and SetTimeOut can be considered as “open-ended” functions since you do not provide a definite end for the functions.


When strings are implemented with these functions, they become open for additional coding – that includes codes and functions provided by various attacks. Your application might be exposed to commands that will lead to extraction of data without your authorization.


Options for SetInterval and SetTimeOut


There are two alternatives for developers who wanted to use SetInterval and SetTimeOut:

Using an active function - Using an active function will help your application continue its process. By continuing its process, you should be able to direct the data contained in the strings to a secure location. Attacks will not be possible since the process do not have open ended commands.


What you have to make sure is that these active functions will have the ability to direct the data according to your preferences. Since the original purpose is to let it stay on SetInterval and SetTimeOut, you have to replace them with almost the same functionality.


Using anonymous function – An anonymous function is almost the same as SetInterval and SetTimeout but instead of letting string end openly for other functions, developers will be able to hold the function without opening them to other functions.


The tricky part of this function is on its execution. Since it’s anonymous, there is virtually no additional information that you can add in the said function.


Strings in SetInterval and SetTimeOut are highly discouraged in an Ajax or JavaScript based application because of its open ended behavior. Instead of focusing on these functions, look for an active or an anonymous function so that your application will be implemented without security problems.



Read Next: Bridging JSON Performance and Security



 
Related Topics


 

Comments



Post Your Comment:

Members Please Login
Your Name:*
e-mail ID:(required for notification)*
Image Verification: 
 
 Subscribe    

Sponsored Links