We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

Can a website connect to the backend?

Home Forums General Questions Can a website connect to the backend?

Tagged: 

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #4401
    gfxgeezer
    Participant

    Hi,
    If I have say, a 3D model being displayed in the browser, and someone clicks it, I want it to connect to a BACKEND script (say, gimmetext.php) which will return some text. And then I want this text displayed. Can this be done?

    How does one do the connecting?

    Thanks.

    #4405

    Hi,

    You can do it with puzzles and some code. Attached an example project for ya. :whistle:

    
    function prepareExternalInterface(app) {
        // register functions in the app.ExternalInterface to call them from Puzzles, e.g:
        app.ExternalInterface.doRequest = function(url) {
            var xhttp = new XMLHttpRequest();
            xhttp.onreadystatechange = function() {
                if (this.readyState == 4 && this.status == 200) {
                    app.ExternalInterface.myJSCallback(xhttp.responseText);
                }
            };
            xhttp.open("GET", url, true);
            xhttp.send();
        }
    }
    
    Attachments:
    You must be logged in to view attached files.

    Chief 3D Verger | LinkedIn | Twitter

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.