joseph / Monocle

A silky, tactile browser-based ebook JavaScript library.
http://monocle.inventivelabs.com.au
MIT License
743 stars 200 forks source link

instead of opening, the page is downloading #200

Closed KogBasetti closed 10 years ago

KogBasetti commented 10 years ago

Hi Joseph,

Thanks for you work in monocle, i am using monocle to read an unzip epub file on my server. IE-10 is working fine, but other browsers prompting me to download the content file loading in iframe.

I am using .aspx file so that i can load epub list from database and capture the user choice of reading dynamically

i have written following code in script of my .aspx file

(function(){

epub_dir='<%=Session["SelectedEpubs"]%>'; //based on this //code for getting spine // code for getting allChapters // code for getting myMeta

var bookData = Monocle.bookData({ components: spine, chapters: allChapters, metadata: myMeta });

var cbr = function (reader, contactListeners) { var bt = {} bt.createControlElements = function () { cntr = document.createElement('div'); cntr.className = "bookTitle"; runner = document.createElement('div'); runner.className = "runner"; runner.innerHTML = reader.getBook().getMetaData('title'); cntr.appendChild(runner); if (contactListeners) { Monocle.Events.listenForContact(cntr, contactListeners); } return cntr; } reader.addControl(bt, 'page'); return bt; }

   var init1 = function () {
   var options = {
                         panels: Monocle.Panels.IMode
                        }
    var flp = {
                  flipper: Monocle.Flippers.Slider
                 }
    window.reader = Monocle.Reader('reader', bookData, flp, options);
  }

Monocle.Events.listen(window, 'load', init1());

})();

If any error found in code, kindly suggest me the same. Thanks

joseph commented 10 years ago

Hm, I don't think this is a JavaScript issue — it sounds like maybe the HTTP headers your ASP application is sending are confusing the browser. Check the content-disposition and the content-type of your server responses.

KogBasetti commented 10 years ago

Thanks for reply.

By configuring MIME type in IIS, its resolved.

KogBasetti commented 10 years ago

Hi,

I am sorry, i am back with another issue, as i am facing a new problem, with fire-fox 21. the epub content is not coming. In firebug when i check its around "-moz-column-width". i have removed this attribute from monocore.js, but it is still coming when the page is grenerated.

fire-fox 22beta is running good, but in 21 and lower this issue is coming.

images are attached:

image 1 image_2

danshultz commented 10 years ago

I'm not exactly following regarding your issue - also, you should typically open a new issue as the problem listed here is unrelated to the original ticket that was opened.

Could you please explain the behavior you are seeing? In firefox21, the epub content is not displaying but in firefox22, the content is displaying properly?

KogBasetti commented 10 years ago

this issue has been solved. actually that was a width setting issue. as in different browser width renders differently, so this issue was, I fixed the div reader width properly and now its running.

Thanks