Loading

Tuesday, February 12, 2008

uploadresponse.class.php - AJAX Code Search

<?php

class UploadResponse {
var $jsClassName;
var $callBackParams;
var $content;

function UploadResponse() {
$this->jsClassName = null;
$this->callBackParams = array();
$this->content = null;
}

function setJsClassName($jsClassName) {
$this->jsClassName = $jsClassName;
}

function getJsClassName() {
return $this->jsClassName;
}

function setCallBackParams($callBackParams) {
$this->callBackParams = $callBackParams;
}

function getCallBackParams() {
return $this->callBackParams;
}

function addCallBackParam($param, $isString = false) {
if ($isString) {
$param = "'" . $param . "'";
}
$this->callBackParams[] = $param;
}

function setContent($content) {
$this->content = $content;
}

function getContent() {
return $this->content;
}

function doResponse() {

header('Content-Type: text/html; charset=UTF-8');

$params = '';

if ($this->callBackParams) {
$params = ', ' . implode(', ', $this->callBackParams);
}

echo '<html>
<head><title></title></head>
<body>
<pre id="__content_container">' . $this->content . '</pre>
<script language="javascript">
var parentFrame = parent.window;
if (parentFrame) {
var content = document.getElementById("__content_container");
parentFrame.' . $this->jsClassName . '.uploadCallBack(content.innerHTML' . $params . ');
}
</script>
</body>
</html>';

}

}

?>

SHARE TWEET

Thank you for reading this article uploadresponse.class.php - AJAX Code Search With URL https://x-tutorials.blogspot.com/2008/02/uploadresponseclassphp-ajax-code-search.html. Also a time to read the other articles.

0 comments:

Write your comment for this article uploadresponse.class.php - AJAX Code Search above!