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

Home JavaScript
 

Using External CSS and JavaScript

 

In building an Ajax based application, developers have to call on data from various sources. Aside from using the local data, developers could also use data from other websites. As the internet offers an almost unlimited source of data, there’s no wonder why developers utilize other websites to extract information for various purposes.


Developers even have to deal with the fact that they might be working with a malicious source which could easily debilitate their application and place their users in grave danger. But they can easily overcome this as long as they observe proper security measures.


But even if developers could easily deal with security problems, there are intrinsic challenges that developers have to go through with regards to external CSS and JavaScript functions. Even though their application is fast enough to load in the client side, the external sources are never optimized for the website. There is a great possibility that the information from other sites will not work as expected.


The following are tips on how developers can optimize their application even with external sources:


Become Dynamic – Requesting for raw data from an external source is never assured on the first request. Although there is a possibility that the information will be available on first try, the website might not respond as expected. This is especially true if the developer is not really familiar with the source of the application.


Through dynamic loading, developers should have the ability to continuously request for the application. There is even the possibility of accommodating redundant data because the data is continuously requested from an external source.


Remembering the File Type – Since the external source file types are only limited to CSS and JavaScript, developers are often content in targeting the source of site without doing anything else. But going with this technique could open up a lot of security problems. If the website source is tagged without any specification, developers might end up downloading additional data that could harm the application.


Developers need to point out the data format or website extension. It could be .php, .html or any other file extensions – developers have to specify the file type so that the data could be effectively filtered.


Dealing with Redundancy – This tip is basically part of the first tip. Dynamic loading of data from an external source is a good thing since it ensures data extraction. However, this increases the possibility of data redundancy which will only use bandwidth without any purpose. The data is already there so there is no need for additional data to be downloaded.


For that reason, developers will have to add another function to deal with redundancy. This function will help developers check if the data has already been downloaded. By adding checkers for data redundancy, duplicate data will be avoided.


External data for Ajax based application is often preferred by developers to ensure functional application without too much storage space. But through dynamic loading, specific file type filter and redundancy prevention, developers should be able to build a highly effective application.



Read Next: Juicer Library for CSS and JavaScript



 

 

Comments



Post Your Comment:

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

Sponsored Links