Below is the VF page for which we are performing URL hack and overriding the new account button with the below page.The button is working fine but when I use the same button through communities .ready function is being called continuously and page keeps on loading. Any help on what's causing the issue/how to resolve it is much appreciated.
<apex:page standardcontroller ="Account">
<script type="text/javascript" src="/js/function.js"/>
<script type ="text/javascript" src="/soap/ajax/28.0/connection.js"/>
<script language = "Javascript">
var j$ = jquery.noconflict();
var current;
J$(document).ready(function() {
change();
window.parent.navigateToUrl(current); });
function change() {
current = window.location.href;
current = current.replace("/apex/page","/00Qe/e");
current = current.replace("&sfdc.override =1","&nooverride =1");
current = current.replace("&save_new=1","");
current+= "&lea3=do not fill in"; }
</script>
</apex:page>
Don't you think it is recursive? When page first time load it calls the `change()` fucntion and after that it redirect to URL `current` and then it calls the `change()` function (it should) again, after that is call navigateToURL and this process goes on upto infinity.