Anybody ???
On 23 апр, 04:26, Colonel <tcolo...@gmail.com> wrote: > How I can get content from remote file by $.ajax? > > For example I have some file temp.php: > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> > <html> > <head> > <title>Test file</title> > <meta http-equiv="Content-Type" content="text/html; > charset=windows-1251"> > </head> > <body> > <? > $id = isset($_GET["ID"]) ? $_GET["ID"] : ""; > $number = isset($_GET["NUMBER"]) ? $_GET["NUMBER"] : ""; > echo "<p><b>id =</b>" . $id . "</p>"; > echo "<p>number = " . $number . "</p>"; > ?> > <div id="header"><p>Some text in div header - <?=$id?></p></div> > <div id="header2"><p>Some text in header2 - <?=$number?></p></div> > </body> > </html> > > and Am using $.ajax: > > $.ajax({url: 'temp.php', > data: "ID=1&NUMBER=123", > cache: false, > error: function(msg) {alert("Error Saved: " + msg);}, > success: function(msg) {alert("Data Saved: " + msg);}, > complete: function() {$.unblockUI();} > }); > > how I can get for example content only from div with id=header2 or > both divs (not hole data - msg)? > > Thanks.