I have snippent code which is executed by clicking on the link below
cj_redirecturl="/HomeWork/main/load_course"; utility.xhttprw.data(cj_redirecturl,{data:courseid},function(response){ if(response){ window.location.href=base_url+"main"; ///next utility.xhttprw.data(redirecturl,{data:""},function(response){ if(response){ id=ent; document.getElementById('content').innerHTML=response; // Assignemnt module //Call function from javascript/assignment.js file to display particular assignment (ent:means assignment_id) // if(con==5) { get_assignment_id(ent); } if(con==9) { get_content_details(ent); } } //end of response },false,false,false,'POST','html',true); } },false,false,false,'POST','html');
in the above code window.location.href=base_url+"main"; redirects the page to the corresponding page, but this stops the execution of the code written next to it. Now I want this code to run the way it was written: first, the code should take me to the corresponding "main" page, and then write the text after it should execute and provide me with the required output.
Can someone help me achieve this?
source share