AJAX is now widely used in to web development to make the user interfaces simpler and faster. We may use AJAX to load images after page load in order to increase performance. However if you want to have a lightbox popup with the full image bound to an image loaded by AJAX then you might run into problems. You will find that even after linking the JS, CSS files and adding the rel="lightbox" attribute to the images it might not work.
Javascript
Programming in Javascript
We had come across many situations while developing Drupal based websites where we had to create Javascript popups without using third party Javascript libraries. Third party libraries often lead to dependency issues or conflicts with existing Javascript functionalities. If you want to know how to create a simple Javscript popup in your Drupal website without using third party Javascript libraries then continue reading.
Many Drupal users have requested to know how to load Javascript within Colorbox. If you are looking for a way to load a JS app in Colorbox in your Drupal site then read on to find out the solution.
Many Drupal users have complained that they were unable to load Colorbox Javascript libraries. If you are facing the same issue with Colorbox in your Drupal site then read on to find out the solution.
The trick explained briefly
We are not actually going to theme the file upload field as it is presently nearly impossible to do that. Instead we are going to put an ordinary looking 'dummy' input text field over the file field. Next we proceed to make the 'original' file upload field invisible but accessible to the user via CSS. So when a user clicks on the dummy input text field they are actually clicking on the file upload field itself. To make it authentic we are going to copy the file path from the file upload field to the text input field via javascript.
We were working on an online billing application for a small charity firm when we came upon this problem. The application was developed and tested under Firefox. However we got the error when we tested it on Internet Explorer 6 (6.0.2900.2180). There was a simple window.open javascript call to open a popup window. The window was opening fine but it remained blank and the parent window showed the javascript error
Error: Class not registered.