HTML File API Load Folder Into iFrame

I want to dynamically load a user's local folder into an iframe.

For example the end user is a developer and they have code

app-folder    index.html    style.css    script.js 

I want the user to be able to drag the app-folder onto the iframe and load the source.

I can get index.html to load by getting the HTML 5 file object and running,

iframe.src = window.URL.createObjectURL(file).

However, index.html references <script src="script.js"></script> and it no longer knows how to resolve script.js.

I tried looping through the source as a string and replacing tags with the object url. But I'm hesitant to continue with that route because I think it would prove to unreliable, as more complicated projects may get out of hand.

Any thoughts or examples would be much appreciated!


Category: javascript Time: 2016-07-31 Views: 80

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development


Front-end development


development tools

Open Platform

Javascript development

.NET development

cloud computing


Copyright (C), All Rights Reserved.

processed in 0.233 (s). 12 q(s)