Quantcast
Channel: Adobe Community : Popular Discussions - JavaScript
Viewing all articles
Browse latest Browse all 12130

Javascript to Open URL in New Window w/o Toolbars

$
0
0

Hello All,

 

I need to find a way to open a link in a PDF and have it go into its own window without navigation bars.

 

I have tried to do this in a multitude of ways to no avail.

 

First: I tried to write html with javascript for what I need

<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><style type="text/css"></head><script>
function popitup(link) {  var w = window.open(link.href,        link.target||"_blank",        'menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no,dependent,width=800,height=620,left=0,top=0');  return w?false:true; // allow the link to work if popup is blocked
 }</script><body><p class="title"><strong>Knowledge  Check Assessment</strong><br/><img src="line.jpg" alt="line" width="720" height="1" align="top" /></p><p class="normal">Complete the  <a href="http://www.google.com" onClick="return popitup(this)" target="_blank">Assessment</a> to check your understanding.</p></body></html>

 

This worked fine when opened in a browser, but when I turned the webpage into a PDF all the scripting disappeared... which makes sense but I thouhgt this might work.

 

Second:  I tried to change the link inside the pdf to run JavaScript directly instead of in launching the URL. I used this:

window.open("http://www.google.com","_blank",'menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no,dependent,width=800,height=620,left=0,top=0');

 

Which seemed to do nothing at all.

 

So after researching I found this: https://forums.adobe.com/thread/727714?tstart=0

Which referenced a Adobe page that might indicate that what I need to do isn't possible at all, but the language is so muddy I cant decipher it.

 

So I tried the code suggested by the gentelman there George Johnson

app.launchURL("http://www.example.com/example.html", true);

Which works, but does not include the part about not having toolbars and menu bars etc, and each time I try to add it I get a syntax error.

 

Does anyone have any idea if what I am trying to do is possible, and if so what am I doing wrong?

 

Thank you so much for your time and attention to this issue, I have been working on this a big portion of the day and I am at a standstill on my project until I reach a resolution.

Amy


Viewing all articles
Browse latest Browse all 12130

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>