OK - but I need to know how I would pass this function through in order to insert the content in a div?
<a href="javascript:InsertCon
Main Topics
Browse All TopicsI have some javascripts on this page (http://www.lafirecu.org/n
I need to create a link on another page that needs to link to the news.php page like any other ordinary link, however the content needs to be inserted depending on which link is clicked on.
For example:
news.php#70 - should link to the news page and initiate the function javascript:InsertContent('
Is there a way that I can pass the function call through the URL? The site is using the php language, so maybe there's a way to write some sort of an if /else statement.
Thanks for any help.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
I do not understand what you mean by "pass this function through" .
The code I have written above detects the presence of an in-page anchor in the "hash" as javascript calls it. The last 3 lines of the checkHash() function use the value, put in variable h, to put content in a div.
Guessing wildly at what you might mean:
function checkHash() {
if (''==document.location.has
var h=document.location.hash.s
InsertContent(h);
}
Here's the script I place on the news.php page. You can see examples on:
http://www.lafirecu.org/ne
<script type="text/javascript" language="JavaScript"><!--
function RemoveContent(d) {
document.getElementById(d)
}
function InsertContent(d) {
document.getElementById(d)
}
//--></script>
Right - but what will the URL look like?
http://www.lafirecu.org/ne
You're not understanding.
I don't need to link to an anchor on the page, have you gone to the page? If you notice on the page, when you click on Read More>>, it dynamically displays a div by triggering a javascript function InsertContent().
I don't need to pass the anchor link, I simply need the page to basically display the div as its loaded, and I can't place the javascript function call in the body onLoad because it n eeds to display the right content depending on which piece I click on from the homepage.
Get it now?
try this
type in this url into teh address line
http://www.lafirecu.org/ne
and then place this in body
<body onload="InsertContent(url.
Business Accounts
Answer for Membership
by: arantiusPosted on 2005-10-16 at 13:18:24ID: 15095564
Online demo: /Q_2159682 6.html#12 /Q_2159682 6.html#39
l11/dtd/xh tml11.dtd' > 999/xhtml' xml:lang='en'> h) return; ubstr(1);
ut').appen dChild(doc ument.crea teTextNode (
http://www.arantius.com/ee
http://www.arantius.com/ee
Code:
<!doctype html public '-//w3c//dtd xhtml 1.1//en' 'http://www.w3.org/tr/xhtm
<html xmlns='http://www.w3.org/1
<head>
<meta http-equiv='content-type' content='text/html; charset=iso-8859-1' />
<title>Evalulate in-page-anchor (hash) via javascript</title>
<script type='text/javascript'>
function checkHash() {
if (''==document.location.has
var h=document.location.hash.s
document.getElementById('o
'You clicked on link: '+h
));
}
</script>
</head>
<body onload='checkHash();'>
<div id='out'></div>
</body>
</html>