Call external HTML page


Hello, i have seen somewhere how to load an external html page into playcanvas, but i can’t find it anymore…anyone can help?


Found this,“”);

but it open a new page in the browser, i wanted to make the page open as an entity


What do you mean by open as an Entity?

You can create HTML assets and display attach them to the page.


yes, i know i can create html assets, but if i want call a page that is on an external site?


Can you use an iframe in your HTML asset to load an external page?


uhm… i guess it could work…let me give it a try


Yes iframe works fine … tnx a lot!
can i exchange data with a php page?

[SOLVED] Not getting AJAX to work with GET-call to PHP

That is really weird that you iframe whole page inside of playcanvas app, can’t see real reason for doing so.
Yes you can: use AJAX.


yes max is weird, but it was just a test, also if i have to say that the site is lot more fast inside playcanvas.
I wanted to use some page or just frames or tables if needed.


Not getting AJAX to work. I use this script-structure within my playcanvas-JS:

  • converted to:
autoGenTextSquares.prototype.doautoGenTextSquares = function (screenPosition) {

    var from = this.cameraEntity.getPosition ();

    var to =, screenPosition.y,;

    var result =, to);

    if (result) {
        var hitEntity = result.entity; this.firstPosition =hitEntity.getLocalPosition();
        if ( === 'Start_RecDial1'){  
      type: "GET",
      url: " ... (meta-cloaked) ... /insertChk.php"
    }).done(function( data) {
                                              console.log("req done");
      alert( "Request is done" );

And within my exported index.html I write the AJAX reference:

<script src="" type="text/javascript"></script>

    <script src="__start__.js"></script>
    <script src="__loading__.js"></script>

The page reacts with console and alert, but it doesn’t write to my DB (insertChk.php that already works seprately)

I did find a solution.