I have index page,which contain div section.i want to call different pages into this div section on the basis of her-link click,this is done. when calling pages that may also using ajax call,in this case ajax call not work for this page.please tell me it is possible to call ajax inside an ajax.if yes then please help me.
Update Edit:
I have created a gist where i have include all used pages,script https://gist.github.com/2786811.page service_status called the view.jsp using ajax call every 5 second,on hand view.jsp interact with database and prepare view.when we do ajax call from index.jsp, service_status called but it doesn't called view.jsp file.
Thanks
If you are trying to dump a <script>
tag with innerHTML
, it won't work.
However, you could (as an example) return a JSON object with two properties:
{
html: "All your <b>HTML</b> here",
js: "alert('JavaScript to be run');"
}
Then, use the html
property to put content on the page, and then eval
the js
property.
This isn't the best solution, since it uses the evil eval
, but unless you want to rewrite your whole basic structure to use callbacks properly then it's probably your best bet.
You can make ajax call on page load using $(document).ready(function () {...}); in target page you are calling.