I'm looking for a way to some how target a GET Form result page to a div. So far most of the solutions were telling me to use Iframe instead, but my purpose is to make some change to the result page and using Iframe seem to activate the cross domain scripting rule which prevent me from getting the page content.
And the result page is usually raw XML.
<html>
<head>
<link rel="stylesheet" href="css/smoothness/jquery-ui-1.9.2.custom.css" >
<script src="js/jquery-1.8.3.js"></script>
<script src="js/jquery-ui-1.9.2.custom.js"></script>
<script src="js/jquery.xslt.js"></script>
<script type="text/javascript">
$(function() {
var xmlContent = $("#CFrame").contents().find("*").text();
$('#SResult').xslt({xml:xmlContent, xslUrl:'stylesheet/styleSheet.xsl'});
});
// prepare the form when the DOM is ready
function submitForm() {
// bind form using ajaxForm
$('#searchForm').ajaxForm({
// dataType identifies the expected content type of the server response
dataType: 'xml',
// success identifies the function to invoke when the server response
// has been received
success: processXml
});
return false;
}
function processXml(responseXML) {
// 'responseXML' is the XML document returned by the server; we use
// jQuery to extract the content of the message node from the XML doc
var message = $(responseXML).text();
$("#SResult").text(message);
}
</head>
<body>
<form id="searchForm" method="GET" action="http://111.11.111.11:1111/search" onSubmit="submitForm()">
<!--.... Some input go here-->
<input type="submit" value="Search" />
<div id="SResult">
</div>
<iframe id="CFrame" name="ContentFrame" frameborder="1" height="1000px" width="1000px" scrolling="no"></iframe>
</body>
<script>
loadUI();
</script>
</html>
Thanks,