Note: with some comments it seems that this is most likely impossible
I use jQuery ajax call to send an email address, in the called PHP file I return an error message or a successful message depending on the result.
Now I want to warn this result after jQuery has completed successfully $.post, the problem is that the called PHP file contains a configuration file that also has a Javascript file, so my data will look like this:
<script type="text/javascript" src="x.js"></script>Message
So, I tried the following:
Data
<script type="text/javascript"> src="x.js"></script><p>Message</p>
And I tried two different things in mine $.post:
Message
$.post('ajax.php',function(data){
alert($(data).find('p'));
alert($(data).find('p').html());
}
, alert($(data).find('p')); [object Object], , , , .html() null. data firebug, , .
console.log(data)
<script type="text/javascript"> src="x.js"></script><p>Message</p>
console.log($(data).find('p')) jQuery.
console.log($(data).find('p').length); 0
$('html').append(data);
console.log($('p').html());`
Message, .
, $ in $(data).find('p'), , [object Object].
, , , , jQuery . , JS .