I have a banner which is rendering through iframe. But it is taking time to load. I want to load the iframe parrallel to the css and javascript on the page.
Related
I am using the PDFViewer from pdfjs-dist in react app to render the pdf. Pdf is getting render and I can see all pages in DOM but some pages are loaded as we scroll down page is set with data-loaded="true".
How can we load all pages without loader and data-loaded="true"?
I'm developing an ionic app in iOS, I placed the pdf inside an iframe just by simply doing the following:
<iframe src="https://docs.google.com/gview?embedded=true&url=http://example.com/resources/myfile.pdf" mozallowfullscreen marginwidth="2" marginheight="2" width="90%" scrolling="auto"></iframe>
I didn't used cordovaInAppBrowser because I ran a lot of problem like after clicking the button the InAppBrowser doesn't open unless I don't minimize the app. So I just used iframe as the workaround. But the problem now is that, after the pdf being loaded, and the user clicks on the full screen of pdf, there's no back button. Is there a way I can remove the full screen button from the pdf or add a back button on full screen mode of pdf? I tried removing the mozallowfullscreen but doesn't work since it's for the iframe not for the pdf.
P.S.
I tried accessing the div inside the iframe that holds the button for full screen, but no good, it doesn't get the div, it's probably because I'm violating the Same Origin Policy.
Here's the code on how I tried to access the div:
$('#myframe').each(function(){
console.log($("div[role='toolbar']"));
});
Could you explain the behavior of UIWebView -loadHTMLString:baseURL:?
For example I've got a simple html, which i want to render:
<html>
<body>
Test message <br>
<img src="%http_path_for_unreachable_resource%" />
</body>
</html>
In previous versions of SDK (equal or less then 6.x) UIWebView renders this html and shows 'Test message' without waiting for complete loading of all resources in html.
In 7.0 beta SDK behavior has been changed. Now where is no way to show any content in UIWebView without full loading of all resources. So I see a blank white screen without 'Test message'. Some time later then request for unreachable resource fails with timeout, UIWebview show its content.
I have already tried to force show content by using javascript in -stringByEvaluatingJavascriptFromString, by calling -setNeedsDisplay for all subviews of UIWebView.
Is possible to get an old rendering behavior of UIWebView?
I have the following problem: When I use either the jQuery Mobile back-button or the changePage function of jQuery Mobile to return to the previous page it doesn't show any data on the page. All javascript gets executed but page remains empty..
Any ideas?
This was a problem I faced when I was removing pages from the DOM via javascript to prevent the first page from sticking into the DOM. All it would show was a blank page when clicking the back button.
Are you removing previous pages from the DOM in your javascript?
And when you say the page "remains empty", is it just the data within the content tags, or is nothing appearing on the page at all (including jquery mobile enhancement markup)?
You should post your changePage function here so that I and others can help you out.
I have faced a pretty strange issue. I'm trying to display pdf files using iframe. Little documents, consisting of 1-2 pages, are displayed correctly. But when it comes to documents consisting of for example 5 "heavy" pages, the iframe doesn't display the whole document - the document is cropped and as a result about 2-3 pages are displayed only.
Below is my code. As you can see it's pretty straightforward.
<html>
<head>
<title>Testing iFrames on iPad</title>
</head>
<body>
<iframe id="iframe" name="iframe" height="100%" width="100%" scrolling="no" src="https://developer.apple.com/library/safari/documentation/AppleApplications/Reference/SafariWebContent/SafariWebContent.pdf" />
</body>
Can anyone help me to find out what is the reason for such strange behavior?
From what I understand iframe's height is what's responsible for the page cutting off, as you're actually scrolling the frame, and not the pdf inside the frame (i.e. setting height to "400%" will potentially give you the space you need, but it's sloppy).
This solution uses JavaScript to scroll the pdf contents itself, and may help:
how to properly display an iFrame in mobile safari