I have a very simple webpage (actually implemented as an iFrame in a MS Business Central (BC) page) which is displaying some address fields for input. This is implemented into the BC page using...
HTMLContainer.insertAdjacentHTML('beforeend',
'<div class="addyaddin">' +
' <div class="control">' +
' <div class="caption">Address</div>' +
' <div class="value">' +
' <input type="text" class="addressline" id="address1" placeholder="Start typing an address.." auto-complete/>' +
' </div>' +
' </div>' +
' <div class="control">' +
' <div class="caption">City</div>' +
' <div class="value">' +
' <input type="text" id="city" auto-complete/>' +
' </div>' +
' </div>' +
' <div class="control">' +
' <div class="caption">Region</div>' +
' <div class="value">' +
' <input type="text" id="region" auto-complete/>' +
' </div>' +
' </div>' +
'</div>');
Which works fine, however the html is multiline so it all gets a bit messy. What I'd like to have is an html file which I could simply read into a variable and then have that display. This means my code is a lot tidier and I can mess around with the html without having to string a whole lot of lines of html together in the insertAdjacementHTML statement.
Something like...
ReadHtmlFile('\myfile.html',textVariable);
HTMLContainer.insertAdjacentHTML('beforeend',textVariable);
Unfortunately JavaScript is something I'm not really familiar with so it's been a bit hit and miss up to this point. Hoping someone can guide me in the right direction
Cheers Craig