auto click a specific location on an iframe using javascript/html - javascript

I'm fairly new to html so basically I have an Iframe and I want it to auto click a specific location when a user enters a website. I want it physically click the google search button Is it possible to give a location for a click? If so it would be helpful to display some code. This is what i got so far.
<html>
<iframe src="http://www.google.com" width="700" height="500" frameborder="1">
<p>Your browser does not support iframes.</p>
</iframe>
</html>

Assuming you can load www.google.com into an iframe, you might try adding a query string onto the end of the URL.
Something like https://www.google.com/#q=my+search+criteria
The user doesn't click anything, but search results are loaded (assuming Google will let you load its website in an iframe).

Related

Jumping toward text of CTRL-F inside iframe (pdf) embedded in page (js)

for a project I'm working on I have extracted certain sentences from a pdf (uploaded by a user) and I now embedded this pdf inside my page:
<iframe seamless
id="PDFdisplay"
src="pdfURL"
type="application/pdf"
height="1000px"
width="100%"></iframe>
Now when I press CTRL-F and enter one of the sentences I extracted, it does find this sentence back in the pdf (it gets selected) but it does not jump towards this section of the HTML page like it normally does (and like I want it to). I presume it has something to do with the iframe being a different 'window' but unsure. Does anyone know of a way I can search inside the iframe (using js/ts) or to embed the pdf inside the page in a way such that the page will jump to the results of the CTRL-F event (also enabled using js/ts)?
Thanks in advance!

How i can stop dialoges in html page

I am trying to make html page that contain ads that prompt messages and dialoges like image below that makes redirects and loss original page and loss users
Example of dialoge
I want to stop any prompts or any dialoges on this page
My code is very simple html page with iframe
<iframe src="https://go.pub2srv.com/afu.php?id=1326365" height="500" width="900"></iframe>
Thanks
You could prevent the iframe from running Javascript by adding a sandbox attribute to the <iframe> element. Here's how it may look:
<iframe src="https://go.pub2srv.com/afu.php?id=1326365" height="500" width="900" sandbox=""></iframe>
You could refer to this page to understand how that works: https://www.w3schools.com/tags/att_iframe_sandbox.asp
Of course, this is the perfect solution because the iframe might require some privileges, in such case you could add specific privileges that the particular ad requires.

how to get control over dowload button while viewing pdf in Iframe in jsp

I am using iframes in my Jsp page to display Pdf. It's working perfectly and showing pdf correctly .
Now I need to add an entry to database while downloading or take print using the icons shown in pdf. Is there any way in jquery or javascript to get the click event of that icons, so that i can insert an entry into database?
this is my jsp page,
<div class="m6" >
<iframe src="test.pdf" width="875" height="95%" id="iframe" >
<p>Your browser does not support iframes.</p>
</iframe>
</div>
I am using servlet(pdfServlet) to display pdf. Any help will be appreciated.
The PDF is loaded into an application that is separate from the browser (although embedded in the browser) and there is no communication between the PDF application and the browser. So any events that occur in the PDF are not 'transmitted' to the browser and therefore cannot be captured.
I suggest that you redesign it so that the buttons are in the web page and therefore the click events are detectable.

Disabling double click inside the IFRAME with remote source

Folks,
We have one strange requirement where we want to disable double click inside the IFRAME.
The complication here is HTML response is coming from remote URL and we donot have any control over it. Is it possible to disable double click inside this IFRAME.
e.g.
Iframe src="http://removeserver/view.jsp" height="300px" width="300px">
Note : We already investigated and it seems because of cross side scripting we cannot do this.Basically we cannot access HTML elements of page remoteserver/view.jsp as it is coming from remote web site.
Any help will be highly appreciated.
Empty div above iframe will disable any mouse actions on iframe content
http://jsfiddle.net/uxUF8/63/
<iframe with="300" height="300" src="https://www.youtube.com/embed/OsOYg5gpS0s" ></iframe>
<div style="position:absolute;margin-top:-300px;width:300px;height:300px;border:1px solid red;" ></div>
another version allows you to scroll inside http://jsfiddle.net/uxUF8/62/

How to display pdf content in web page using html5 and jquery?

How to display pdf document inside my div. I am using HTML5 and jquery to build my mobile site. I need to display my pdf document inside a Turnjs div
need to flip pages and go to specific page
<div>
<object data="test.pdf" type="application/pdf" width="300" height="200">
alt : test.pdf
</object>
</div>
Read this thread - http://www.webdeveloper.com/forum/showthread.php?152923-PDF-within-a-DIV
You can use this code:
<embed src="http://domain.com/your_pdf.pdf" width="600" height="500" alt="pdf" pluginspage="http://www.adobe.com/products/acrobat/readstep2.html">
Or use Google Docs embeddable PDF viewer:
<iframe src="http://docs.google.com/gview?url=http://domain.com/your_pdf.pdf&embedded=true"
style="width:600px; height:500px;" frameborder="0"></iframe>
Dare I speak it's name for fear of being castigated, but you could use an iframe and allow the browser to provide the navigation.
What I do is drag the pdf to google drive. Then, click on the new pdf (it will usually be upper left in google drive), click the share icon at the top, go to advanced, then click change and make sure the "Public" radio button is clicked. Click SAVE, then click DONE.
Now go back to google drive, click on the pdf to open it, then click the Pop-out icon (upper right, next to the X close icon). Once the pdf is now full screen, click the : more actions icon (three vertical dots) There you will find an "Embed" opportunity. Click that and you get the embed code. Voila!!
Note: The pdf gotten this way will be ready to paste into your blog or HTML website, AND any links in the document will work!! AND, there will be a little Pop-out icon in the upper right, upon hover, that makes the pdf full screen. And, you can pop it into a div if you want to put more than one on the page. Some examples are up at http://internetpdf.com.
John Burch

Categories