views:

37

answers:

0

Hi, Currently i am working on div based remote page calling method means i have to call another file in my div actually i have 1 buttons as button when i clicked on that it has url for replacing currently opened page by another . I am working on cakephp and in localhost i have simple iframe.html in htdocs and song folder(in cakephp)

inside iframe.html i have code as----

<html>
<head>

  <title>Untitled Document</title>
  <script src="ffl_ajax-lib.js"></script>
  <script src="base.js"></script>
  <script src="jquery-1.4.2.js"></script>

</head> 

<body>
  <script type="text/javascript">
    base_init();
  </script>
  <div id="base_loading_demo">rajesh</div>
</body>
</html>

and the function base_init is as follows----

var base_arrActions = new Array();
base_arrActions['demo'] = "http://localhost/song";

function base_init(){
  base_load_demo();
}

function base_load_demo()
{
  remoteCall(base_arrActions['demo'],"","base_loading_demo");
  //remoteCall(“SCRIPT_PATH”,”QUERY_STRING”,”TARGET_FUNCTION”);
}

var  xmlHttp;
var uri = "";
var callingFunc = "";
var sResponse = new Array();

function remoteCall(sUrl, sQueryStr, sCalledBy)
{
alert(sCalledBy);
var resStr = "";
var str = " { ";
if(sQueryStr != "") {
    var arr1 = new Array();
    arr1 = sQueryStr.split("&");
    if(arr1){
        for(i=0;i<=arr1.length;i++)
        {
            if(arr1[i] && arr1[i] != "") {
                var arr2 = new Array();
                arr2 = arr1[i].split("=");
                str += arr2[0]+":'"+arr2[1]+"' ,";

            }
        }
    }
}                   

    str += " tp: 'tp' } ";
$.post(sUrl,sQueryStr,function(data) {      
    jih(sCalledBy,data);
    //eval(" "+sCalledBy+"() ");
    });
}

function jih(divid,data)
{
  alert(data)

  if(document.getElementById(divid))
    document.getElementById(divid).innerHTML=data;
}

this just showing header and footer the whole song is in javascript and cakephp with ajax. what will be the problem

Please help....

Thanks