Jump to content
Larry Ullman's Book Forums
rdfuhr

Accessing Sample Html And Scripts From Dropbox App On Ipad

Recommended Posts

I downloaded the zip file containing the sample HTML and scripts for the book from this web page http://www.larryullman.com/books/modern-javascript-develop-and-design/ decompressed it and saved it as a set of folders in my Dropbox account.

 

What I wanted to be able to do was to use the Dropbox app on my iPad to select a particular HTML file and see how it rendered on the iPad, but it didn't seem to work (I didn't get an error message; it just didn't display the rendered page).

 

I realize that this may be more of a question related to the Dropbox app on the iPad than it is about HTML or JavaScript, but Dropbox claims, in their help documentation, that they do support files of type HTML in their iPad Dropbox app.

 

So, I am looking for any suggestions as to how I could directly view these web pages (powered by the associated JavaScript) on my iPad.

 

There is an indirect way to view those files, and that is, via the Dropbox app on my Mac, I can "copy public link" and email that link to myself on the iPad (for example https://dl.dropboxusercontent.com/u/1124048/Sandbox/javaScriptLearn/modern_javascript_scripts/ch07/today.html ), but I am seeking a more direct approach.

Share this post


Link to post
Share on other sites

Hello, and welcome to the forums.

 

I do not own an iPad, so I can't test anything out, but why not make a very simple HTML script that contains some basic JavaScript, upload that script to your Dropbox account, and then test that on your iPad?

 

By doing so, you'd very quickly be able to determine whether the issue with Larry's scripts is related to Dropbox or the scripts themselves.

Share this post


Link to post
Share on other sites

Thanks for your suggestion. What I have tried so far is to try another cloud service, a competitor to Dropbox called Box. I uploaded all of Larry's sample HTML files, scripts, and CSS files there and am noticing similar nonresponsive behavior. The same HTML files, scripts and CSS files do all work when I have them as local files on my computer. So my conjecture so far is that there is something about these cloud services that do not work properly when trying "web hosting" except for the fact that if I do a "copy public link" for a sample HTML file in Dropbox, then when that link is accessed via a web browser in Safari, all works fine. I need to do more investigations and tests.

Share this post


Link to post
Share on other sites

Like I said, make a simple script that outputs a couple lines of HTML out to the screen and then maybe alerts a couple of things via JS. Place all of that in one file, and try running the file from the provided URL.

If that doesn't work, then I imagine no HTML/JS will. However, if it does work, then that means that the file paths or something is screwed up.

Share this post


Link to post
Share on other sites

I did the following two experiments as HartleySan suggested.

 

1.  I created an HTML file that had the JavaScript in the same file, and the JavaScript just invoked an alert.  This worked properly on my Mac and also on my iPad; I could see the alert on both devices.

 

2.  I then moved the JavaScript containing the alert to a separate .js file (in the same directory as the HTML).  This worked properly on my Mac, but it did not work on my iPad.  I could see the alert on my Mac, but could not see it on my iPad.

 

So, this suggests that something is not right when using the Dropbox app on my iPad to view HTML files that refer to a file path for a separate JavaScript file.

 

3.  I also did the following experiment, similar to what I did a couple days ago.  I did a "copy public link" of the HTML file that had the JavaScript in a separate file, and I opened this link using Safari on my iPad.  This time, the alert did appear when viewing the web page on my iPad.

 

So, this means that, under certain circumstances, such as in test #3, the file paths do work properly for files contained in Dropbox when the web page is directly viewed using Safari on the iPad, and is not accessed through the Dropbox app.  But in test #2, the file paths do not work properly when the web page is accessed through the Dropbox app on the iPad.

  • Upvote 1

Share this post


Link to post
Share on other sites

Thanks for testing all that and sharing the results.

For test #2, maybe try changing the relative path to the JS file in the HTML file to an absolute path, and see if that works.

 

Thanks.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...