All web pages return http 500 not sure why

I don’t understand what is gradle too. My basic is pascal delphi c, vb.
Situation make to learn. When learn i understand much. Bcz it’s like delphi vb + c.
Not many different. Android is like them + xml + grant permissions.

file project is rearrange is commonly same. Activities manifest including gradle. Watching them as a part file structure of android project.

Gradle surgery is a nightmare. :gorilla:

Well I am checking through to see why its not fetching . It doesn’t seem to be running my script any ideas please as my site http://www.deniserose.epizy.com/music_now_playing.php contains
<script src = 'js/fetch_updater.js' type='application/javascript'></script>. This used to be ok so I am unsure why it doesn’t run now ?

Change all of those single quotes to double quotes. Single quotes in attributes are not valid HTML.

Also, check the F12 tools for any errors about that file.

3 Likes

thanks Wacky but it doesn’t seem to be running AJAX even with the double quotes in place . I even tried placing it into the main php function

InitReload() {

     new Ajax.PeriodicalUpdater("track_data", "fetch_sql.php", {
	 method: "get", frequency: 10000, decay: 1});

}

It doesn’t seem to want to run it any ideas ?
As its not running here either on main page ?
Am not getting any loads in the F12 debugger either .

Does it supposed to be type=‘text/javascript’
or type=‘javascript’

i never see something like this but on Java asyncronous.

So i learnt
https://documentation.help/Xunxin-Prototype-API-1.6.0-zh/periodicalUpdater.htm

Thanks but I think the problem is the page references have changed from my previous system i was on i was using

    var base64file2 = $("img#np_track_artwork").attr("src", "data:image/png;base64,"+data);
    

To get the image base64 for the iage but dont think this working

im not expert seems like popup and keyboard input api probs.

Why didnt use jquery plugin built prototype. it can be was on was on .

