[x3d-public] elementary example is not working on Win 10 after adding alert

Konstantin Smirnov konstantin.e.smirnov at gmail.com
Sat Aug 22 13:14:55 PDT 2020


Hi.
The code of a scene began not working after adding alert test message:

<html>
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    <title>My first X3DOM page</title>
    <script type='text/javascript' src='
https://www.x3dom.org/download/x3dom.js'> </script>
    <link rel='stylesheet' type='text/css' href='
https://www.x3dom.org/download/x3dom.css'>
    <script>
        function changeColor()
        {

if(document.getElementById("color").getAttribute('diffuseColor')=="1 0 0")

document.getElementById("color").setAttribute('diffuseColor', '0 0 1');
            else

document.getElementById("color").setAttribute('diffuseColor', '1 0 0');
        }
    </script>
    <style>
        x3d
        {
            border:2px solid darkorange;
            background: rgba(128, 128, 128, 0.4);
        }
        body
        {
            font-size:110%;
            font-family:verdana, sans-serif;
            background-image: url('pattern.png');
            margin: 3em;
            color: lightgray;
        }
        h1
        {
            color: darkorange;
        }
    </style>
</head>
<body>
<h1>Hello, X3DOM!</h1>
<p>
    This is my first html page with some 3d objects.
</p>
<x3d width='500px' height='400px'>
    <scene>
        <shape onclick="changeColor();">
            <appearance>
                <material id ="color" diffuseColor='1 0 0'></material>
            </appearance>
            <box></box>
        </shape>
        <transform translation='-3 0 0'>
            <shape>
                <appearance>
                    <material diffuseColor='0 1 0'></material>
                </appearance>
                <cone></cone>
            </shape>
        </transform>
        <transform translation='3 0 0'>
            <shape>
                <appearance>
                    <material diffuseColor='0 0 1'></material>
                </appearance>
                <sphere></sphere>
            </shape>
        </transform>
    </scene>
</x3d>
<div id="digital_download">
A
</div>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.js
"></script>
<script>
$('#digital_download').html('Downloading...'); // Show "Downloading..."
// Do an ajax request
$('#digital_download').load('http://localhost/index2.php');
alert("YES");
if (document.getElementById('digital_download').innerHTML=="Hello!")
alert("yes");
</script>

</body>
</html>


The simple alert is added or innerHTML check.
Why it can be and strangely there are so many difficulties even on simple
examples. Magic tricks are sometimes needed :)
Waiting for the help,

Konstantin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20200822/03f8bad5/attachment.html>


More information about the x3d-public mailing list