I'm referring a question answered here.
Trying to append an external PHP file in to jQuery and tried load.
$(".chatbox").load("./one.php");
This gives me the output;
Your success message!
However the concern is this removes all HTML in the body and does not really 'append' the success message.
I tried the following instead.
$(".chatbox").append("./one.php");
which merely prints this!
./one.php
Am I missing something here?
load()replaces the entire content of the selected element. It sounds like you simply need to change your.chatboxselector to a lower level element. If you want to append the content instead, then you would need to use$.ajax()to retrieve the value andappend()it manually.append()know that./one.phpis a file?$.get()and use$.append()in the success callback. But read the documentation of jquery for all these functions (load,get,append) closely. They're quite clear and will most probably solve your question, or at least help you in asking a more specific question.