Hi Edwin yes but this was all working before :

 var image = document.createElement("img");
    image.src = 'http://www.deniserose.epizy.com/images/nowplaying_artwork_2.png';
    var base64file1;
    toDataURL('/images/nowplaying_artwork_2.png', function(data) {
     .then(dataUrl => {
        console.log('RESULT:', dataUrl)
        base64file1 = dataUrl;
      });
    
    //image.remove();
   
    var base64file2 = $("img#np_track_artwork").attr("src", "data:image/png;base64,"+data);

but not now this is far as I got today :slight_smile:
Hugs D

i remember . you can use canvas trick to convert image to dataURL base64.

I understand read image from external url. Read its base64 data then.

Thanks Edwin I have tried that in past without luck here I just need two base64file 1&2 for on screen and one in file. This code above no longer works on my new site . I wonder if CanvassElements are not available on this server as both in f12 debugger give void data or something about missing ) and or Uncaught SyntaxError: Unexpected token ‘.’ (at fetch_updater.js:78:6)

<!DOCTYPE html>
<html>
<head>

</head>
<body>

<p>Image to use:</p>

<img id="rt" width="220" height="277"
src="http://viena.lovestoblog.com/imgEdit/img/edwin.jpg" alt="Lesson">

<p>Canvas:</p>

<canvas id="myCanvas" width="240" height="297"
style="border:1px solid #d3d3d3;">
Your browser does not support the HTML5 canvas tag.
</canvas>

<script>
	//For image data, I find it simpler to use canvas.toBlob (asynchronous)

function b64toBlob(b64, onsuccess, onerror) {
    var img = new Image();

    img.onerror = onerror;

    img.onload = function onload() {
        var canvas = document.createElement('canvas');
        canvas.width = img.width;
        canvas.height = img.height;

        var ctx = canvas.getContext('2d');
        ctx.drawImage(img, 0, 0, canvas.width, canvas.height);

        canvas.toBlob(onsuccess);
    };

    img.src = b64;
    
}

var base64Data;
b64toBlob(base64Data,
    function(blob) {
       var url = URL.createObjectURL(blob);

        //var url = window.URL.createObjectURL(blob);
        // do something with url
    }, function(error) {
        // handle error
    });
</script>
<script>
window.onload = function() {
    var canvas = document.getElementById("myCanvas");
    var ctx = canvas.getContext("2d");
    var img = document.getElementById("rt");
   ctx.drawImage(img, 10, 10);
};

</script>

<div id="createPNGButton">
    <button onclick="createDownloadLink()">Save as Image</button>        
</div>

</body>
</html>

http://viena.lovestoblog.com/imgEdit/sample0.php?r=0 :yen::grin:

Edwin in my js I have:

const toDataURL = url => fetch(url)
  .then(response => response.blob())
  .then(blob => new Promise((resolve, reject) => {
    const reader = new FileReader()
    reader.onloadend = () => resolve(reader.result)
    reader.onerror = reject
    reader.readAsDataURL(blob)
  }))

then to handle it


var image = document.createElement(“img”);
image.src = ‘http://www.deniserose.epizy.com/images/nowplaying_artwork_2.png’;

var base64file1;

toDataURL('/images/nowplaying_artwork_2.png', function(data) {
    then(dataUrl => {
    console.log('RESULT:', dataUrl)
    base64file1 = dataUrl;
  });

but this is not working as it did before in Java Script it has to be in JavaSript hugs

new file.

Change url. If it is working. Can be used then.

I think i got to bottom of it its a syntax error missing ‘,’ can you spot it ?

toDataURL("/images/nowplaying_artwork_2.png", function(data) {
        then(dataUrl => {
        console.log('RESULT:', dataUrl);
        base64file1 = dataUrl;
        }
    });

hugs Dx

well has no errors but base64file 1 and base64file2 are still ‘undefined’ in my java script on F12 console ,I have had enough today cant move this on as its syntax correct. But does not provide expected results of base64 code like it did on my other server idk why?

const toDataURL = url => fetch(url)
  .then(response => response.blob())
  .then(blob => new Promise((resolve, reject) => {
    const reader = new FileReader()
    reader.onloadend = () => resolve(reader.result)
    reader.onerror = reject
    reader.readAsDataURL(blob)
  }))
    

var image = document.createElement("img");
    image.src = 'http://www.deniserose.epizy.com/images/nowplaying_artwork_2.png';

    var base64file1;
   
    toDataURL("/images/nowplaying_artwork_2.png", function(data) {
        then(dataUrl => console.log('RESULT:', dataUrl));
        base64file1 = dataUrl;
        });
    
    //var base64file2 =  document.getElementById("outer_img").GetElementsById("np_track_artwork").src.data;
    var base64file2 = $("img#np_track_artwork").attr("src", "data:image/png;base64,"+data);

Hugs D

It works
http://viena.lovestoblog.com/imgEdit/r3.php

click imgClickMe then Process.
need to add timer to check onchange.
see you at fifa football time again tonight. :slight_smile:

Hi Edwin hmm , not with my code its still not forcing the upload of image through PHP fopen( either
Am still noticing things like strlen( and other ‘c’ derivatives don’t work in php either its most odd

The only thing i have is from here a warning

  1. Audit usage of navigator.userAgent, navigator.appVersion, and navigator.platform

  2. A page or script is accessing at least one of navigator.userAgent, navigator.appVersion, and navigator.platform. Starting in Chrome 101, the amount of information available in the User Agent string will be reduced.

To fix this issue, replace the usage of navigator.userAgent, navigator.appVersion, and navigator.platform with feature detection, progressive enhancement, or migrate to navigator.userAgentData.

Note that for performance reasons, only the first access to one of the properties is shown.

  1. AFFECTED RESOURCES
1. 1 source

  1. prototype.js:1
    • Learn more: User-Agent String Reduction

Google Chrome seems to be going through some depreciation again I fixed this last time by going from Navigator.AppAgent to Navigator.userAgentData but it seems we are loosing that too maybe ? There is not much information currently about this new issue is there any information out there as this prototype.js file is no longer being updated from 1.7.3 that i have located ?