This above code works very well and absolutely no problem but only when my javascript method is present in the page which i am loading. But if the js method is referred in any external js file it is not being triggered and this is how i am loading my page