iraychen / flexpaper

Automatically exported from code.google.com/p/flexpaper
0 stars 0 forks source link

onDocumentLoaded combined with searchText yields undefined is not a function error unless setTimeout applied. #416

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Using onDocumentLoaded to trigger searchText method. 
2. Happens on some books, not on others

What is the expected output? What do you see instead?

*Expected*: Book and search results. *Instead*:  Uncaught TypeError: undefined 
is not a functionVM14067:1 window.FlexPaperViewer_HTML.g.searchTextVM14067:1 
(anonymous function)

What version of the product are you using? On what operating system?

No version specified in JS. ~ Late 2014.

Please provide any additional information below.

If I wrap searchText call in a setTimeout of 1500 milliseconds, this error 
disappear on one book, but that timeout may vary depending on various timing 
circumstances (size of book? client internet speed? etc)

This feels like a bug, it seems like onDocumentLoaded is firing before the 
document *IS* actually loaded to some extent?

Original issue reported on code.google.com by gordonbi...@gmail.com on 19 Feb 2015 at 9:58