Note that there are some explanatory texts on larger screens.

plurals
  1. POSolving Dual URL Problem..?
    primarykey
    data
    text
    <p>I am using cakephp I have 2 links:</p> <pre><code>&lt;a href="#" tabindex="1" onclick="base_load_demo1('http://www.boxyourtvtrial.com/widget/beer/main/');" &gt;beer&lt;/a&gt; &lt;a href="#" tabindex="2" onclick="base_load_demo('http://www.boxyourtvtrial.com/widget/cocktail/main/');"&gt;cocktail&lt;/a&gt; </code></pre> <p>With the following JavaScript:</p> <pre><code>var Url1 = "http://www.boxyourtvtrial.com/widget/cocktail/main/"; var Url2 = "http://www.boxyourtvtrial.com/widget/beer/main/"; var Url3 = "http://www.boxyourtvtrial.com/widget/beer/mini/"; function base_load_demo(Url) { remoteCall(Url1,"","mainLeftContent"); //remoteCall("SCRIPT_PATH","QUERY_STRING","TARGET_FUNCTION"); } function base_load_demo1(Url2) { remoteCall(Url2,"","mainLeftContent"); //remoteCall("SCRIPT_PATH","QUERY_STRING","TARGET_FUNCTION"); } </code></pre> <p>When I click on the first link it's showing its content through ajax call but when I click on the second link its giving error as follows:</p> <blockquote> <p>Missing Controller</p> <p>Error: Http:Controller could not be found.</p> <p>Error: Create the class Http:Controller below in file: app/controllers/http:controller.php</p> </blockquote> <pre><code>&lt;?php class Http:Controller extends AppController { var $name = 'Http:'; } ?&gt; </code></pre> <blockquote> <p>Notice: If you want to customize this error message, create app/views/errors/missing_controller.ctp</p> </blockquote> <p>and in FireFox console tab</p> <blockquote> <p>POST <a href="http://www.boxyourtvtrial.com/widget/beer/main/http://www.boxyourtvtrial.com/widget/cocktail/main/" rel="nofollow noreferrer">http://www.boxyourtvtrial.com/widget/beer/main/http://www.boxyourtvtrial.com/widget/cocktail/main/</a></p> </blockquote> <p>How can we solve this dual URL calling at the same time?</p> <pre><code>var xmlHttp; var uri = ""; var callingFunc = ""; var sResponse = new Array(); function remoteCall(sUrl, sQueryStr, sCalledBy) { alert(sUrl); var resStr = ""; var str = " { "; if(sQueryStr != "") { var arr1 = new Array(); arr1 = sQueryStr.split("&amp;"); if(arr1){ for(i=0;i&lt;=arr1.length;i++) { if(arr1[i] &amp;&amp; arr1[i] != "") { var arr2 = new Array(); arr2 = arr1[i].split("="); str += arr2[0]+":'"+arr2[1]+"' ,"; } } } } str += " tp: 'tp' } "; $.ajax({ type: "GET", url: sUrl, data: sQueryStr, dataType: "html", success: function(data) { $("#"+sCalledBy).html(data); //jih(sCalledBy,data); } }); /* $.get(sUrl,sQueryStr,function(data) { jih(sCalledBy,data); });*/ } function jih(divid,data) { if(document.getElementById(divid)) document.getElementById(divid).innerHTML=data; } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload