How to save html into progmem

Hi everyone!
I can store html into progmem in visual studio code. But unable to do so in arduino IDE. about 34KB. I’m using RTL8720DN.

Hi @bigtiger0905 ,
Could you please provide the SDK version, error log, and code for us to reproduce your issue? Thank you

https://www.amebaiot.com/en/amebad-arduino-fatfs-sdio/
but RTL8720DN dont have SDIO, you can try SPI SD card connection.

Hi @M-ichae-l !
Arduino IDE V2.2.1
Realtek Ameba Boards 3.1.6

This is the rawliteral code.

const char strQuanLyServer PROGMEM = R"rawliteral(
var Notify=function(){“use strict”;var t=function(t){t.wrapper.classList.add(“notify–fade”),setTimeout((function(){t.wrapper.classList.add(“notify–fadeIn”)}),100)},e=function(t){t.wrapper.classList.remove(“notify–fadeIn”),setTimeout((function(){t.wrapper.remove()}),t.speed)},s=function(t){t.wrapper.classList.add(“notify–slide”),setTimeout((function(){t.wrapper.classList.add(“notify–slideIn”)}),100)},i=function(t){t.wrapper.classList.remove(“notify–slideIn”),setTimeout((function(){t.wrapper.remove()}),t.speed)};return function(){function o(o){var n=this;this.notifyOut=function(t){t(n)},this.fadeIn=t,this.fadeOut=e,this.slideIn=s,this.slideOut=i;var c=o.status,r=o.type,a=void 0===r?1:r,C=o.title,h=o.text,d=o.showIcon,l=void 0===d||d,p=o.customIcon,u=void 0===p?“”:p,f=o.customClass,v=void 0===f?“”:f,m=o.speed,y=void 0===m?500:m,w=o.effect,L=void 0===w?“fade”:w,g=o.showCloseButton,I=void 0===g||g,x=o.autoclose,E=void 0!==x&&x,M=o.autotimeout,O=void 0===M?3e3:M,Z=o.gap,b=void 0===Z?20:Z,B=o.distance,T=void 0===B?20:B,N=o.position,=void 0===N?“right top”:N;this.status=c,this.title=C,this.text=h,this.showIcon=l,this.customIcon=u,this.customClass=v,this.speed=y,this.effect=L,this.showCloseButton=I,this.autoclose=E,this.autotimeout=O,this.gap=b,this.distance=T,this.type=a,this.position=,this.checkRequirements()?(this.setContainer(),this.setWrapper(),this.setPosition(),this.showIcon&&this.setIcon(),this.showCloseButton&&this.setCloseButton(),this.setContent(),this.container.prepend(this.wrapper),this.setEffect(),this.notifyIn(this.selectedNotifyInEffect),this.autoclose&&this.autoClose(),this.setObserver()):console.error(“You must specify ‘title’ or ‘text’ at least.”)}return o.prototype.checkRequirements=function(){return!(!this.title&&!this.text)},o.prototype.setContainer=function(){var t=document.querySelector(“.notifications-container”);t?this.container=t:(this.container=document.createElement(“div”),this.container.classList.add(“notifications-container”),document.body.appendChild(this.container)),this.container.style.setProperty(“–distance”,this.distance+“px”)},o.prototype.setPosition=function(){var t=“notify-is-”;“center”===this.position?this.container.classList.add(t+“center”):this.container.classList.remove(t+“center”),this.position.includes(“left”)?this.container.classList.add(t+“left”):this.container.classList.remove(t+“left”),this.position.includes(“right”)?this.container.classList.add(t+“right”):this.container.classList.remove(t+“right”),this.position.includes(“x-center”)?this.container.classList.add(t+“x-center”):this.container.classList.remove(t+“x-center”),this.position.includes(“top”)?this.container.classList.add(t+“top”):this.container.classList.remove(t+“top”),this.position.includes(“bottom”)?this.container.classList.add(t+“bottom”):this.container.classList.remove(t+“bottom”),this.position.includes(“y-center”)?this.container.classList.add(t+“y-center”):this.container.classList.remove(t+“y-center”)},o.prototype.setCloseButton=function(){var t=this,e=document.createElement(“div”);e.classList.add(“notify__close”),e.innerHTML=‘’,this.wrapper.appendChild(e),e.addEventListener(“click”,(function(){t.close()}))},o.prototype.setWrapper=function(){var t=document.createElement(“div”);this.wrapper=t,this.wrapper.style.setProperty(“–gap”,this.gap+“px”),this.wrapper.style.transitionDuration=this.speed+“ms”,this.wrapper.classList.add(“notify”),this.wrapper.classList.add(“notify–type-”+this.type),this.wrapper.classList.add(“notify–”+this.status),this.customClass&&this.wrapper.classList.add(this.customClass)},o.prototype.setContent=function(){var t,e,s=document.createElement(“div”);s.classList.add(“notify-content”),this.title&&((t=document.createElement(“div”)).classList.add(“notify__title”),t.textContent=this.title,this.showCloseButton||(t.style.paddingRight=“0”)),this.text&&((e=document.createElement(“div”)).classList.add(“notify__text”),e.innerHTML=this.text.trim(),this.title||(e.style.marginTop=“0”)),this.wrapper.appendChild(s),this.title&&s.appendChild(t),this.text&&s.appendChild(e)},o.prototype.setIcon=function(){var t=document.createElement(“div”);t.classList.add(“notify__icon”),t.innerHTML=this.customIcon||function(t){switch(t){case"success":return’‘;case"warning":return’‘;case"error":return’'}}(this.status),(this.status||this.customIcon)&&this.wrapper.appendChild(t)},o.prototype.setObserver=function(){var t=this,e=new IntersectionObserver((function(e){e[0].intersectionRatio<=0&&t.close()}),{threshold:0});setTimeout((function(){e.observe(t.wrapper)}),this.speed)},o.prototype.notifyIn=function(t){t(this)},o.prototype.autoClose=function(){var t=this;setTimeout((function(){t.close()}),this.autotimeout+this.speed)},o.prototype.close=function(){this.notifyOut(this.selectedNotifyOutEffect)},o.prototype.setEffect=function(){switch(this.effect){case"fade":this.selectedNotifyInEffect=this.fadeIn,this.selectedNotifyOutEffect=this.fadeOut;break;case"slide":this.selectedNotifyInEffect=this.slideIn,this.selectedNotifyOutEffect=this.slideOut;break;default:this.selectedNotifyInEffect=this.fadeIn,this.selectedNotifyOutEffect=this.fadeOut}},o}()}();
)rawliteral";

if i put it above setup(). it will give an error when compiling.

if i put it at the end. it will not give error when compiling.

I solved the problem, because the code uses “//”. after removing “//”. no more errors.