gosu^ Posted November 24, 2005 Share Posted November 24, 2005 i got 2 pages and a pdf file in one page i got an <a name="apps"></a><h2>Application Form</h2><ul><li><a href="skillsad_app.pdf">PDF format</a> (57KB)</li></ul> from the other page ive typed <a href="whatever.html#apps">apps</a> so that it links strait to the pdf file. is there anyway to get it to automatically open this file or does the user have to click the link in order to open it? Link to comment Share on other sites More sharing options...
aspnetguy Posted November 24, 2005 Share Posted November 24, 2005 you could use javascript to open a new window containing the pdf when the page loads instead of waiting for the user to click the link. Link to comment Share on other sites More sharing options...
Chocolate570 Posted November 24, 2005 Share Posted November 24, 2005 You can do a bit of javascript so that it auto-opens on page load.In the body tag, add this:onload="openFile()"In the head section, add this: <script type="text/javascript">function openFile(){window.open("whatever.html#apps");}</script> That will open a new window with it. Or, if you wanna just change the location of this window: <script type="text/javascript">function openFile(){window.location="whatever.html#apps";}</script> Link to comment Share on other sites More sharing options...
gosu^ Posted November 24, 2005 Author Share Posted November 24, 2005 lol yeah but problem is the page has got other content aswell which i want the user to see before the window pops open - they might not want to be forced with anouther window. i've kind of made a different way around it for now (just opend the pdf file from the link on the other page with target=_blank so they just have to go to the other window.)ta anyways Link to comment Share on other sites More sharing options...
Chocolate570 Posted November 24, 2005 Share Posted November 24, 2005 Well, if you still need it, you can use the javascript timing statement. Post if you still need help. Link to comment Share on other sites More sharing options...
Skemcin Posted November 25, 2005 Share Posted November 25, 2005 The best way to have a file open automatically when a page loads is to use the meta refresh tag: <meta http-equiv="refresh" content="2;url=xxxxxx.xxx"> This will ensure you that you won't have to worry about popup blockers and it won't waste a browser window since the adobe plug in should open a separete window since its not being linked to directly. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now