24 February 2013

After A long time...!!

I dont know why i can not keep continue writing the things i have started, whether it be a blog or diary or anything... I just cant figure it out.. anyways past few days have been very hectic as there is a huge pressure to finish off the project for my final year of engineering..

Urmm.. i am not so sure about what should i write given that i havent wrote in here in a long long time.. so i suppose i would just write about some of the little problems i faced during the project which seem to be a little but still it took quite a bit of work to get around those problems...

1. $.fancybox.close() not working, Firfox giving "wrap is undefined" problem..

                         This problem, most probably occur when you are including the Fancybox.js and jquery.js twice, first in the parent window and then again in the fancybox popup window.. If you are using the fancybox type as "iframe" parent.$.fancybox.close() should work fine but if you are using it as 'AJAX' make sure to not include those two jquery files twice... !!!

So if you are facing this error, simple remove the fancybox.js and jquery,js from fancybox popup window... ! and you are good to go..!

2. Ckeditor + fancybox + javascript...
                       

                       Suppose you are having quite a few anchor tags in your parent window and each one is supposed to be applied fancybox(), which in turn opens up an popup window with each link creating a unique instance of Ckeditor in your modal fancy popup... the scenario which i faced was that when you click on the first link the fancybox and ckeditor works fine.. however once you close it and try to open up a second fancybox popup through a different anchor tag, firefox will serve you with an error saying "Editor1 already exists.." 
                      
                   The solution to this error is that you have to destroy the CKeditor instance before closing the first popup to prevent naming conflict with Ckeditor instance....it goes like this...

    $(".popup").fancybox({      
        
         type : 'ajax',
            
        'onClosed'  : function() {
            if(CKEDITOR.instances.ckeditor) {
                CKEDITOR.instances.ckeditor.destroy(); }
      }
 });

I am running out of time, will write more once i come back..!!!
Happy Coding..!
                       

No comments: