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!

Replay

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

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development

search

Front-end development

Database

development tools

Open Platform

Javascript development

.NET development

cloud computing

server

Copyright (C) avrocks.com, All Rights Reserved.

processed in 0.787 (s). 13 q(s)