jQuery read content in external html file inside project

Répondu

2 Commentaires

  • Christopher Kennedy
    Zendesk Developer Advocacy

    Hi Pakpoom,

    After the app is uploaded, the asset files are not accessed from the same path within the assets directory as they are when the app runs locally.  To account for this, you can use the assetURL API to get the fully qualified URL that points to the file.

    So when using jQuery to retrieve a test.html file that exists in assets/templates​, use the following approach to send the request to the asset's fully qualified URL: 

    client.get('assetURL:templates/test\\.html').then(function(asset){
    $.get(asset['assetURL:templates/test\\.html'],
    //success callback function
    );
    });

    Thanks,

    1
  • P'Bom
     

    Hi Christopher,

    Your solution is work!! Thank you very. 

    0

Vous devez vous connecter pour laisser un commentaire.

Réalisé par Zendesk