473,387 Members | 1,520 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How do I link a page to another page that contains dynamic content?

This is probably very simple, but can't figure out how to do it...
Need to link my navigation from one page ( "fundraising.php") to another page (schedule.php) but to a specific date, 4th Dec ==> Problem, the content of this date (04dec12.php) is in an iframe, default being closest date (i.e. 01dec.php). How can I link from one page (fundraising.php) to schedule.php making sure that in the iframe of schedule.php (see second code below) the content of 03dec12.php is displayed (in td2)?

navigation-code:(yes, a href-code is wrong, as I can't figure out how to link to schedule.php and then to 04dec12.php at the same time!!!)
Expand|Select|Wrap|Line Numbers
  1. <ul id="nav">
  2.    <li id="home"><a href="index.php">Home</a>
  3.    </li>
  4.    <li id="schedule"><a href="schedule.php">Schedule&nbsp;<img src="img/navarrow.png" border="0" alt="arrow down" /></a>
  5.       <ul>
  6.          <li><a href="schedule.php#dec1">1<sup>st</sup> December</a></li>
  7.          <li><a href="schedule.php#dec2">2<sup>nd</sup> December</a></li>
  8.          <li><a href="schedule.php#dec4">4<sup>th</sup> December</a></li>
  9.       </ul>
  10.    </li>
  11.    <li id="fundraising"><a href="fundraising.php">Fundraising&nbsp;<img src="img/navarrow.png" border="0" alt="arrow down" /></a>
  12. </li>
  13. </ul>

Below is code from schedule.php, where 1st td-cell is links to the dynamical iframe in second td-cell.
Expand|Select|Wrap|Line Numbers
  1.  
  2.     <table>
  3.     <tr>
  4.     <td><!-- td1 schedule dates -->
  5.     <div class="textlink"><a href="01dec12.php" target="scheduleDetails"><b>1<sup>st</sup> December, 1pm to 5pm</b></a></div>
  6.     <div class="textlink"><a href="04dec12.php" target="scheduleDetails"><b>4<sup>th</sup> December</b></a></div>
  7.     <div class="textlink"><a href="16dec12.php" target="scheduleDetails"><b>16<sup>th</sup> December</b></a></div>
  8.     </td>
  9.     <!-- second td cell will dynamically change content dependent on which link is clicked above. -->
  10.     <td><!-- td2 datespecific content -->
  11.      <iframe name="scheduleDetails" src="01dec12.php" scrolling="no" width="100%" height="400px" marginwidth="8px" frameborder="0"></iframe>
  12.     </td>
  13.     </tr>
  14.     </table>
  15.  
THANKS for any help!
Nov 11 '12 #1
1 1655
acoder
16,027 Expert Mod 8TB
One way you could do this is by passing a variable in the URL, e.g. the hash as you've tried. Then on page load (onload event), use location.hash to determine which page to load.

Even better, use PHP as you're loading a new page anyway and it would work without JavaScript enabled.

Having said that, loading the page in the iframe may not be the best way to change content, but probably the simplest.

If you want to use JavaScript, then you could use Ajax to load the content, but that will require a little more expertise.
Nov 14 '12 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: | last post by:
Can I link to another page with a <input type=button> without javascript??? Thanks
3
by: Blue Streak | last post by:
Hello, Folks! I am trying to create dynamic content for an IFrame object within an ASPX page. I did not want to try and pull its content from another page. Previously in ASP.Classic I would use...
4
by: namemattersnot | last post by:
Re, SCENARIO: User clicks a link and a javascript function creates dynamic content in <div id="content"></div> using: document.getElementById("content").innerHTML = something In the page's...
1
by: aolba | last post by:
I manage to use an example of AJAX to insert dynamic content inside DIVs. Everything goes OK, until I noted the dynamic content didn't dysplay the flash animation. I didn' get errors or anything....
1
by: czi02 | last post by:
Hi there;;; Does anybody out there knows how to create another page or link with?? First, I had a page name image.htm and saved it on my shared files My html goes like this ...
9
by: pbd22 | last post by:
Hi. This is just a disaster management question. I am using XMLHTTP for the dynamic loading of content in a very crucial area of my web site. Same as an IFrame, but using XMLHTTP and a DIV. I...
1
by: phopman | last post by:
Hello lads! And ladderettes of course :-) I have a serious issue: I have a table. It consists of: ID Name Link ContentID ID is primary key, and ContentID is the foreign Key. What my...
2
by: Razzbar | last post by:
I was wondering if anyone has experience with snap.com's service, where you put a reference to a remote script on your page. The script causes a small snapshot of a web page to appear wherever the...
4
by: skeerthi | last post by:
Hi While writing python script using pamie tool i got this problem. In a webpage if we have more than one link(with the same name) to another page than how we can identify the link we wanted to...
21
KeredDrahcir
by: KeredDrahcir | last post by:
I have an HTML link and for some reason I can't click on it in Firefox. When I mouse over, the pointer stays an arrow. If I tab to the link it works but that is the only way to use it or to get it...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.