Jump to content

linking


gosu^
 Share

Recommended Posts

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

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

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...