I have created a simple page with a button on the center.
Now I want that when I click the button then the current page is completly rewritten with new HTML and Javascript code loaded from the server.
How can I do this with ajax ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Nick is right with what he says, but if there’s no other way:
EDIT:
Making sureFor me it didn’t work to fetch only theloadonly fetches content inside the<body>Tag from the remote adress.<body>tag by definingbody=>load('test.html body')To animate the page you could do something like this:
but then I suggest to implement at least one wrapper-element.