473,383 Members | 1,861 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,383 software developers and data experts.

Same effect but when page reloaded?

[Font=Verdana]Hi,

I wrote a this piece of code in let's say page1.php:
Expand|Select|Wrap|Line Numbers
  1. <script language="JavaScript">
  2. function bgi01(){
  3.     document.getElementById('changeThisBG01').style.backgroundImage='URL(mp02.jpg)';
  4.     document.getElementById('changeThisBG02').style.backgroundImage='URL(mp01.jpg)';}
  5. function bgi02(){
  6.     document.getElementById('changeThisBG02').style.backgroundImage='URL(mp02.jpg)';
  7.     document.getElementById('changeThisBG01').style.backgroundImage='URL(mp01.jpg)';}
  8. </script>
  9. <table width="185" border="0" cellpadding="0" cellspacing="0">
  10.   <tr> 
  11.     <td width="185" height="165" valign="center" align="center" id="changeThisBG01" style="background-image: url(mp01.jpg); background-repeat:repeat-x;"><a href="javascript:bgi01()">BG1</a></td>
  12.     <td width="185" height="165" valign="center" align="center" id="changeThisBG02" style="background-image: url(mp01.jpg); background-repeat:repeat-x;"><a href="javascript:bgi02()">BG2</a></td>
  13.   </tr>
  14. </table>
  15.  
My question:

This codes excecutes without pagereload.
Any suggestion how i could make the same effect but with this difference that the page is reloaded? <href="page1.php">

Thanx for help.

Thoaren[/font]
Apr 11 '06 #1
2 1236
:confused: Nobody?
Apr 11 '06 #2
acoder
16,027 Expert Mod 8TB
Pass a reference to the table cell clicked, e.g.
Expand|Select|Wrap|Line Numbers
  1. href="page1.php?td=BG01"
then take the value from the URL either using PHP or onload using JavaScript.
Oct 2 '07 #3

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

Similar topics

33
by: Philip Herlihy | last post by:
I'm creating a common navigation bar of text "buttons" using CSS. On each page, I want the corresponding button to be "inert" (no hover, etc) as a visual clue to where you are. I thought I'd...
1
by: krian | last post by:
Hi, I need a help from anybody. My problem is here I wrote two WebApplication in ASP.net Using C#. The name of the applications are (Journal.aspx and Payment.aspx). These Two pages have DataGrids...
3
by: Richard | last post by:
Hey there, I have a textbox and a listbox. When a user types a number in the textbox, I want to get all the records from a MS Access DB but without reloading the page. I now have something...
1
by: Lenard Gunda | last post by:
Hi! I have the following problem. From my main page, when someone clicks a button, it uses client side javascript to open another .aspx page. This page displays content, based on what the...
1
by: Thoaren | last post by:
Hi, I wrote a this piece of code in let's say page1.php: <script language="JavaScript"> function bgi01(){ document.getElementById('changeThisBG01').style.backgroundImage='URL(mp02.jpg)';...
3
by: Bob Sanderson | last post by:
I am trying to create a form for a MySQL database similar to a spreadsheet. The idea is to display a list of records, with the last line of the list being an input form. When the user enters data...
5
dmjpro
by: dmjpro | last post by:
i saw some magic web pages ..... when press back button then the same page again and again reloaded ... is it possible in js ...... plz help me out ... thanx in advnace .......
5
by: OBAFGKM_RNS | last post by:
I have a javascript timer on my page that counts to 10. Every half second it alternates images on my buttons from a lighter image to a darker image, giving the appearance of the buttons blinking....
7
by: TomDestry | last post by:
I have a web page and lots of XML files. When a link is clicked on the page, it calls a function via onclick with the XML file as a parameter: <body onload="InitContent();"> <a name="fileName"...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...

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.